This document is based on migrating a sample application from websphere samples, which is shipped with websphere application server to SAP Web Application Server.
A Basic calculator application was migrated to SAP application server. This sample application has EJB 2.0, Servlets and JSP as the technical components.
Figure 1 : Basic Calculator Sample running in Websphere Application Server
Figure 1 depicts the application running in the Websphere application server as part of the Technology Samples.
Let us see in detail how this application can be ported.
1. Take the EAR file to be migrated
2. Make note of the WEB.xml, application.xml.
3. Create an EJB Module Project and import the EAR file
4. Create a WEB Module Project and import the WAR file
5. Create an Enterprise Application project.
7. Create an EAR from the Enterprise Application Project.
8. Deploy the EAR and confirm a successful deployment.
9. Logon to the administrative console and confirm deployment of modules for EJB and WEB.
10. Check for the working of all modules.
Let’s see the steps in detail:
- Take the EAR file to be migrated
Dismantle the EAR file to WAR and JAR. Open the EAR file and take the necessary JAR and WAR (web applications such as JSP and Servlets).
+– JAR (EJB, Beans and other supporting jars)
|_WAR (Web contents like Servlet controllers and JSP)
Check the EJB-Bean class for type if bean. Verify its Home, Remote and Bean class.
Also note its transaction type and other details. Check also the ejb-jar.xml as shown in the example
Next take the WAR file and check the web contents like JSP, Servlets. Make a note of all main elements and the web.xml.
The above two xml files needs to be verified later, once the WAR and JAR files are imported.
- Open the Netweaver Developer Studio.
Create a new EJB Project Module.
FILE -> NEW -> EJB Module Project.
After creating an EJB project module, import the JAR file to this. After confirming a successful import of JAR file. Check the ejb-jar.xml and its contents.
Create a new WEB Module Project.
FILE -> NEW -> WEB Module Project.
After creating an WAR project module, import the WAR file to this. After confirming a successful import of WAR file. Check the web.xml and its contents.
Create a new Enterprise Application Project.
FILE -> NEW -> Enterprise Application Project
Add the other project reference to this project, i.e. the web modules and the EJB modules.
Right click and create an Application Archive. Check the application.xml,
Right click and deploy this EAR on the SAP application Server.
Logon to the SAP Application server and check for the successful deployment of the EAR and WAR module.
Figure 2 : Administrative console
Once the application is deployed and no errors are found, check the application from the browser or client application.
Congrats. Application is now ported!!!!
Figure 3 : Application running in SAP WAS