Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How To Buy
WebLogic Java Adapter for Mainframe User Guide Doc Home | BEA WebLogic Java Adapter for Mainframe User Guide | Previous Topic | Next Topic | Contents | Index

Deploying Applications

Deployment is the process of taking previously developed servlets and/or EJBs and installing them into a specific operational environment. In this case, the operational environment is your WebLogic system. This section describes how to deploy your own applications using the BEA WebLogic Java Adapter for Mainframe (JAM) software.

This section discusses the following topics:

- Deploying Servlets in WebLogic Server 5.1

- Deploying Enterprise Java Beans in WebLogic Server 5.1

- Deploying Applications in WebLogic Server 6.0

Deploying Servlets in WebLogic Server 5.1

Please refer to the BEA WebLogic Server documentation for detailed instructions on deploying servlets.

The following steps provide an example of deploying a servlet by modifying the weblogics.properties file.

Perform the following steps to deploy a servlet:

1. Place a class file for the servlet and all other classes that it depends on into the servlet classpath. Be sure to include the class files for the DataView's that are used by the servlet.

2. Add a registration line to your weblogics.properties file. This line will specify both the URL that will be used to access the servlet, and the full package and name of the servlet class. For example, assuming your server is named www.webstore.com, the properties line weblogic.httpd.register.widgets=webstore.WidgetServlet will cause the class webstore.WidgetServlet to serve requests to the URL http://www.webstore.com/widgets.

   >     weblogic.httpd.register.urlname=mypackage.MyServlet

   This registration line causes the WebLogic Server to use the servlet class "mypackage.MyServlet" to serve all HTTP requests for a page at the URL name (on your host).

3. Add any corresponding remote service entries into the jcrmgw.cfg file. For example, if your servlet invokes a service named widgetQuote, then you would need something like the following in your configuration:

   *JC_REMOTE_SERVICES
   widgetQuote RDOM="myMainframe"
   RNAME="WIDQUOTE"

4. Restart the WebLogic Server.

There are other servlet deployment options, including hot-deploying a servlet into a running WebLogic server. Please refer to the WebLogic Server documentation for more details.

Deploying Enterprise Java Beans in WebLogic Server 5.1

Please refer to the BEA WebLogic Server documentation for detailed instructions on deploying EJBs. The WebLogic samples provide examples of build scripts for UNIX and NT platforms.

Perform the following steps to deploy an EJB:

1. Create a jar file containing the class files for the EJB and any other classes needed by your EJB. This jar file must be constructed following the normal Java requirements for class jar files.

2. Rename the deployment XML files to the standard names (ejb-jar.xml and weblogic-ejb-jar.xml) and place them into the jar file. They must be placed into a subdirectory within the jar file named `META-INF'

3. Use the weblogic ejb compiler (weblogic.ejbc) to build the container classes for your EJB. The command will look something like:

   >           java weblogic.ejbc input.jar output.jar

4. Edit your weblogic.properties file to add the output jar file to the EJB deployment list:

   >           weblogic.ejb.deploy=c:\my\path\output.jar

5. Add any corresponding local or remote service entries into the jcrmgw.cfg file. For example, if your EJB invokes a service named "widgetQuote", then you would need something like the following in your configuration:

   >     *JC_REMOTE_SERVICES
   >     widgetQuote			  RDOM="myMainframe"
   >                   RNAME="WIDQUOTE"

6. Restart BEA WebLogic Server.

EJBs may also be placed into jar files before being deployed, and may be hot-deployed into a running WebLogic Server. Please refer to the Weblogic Server documentation for more details.

If you wish to deploy more than one EJB in the same jar file, the deployment XML files must be combined. Refer to the WebLogic Server documentation.

Give special attention to classpath setting if you are also deploying a servlet that accesses this EJB or the same DataView subclass. You may need to place all common classes on your WEBLOGICCLASSPATH rather than on your servlet classpath.

Deploying Applications in WebLogic Server 6.0

Application deplyment in WebLogic Server 6.0 has evolved to the J2EE standard for web application deployment. This information is not intended to describe how applications are now deployed in WebLogic.

Quick Start information and detailed documentation for deploying applications in WebLogic Server 6.0 can be found at:

>     http://download.oracle.com/docs/cd/E13222_01/wls/docs60/quickstart/quick_start.html
>     http://download.oracle.com/docs/cd/E13222_01/wls/docs60/servlet/admin.html#156888
>     http://download.oracle.com/docs/cd/E13222_01/wls/docs60/ejb/EJB_deployover.html

The basic JAM 4.1.1 eGen servlet is deployed like any other WebLogic servlet. The configuration for the eGen servlet is stored in the web.xml file in an applications directory associated with a domain. The basic default configuration can be found in the following directory:

>     <bea_home>/<wls_home>
>           /config/mydomain/applications/DefaultWebApp_myserver/WEB-INF/web.xml

The eGen servlet classes can be found in the following directory:

>     <bea_home>/<wls_home>
>           /config/mydomain/applications/DefaultWebApp_myserver/WEB-INF/classes

The basic emprec servlet can be configured with an XML entry similar to the following:

Listing 5-1 XML Entry to Configure the emprec Servlet

>     <web-app>
>     	<servlet>
>     		<servlet-name>
>     			emprec
>     		</servlet-name>
>     		<servlet-class>
>     		 empRecServlet
>     		</servlet-class>
>     	</servlet>
>     	<servlet-mapping>
>     		<servlet-name>
>     			emprec
>     		</servlet-name>
>     		<url-pattern>
>     		quickStart
>     			</url-pattern>
>     		</servlet-mapping>
>     	</web-app>

Compare this with the corresponding weblogic.properties file entry from Web Logic Server 5.1:

Listing 5-2 weblogic.properties Entry to Configure the emprec Servlet

>     weblogic.httpd.register.quickStart=empRecServlet

In both cases, the emprec servlet can be invoked from a URL referencing a file named quickStart.

Copyright © 2001 BEA Systems, Inc. All rights reserved. Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.