advantage gen & java: deployment & testing with open source by tim russell...

20

Upload: annice-melton

Post on 17-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)
Page 2: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Advantage Gen & Java: Deployment & Testing with Open Source

By Tim Russell ([email protected] www.maerskdata.dk)

Page 3: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Introduction

•Background – ( Self, This presentation)•Really came out of self study / “need to know” / Proof-of-concept (e.g. what were JBoss/Tomcat/Apache)•Goal was to complete the TUTORIAL, but ..•Found out that using “Getting Started” was a good idea to validate the Environment•Lead to going sequentially through most of the “layers” of AdvGen and Java Deployment.

Page 4: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

What about the Audience?

• How Many Have worked with:• Gen Proxies:

• Java? COM? XML?

• Apache (or Tomcat)?

• Jboss?

• Web Services and Apache Axis?

• What level of interest in this TODAY?

Page 5: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Agenda

• Open Source Java (Server) Software (Tomcat/JBoss/Axis)• Setting up the PC Dev/Test Environment• “Gen”ing and testing the Java Proxy

• Installing JBoss

• The generated code

• Deployment (ear,war,jar,jsp)

• Jboss/Tomcat vs. Tomcat Standalone

• DEMONSTRATION • AdvGen & Web Services (optional)

Page 6: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

What is Open Source? Why is it of Interest?

• Apache

“The Apache Software Foundation provides support for the Apache community of open-source software projects. The Apache projects are characterized by a collaborative, consensus based development process, an open and pragmatic software license, and a desire to create high quality software that leads the way in its field. We consider ourselves not simply a group of projects sharing a server, but rather a community of developers and users.”

Page 7: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

What is Open Source? (Continued)

• Jakarta

The Jakarta Project creates and maintains open source solutions on the Java platform for distribution to the public at no charge.

• Tomcat

Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.

Tomcat 4.x implements a new servlet container (called Catalina) that is based on completely new architecture. The 4.x releases implement the Servlet 2.3 and JSP 1.2 specifications.

Page 8: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

What is Open Source? (Continued 2)

• JBoss/Server is the leading Open Source, standards-compliant, J2EE based application server implemented in 100% Pure Java:

• JBoss was started in 1999 as an open source EJB container.

• JBoss 2.x was a full J2EE based server.

• JBoss 3.x. is the current production series. JBoss is a full framework for you to build your own applications. It is based on a full microkernel (JMX) and service oriented architecture (SOA).

• JBoss 4.x. Research. JBoss is exploring aspect oriented middleware (AOM) and java based middleware independent of J2EE.

• Released as free software under the terms of the GNU Library or Lesser General Public License (LGPL).

Page 9: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

What is Open Source? (Continued 3)

• There are many more Projects; here are just a few:• Mozilla.org

• The Mozilla project promotes choice and innovation on the Internet by developing the open source Mozilla web and email applications suite.

• FireFox

• The Browser, Reloaded - an award winning preview of next generation browsing technology. Firefox empowers you to accomplish your online activities faster, more safely and efficiently than any other browser, period. Built with Tab browsing, popup blocking and a number of other seamless innovations, Firefox stands out ahead.

• jEdit.org : jEdit - Open Source programmer's text editor

• Useful, e.g to edit Java; released as free software under the terms of the GNU General Public License.

• eclipse.org : full Java IDE, including testing.

Page 10: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Building a Local Development & Test Environment

• Gen Stuff• Advantage Gen PC Toolset (v 6.5) + Java Proxy Option

• Microsoft Visual Studio C++ (6.0) – optional

• DBMS, e.g IBM UDB PDE (7.2) – optional

• Java Stuff• Java 2 SDK Standard Edition from Sun Microsystems, v 1.3.1

(1.3.1_02); a.k.a. “JDK 1.3.1”

• JBoss Application Server (with Tomcat) – JBoss 2.4.10/Tomcat 4.0.6

NB: This is all explained in AdvGen eBooks, Getting Started – Chapter 4

Page 11: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

JBoss Installation

• Download from www.jboss.org (drill down to older releases):• e.g. JBoss-2.4.10_Tomcat-4.0.6.zip 13,691,362 bytes

• “Un-zip” the software into the following folder hierarchy:..\JBoss-2.4.10_Tomcat-4.0.6\

..\catalina\

..\bin\

etc.

..\jboss\

..\bin\

etc.

• There is some documentation, but it is confusing.• Start Catalina (standalone) with its “startup.bat” file (well documented).• Start JBoss with its “run_with_tomcat.bat” file (un-documented).

(modified .bat file available – send e-mail)

Page 12: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

The generated Java Proxy code (1/3)

• Consists of the following parts for each procedure step, each generated into its own folder:

• Abean - An application JavaBean that contains an API for getting/setting the properties for the procedure step. These properties are a direct mapping of the import/export views.

• mainUI - A Java test application (including a UI) that uses the application bean API. It can be loaded via Java runtime execution or from an application debug driver. Its purpose is to test the bean API and provide a model of how the API can be used.

Page 13: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

The generated Java Proxy code (2/3)

• client - An applet JavaBean that contains an API for getting/setting the properties for the procedure step. These properties are a direct mapping of the import/export views. There is no user interface (see clientUI). This is an alternative to the Abean.

• servlet - The server side piece of the Java equation. Its purpose is to provide the communications bridge between the client Bean and the Advantage Gen server.

• clientUI - A test applet (UI) that uses the applet bean API ("client"). It can be loaded either into a web browser or an applet viewer. Its purpose is to test the bean API and provide a model of how the API can be used.

• common - A set of Java classes shared by the client Bean and the servlet. These classes represent the import/export views and are needed for the data streaming between the client and the servlet.

Page 14: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

The generated Java Proxy code (3/3)

• JSP - A set of sample Html and JSP pages that can be used to test the application JavaBean. Its purpose is to test the Abean API and provide a model of how the API can be used.

• XML - Optional. Contains an XML Schema Definition file (XSD) for use within XML data streams, a set of sample XML, and a test application for executing the XML API.

• All of the above is described in detail in AdvGen eBooks, ActiveX/COM and Java Proxy Guide – Chap. 10 (Java Proxy Interface)

Page 15: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Archive files in the Java World 1/3

• .jar – Java ARchive file• A platform-independent file format enables you to bundle multiple files into a

single archive file. Typically a JAR file will contain the class files and auxiliary resources associated with applets and/or applications.

• JAR files are packaged with the ZIP file format, so you can use them for "ZIP-like" tasks such as lossless data compression, archiving, decompression, and archive unpacking.

• Because the Java Archive tool is invoked by using the jar command, for convenience we'll call it the "Jar tool".

• Assuming you have a JDK installed, & included in the PATH, issue the "jar" command to get sample "usage syntax".

• For more info, see: http://java.sun.com/docs/books/tutorial/jar/basics/index.html

Page 16: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Archive files in the Java World 2/3

• .war - Web Application ResourceThe Servlet spec. gives it this definition:

A single file that contains all of the components of a web application. This archive file is created by using standard JAR tools which allow any or all of the web components to be signed.

A Web application is defined as a collection of servlets, JSP pages, HTML documents and other web resources which might include images, files, compressed archives, and other data.

“In Sun's vision of web applications, an entire web application can be packaged in a WAR file. You place the war file in the webapps directory of a servlet engine such as Tomcat and restart the engine. Automatically, the engine discovers that there is a war file which does not have a matching directory structure under webapps and unpacks the whole thing. Bang! you are now running the new application. It actually works.” - William Brogden

Page 17: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Archive files in the Java World 3/3

• .ear - Enterprise ARchive file

The file has the same format as a regular .jar file (which is the same as ZIP, incidentally). The .ear file contains everything necessary to deploy an enterprise application on an application server. It contains both the .war (Web Archive) file containing the web component of the application as well as the .jar file. In addition there are some deployment descriptor files in XML.

Page 18: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Let’s Show Something

• Questions at this point?

Page 19: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Demonstration

• Assumptions:• Cooperative Packaging

• Use AEF (Transaction Enabler) for GEN server deployment

• Show Windows Client (“C”)• Generate/Install Java Proxy

• Show Java Test Harness - from Cmd. Line

• Deploy proxy JSP .ear file to Jboss• Show JSP Test Harness - from Browser

• (optional) Deploy JSP “manually” to Tomcat (running S/A mode)

Page 20: Advantage Gen & Java: Deployment & Testing with Open Source By Tim Russell (tru@maerskdata.dk)

Advantage Gen & Java: Deployment & Testing with Open Source

• Questions

Thank You for attending!

• => The End