Deploy Apache ESME on NetWeaver CE 7.2

Published by Tobias Hofmann on

4 min read

Another blog that I wrote in 2011, and never managed to publish on SCN. It may have been a time problem, logon problem or usability problem, honestly I do not remember anymore. Publishing content at my site is way easier for me, so I decided to publish it here. The actual value of the blog is close to nothing. ESME is dead, CE7.2 is on life support and no one will use this technology today. But as I`ve written the content, I`ll publish it anyway. Please note that I did not review the content for correctness. It is as I have found it on my hard drive. I hope I did everything right in 2011.

NetWeaver AS Java is a J2EE server that can be used to deploy more than just SAP applications. In this blog I will show how to deploy a 3rd party WAR: Apache ESME using NWDS. For most Java developers and IT organizations NetWeaver only serves for installing, developing and deploying SAP applications. For everything else another J2EE server is used. That NetWeaver is a full J2EE server and can be used for deploying web applications in the WAR format is mostly ignored. This prejudice comes from the time when NetWeaver Java was associated with NetWeaver 2004(s), that indeed lacked some essential features. But with the latest release (7.2, 7.3) NetWeaver is a standard compliant J2EE server that offers at least the same features as JBoss or Tomcat. To demonstrate that, I will deploy the Apache ESME WAR on NetWeaver CE 7.2. Using that project is interesting, as it not only shows that 3rd party WAR can easily be deployed but also that SAP JVM 6 can run Scalar applications.

To generate the WAR file for ESME get the source from the project homepage and use maven to compile it. This generates the WAR file that needs to be deployed, including all the compiled Java files (class) in the JAR files. The project page states that you can use the tool, but when you do not have access to the CE server, want to integrate it into an EAR project or alter the configuration you’ll have to use NWDS.

First, create an EAR project. Then import the WAR file and assign it to the EAR project.

ESME is using several 3rd party JAR files

In my case, the import report shows no errors, but the import wizard finishes with an error. What gets imported are the project structure and the class files.

The import didn’t include the 3rd party jar files. Either you add them to the web project or make sure they are accessible on the server. Here I will import them directly in the web project. It’s just drag and drop. Open the original WAR file in your ZIP manager and copy the JAR files form WEB-INF/lib. Same for the other files ESME includes in the WAR file that NWDS is not importing. Copy the resulting files to WebContent/

Next is to adjust the web.xml file. Copy the content of the original web.xml file. As the web site states, adjust the resource-ref part. ESME needs a database connection to store its data, so a data source alias has to be made available that ESME can use. Theoretically every database that supports ESME’s JPA mechanism can be used. I ran into problems while trying to use the system DB as you’ll first have to adjust the JPA files of ESME to work together with SAP. It’s easier to use another DB for ESME. Just make sure that the resource exists and is working. I used Apache derby as DB.


<display-name><your display name></display-name>


<filter>


<description>The filter that intercepts lift calls</description>


<display-name>Lift Filter</display-name>


<filter-name>LiftFilter</filter-name>


<filter-class>net.liftweb.http.LiftFilter</filter-class>


</filter>


<filter-mapping>


<filter-name>LiftFilter</filter-name>


<url-pattern>/*</url-pattern>


</filter-mapping>


<welcome-file-list>


<welcome-file>index.html</welcome-file>


<welcome-file>index.htm</welcome-file>


<welcome-file>index.jsp</welcome-file>


<welcome-file>default.html</welcome-file>


<welcome-file>default.htm</welcome-file>


<welcome-file>default.jsp</welcome-file>


</welcome-file-list>


<security-role>


<description>DefaultSecurityRole</description>


<role-name>Authenticated Users</role-name>


</security-role>


<resource-ref>


<res-ref-name><your resource></res-ref-name>


<res-type>javax.sql.DataSource</res-type>


<res-auth>Container</res-auth>


</resource-ref>

</web-app>

Now add the EAR project to an SAP server and deploy it. During deploy of the EAR file the WAR file will be automatically created and added.

Result: Apache ESME running on CE 7.2

Let the world know
Categories: Java

Tobias Hofmann

Doing stuff with SAP since 1998. Open, web, UX, cloud. I am not a Basis guy, but very knowledgeable about Basis stuff, as it's the foundation of everything I do (DevOps). Performance is king, and unit tests is something I actually do. Developing HTML5 apps when HTML5 wasn't around. HCP/SCP user since 2012, NetWeaver since 2002, ABAP since 1998.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.