Our J2EE application suite is tested and available to run in both Oracle 9i AS and BEA WebLogic 8.1 environments.
It is a pretty complex application suite with multiple functional modules and very rich functionality. On the server side it uses EJBs and JMS to utilize the scalability and performance benefits provided by the application server. On the client-side it uses applets deployed via JNLP. Currently it supports Oracle RDBMS as its persistent storage, but theoretically may be ported [on the DAO layer] to any other database platform.
The application is built and packaged according to J2EE specification in an EAR archive. The EAR consists of a WAR and a set of JARs, which include EJB JARs as well as JARs with some common functionality, shared between modules.
The port to SAP WebAS without changing the persistence layer that is, using Oracle JDBC driver – was mostly painless. It included a basic research of the SAP WebAS architecture, digging in documentation and SDN.The biggest issues were setting up the JMS and configuring the JDBC connector to work with an Oracle database.
Once that part was over, most of the rest was a breeze.
It was interesting to discover that SAP WebAS does not provide a simple way to automatically deploy an application EAR (for example, a monitored file directory similar to BEA or Oracle). Supposedly DeployTool, which is a part of the SAP WebAS suite, has some public API but we didn’t have time to investigate it and write the code to use it. Maybe later, if and when time permits.
Another surprise was the inability for us to deploy an exploded EAR in SAP WebAS. Single file update feature is not documented very well – we could not find out about the required fields in that dialog, such as Module and Mapping, and why we can’t update a JAR file in a root of EAR – it sounds like it has to be either an EJB or a servlet JAR.
Tips regarding the J2EE port:
Most of it (however, not everything) can be found in appropriate documentation, but I felt it was important to cut the learning curve for our developers and testers, so I compiled a list of the following tips:
- How to increase the heap size:
1. Open SAP J2EE Engine Config Tool from command line:
set JAVA_HOME=JDK 1.4 home
2. Expand cluster-data, click on instance_IDXXXX node. On the right-hand tab adjust max heap size (in MB).
3. Expand instance_IDXXXX node, click server_IDXXXX node. On the right-hand tab adjust max heap size (in MB) .
4. In Menu select File-Apply to apply changes.
5. Restart the Web App Server using SAP Management console (in the console select SAP Systems, right-click-Stop, and then after all nodes become gray, right-click Start).
- Oracle JDBC setup:
1. Open SAP J2EE Engine Administrator from command line:
set JAVA_HOME=JDK 1.4 home
2. Connect using Administrator password entered during install
3. Select Cluster tab then expand tree J2E->Server 0_xxx->Services, click on JDBC Connector
4. On the right-hand tab expand Drivers, – it has only SYSTEM_DRIVER installed. Click on Drivers, and Create new driver icon above. Enter Oracle as a name and select an Oracle classes zip in your file system. OK.
- JMS setup:
1. Open and connect to SAP J2EE Engine Administrator (as described in Oracle JDBC Connection setup).
2. Open Cluster tab, expand tree to J2E->Server 0_xxx->Services. Click on JMS Provider.
3. On the right-hand side click on Runtime tab and Create button to create a new JMS Server instance. Enter yourJMSServerName as a name (important!).
4. If you need to use topics: Click on Topics tab create a topic with a name: com.yourapp.jms.yourTopic
5. If you need to use queues:Click on Queues tab create the required queues.
6. Click on Connection factories tab create the required factories for topics and queues:
com.yourapp.jms.YourAppTopicFactory TopicConnectionFactory. Use Administrator username and password to create them.
com.yourapp.jms.YourAppQueueFactory QueueConnectionFactory. Use Administrator username and password to create them.
7. Make sure StartupMode is STARTUP_ALWAYS so that JMS objects are re-started with the app server restart.
- General note on SAP WebAS JMS architecture:
SAP WebAS JMS architecture setup consists of two main parts: JMS Provider and JMS Connector. If we are using a third party JMS Provider we must configure it in JMS Provider. The application and MDBs are referring to JMS Connector factories and destinations, not Providers. So its important to set up JMS Connector factories and destinations, which reference existing JMS Provider factories and destinations. The application deployment descriptors will automatically install the necessary JMS Connector objects, however YourApp JMS server instance must be pre-configured as described above. Also, make sure that JMS Connector objects are JNDI-based and reference JMS provider objects with jmsfactory/yourJMSServerName prefix. However, JMS Connector destinations will reference JMS Connector factories so they shouldnt have the jmsfactory/yourJMSServerName prefix in Connection factory name. Important: com.sap.engine.services.jndi.InitialContextFactoryImpl must be specified in Initial context factory when specifying JMS Connector factories. All other fields in that configuration can be left empty.
In addition to creating SAP WebAS-friendly EAR, another technical requirement was to support an Open SQL layer of SAP WebAS. I will talk about it in the Porting a J2EE application to SAP WebAS and Open SQL. Part II. of this blog.