Skip to Content
In this series of blogs I will share my experience of overcoming the typical challenges of porting a J2EE-compliant application to SAP WebAS. I will not go into any deep details regarding our actual J2EE application, unless it is required to portray the challenge and solution. The blog will also contain useful tips and “how-to” explanations.

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:

    cd C:usrsapJ2EJC00j2eeconfigtool
    set JAVA_HOME=JDK 1.4 home
    configtool

    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:

    cd C:usrsapJ2EJC00j2eeadmin
    set JAVA_HOME=JDK 1.4 home
    go

    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 Provider’s. So it’s 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 shouldn’t 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.

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Stepan Samarin
    Yuri,
    I greatly appreciate this post. I wanted to try to do such port myself…unfortunately I’m too busy with other things. Consider posting it on theServerSide.com ;).
    I’ve got another thing in mind – to try to deploy WebDynpro stuff to some other application server. Just for fun.
    Regards, Stepan.
    (0) 
  2. Wentao Pan
    very useful information. thanks for sharing with us. i too recently ported our oracle 9i/weblogic 8 web-based enterprise app to sap’s j2ee engine.
    some of the other issues i faced were:

    -lack of (additional) support by sap engine for clob/blob database data type. i made it work using thick (oci) oracle driver and standard java apis. but writing to blob/clob columns would have been much easier if sap engine comes with some custom classes and convenient methods.

    -lack of full support of jaas, specifically pluggable login modules. the version i used was sap j2ee engine 6.20, which is out dated now. so perhaps the newer versions fully support jaas.

    -class loading problem w.r.t. classpath specification in WAR’s manifest file. the classpath ordering is not honored.

    -in general, sap engine appears to be more strickly enforcing j2ee standard ands less tolerant for minor deviations than wl. this could be viewed as better or worse, of course.

    anyway, i will try porting to the newer sap engine. here are some questions for you, looking forward to see them addressed in your subsequent blogs soon.

    Q1: which version of sap engine did you use? just the stand-alone j2ee engine or as part of some net weaver package?

    Q2: how did you build the EAR file? we already have an ANT based build process for wl, and i am trying to make it build on sap platform. but i couldn’t find much info on the utilities (that can run independently) provided by sap engine, for example, for generating ejbs etc. plus, it is not clear which sap libraries are required.

    Q3: any attempt to utilize or integrate with sap’s user management engine?

    Q4: when the ui access is through sap portal, what would be a reasonable system landscape? more specifically, should the 3rd party app be deployed on a separate instance of sap j2ee engine, or on the same instance as the portal server?

    many thanks…

    (0) 
    1. Glenn Kealey Post author
      Hi,

      I will try to reply in short to your questions, Wentao.

      “-lack of (additional) support by sap engine for clob/blob database data type. i made it work using thick (oci) oracle driver and standard java apis. but writing to blob/clob columns would have been much easier if sap engine comes with some custom classes and convenient methods.”

      If you are talking about Open SQL, I didn’t find any problem with BLOB/CLOB storing/retrieving –
      the docs are very explicit about it.

      “-lack of full support of jaas, specifically pluggable login modules. the version i used was sap j2ee engine 6.20, which is out dated now. so perhaps the newer versions fully support jaas.”

      We don’t use jaas.

      “-class loading problem w.r.t. classpath specification in WAR’s manifest file. the classpath ordering is not honored.”

      We didn’t have a need to override classes from different jars, so we didn’t see any issues with the classpath ordering.

      “Q1: which version of sap engine did you use? just the stand-alone j2ee engine or as part of some net weaver package?”

      We are using SAP WebAS 6.30. Full-blown version.

      “Q2: how did you build the EAR file? we already have an ANT based build process for wl, and i am trying to make it build on sap platform. but i couldn’t find much info on the utilities (that can run independently) provided by sap engine, for example, for generating ejbs etc. plus, it is not clear which sap libraries are required. “

      We build EAR using ant build process. We don’t use any SAP engine utilities – we just package EJBs as is and leave EJB stub generation up to the server deployment stage.

      “Q3: any attempt to utilize or integrate with sap’s user management engine?”

      Not yet, but will have to in the future.

      “Q4: when the ui access is through sap portal, what would be a reasonable system landscape? more specifically, should the 3rd party app be deployed on a separate instance of sap j2ee engine, or on the same instance as the portal server? “

      I don’t see why not.

      Regards,

      -Yuri

      (0) 

Leave a Reply