cancel
Showing results for 
Search instead for 
Did you mean: 

Importing existing only WAR file in NWDS for deployment on WAS

Former Member
0 Kudos

Hi,

I have WAR file created on the eclispe platform by someone. I am required to import that into NWDS and embed into EAR and then deploy on WAS.

However, i found no direct way to import existing only WAR file into NWDS. Simply importing a file in the web module project will only copy the contents, without that getting extracted.

Kindly let me know in detail, how to acheive the same.

Regards,

Apeksha

Accepted Solutions (1)

Accepted Solutions (1)

former_member698570
Active Participant
0 Kudos

Hi,

unfortuantely there is no direct way to import the WAR. You will have to unpack it in your local Filesystem using some Archiver such as Winzip or FilZIP etc., create a new webApp in NWDS and then move (Drag & Drop) the contents to the appropriate folders in NWDS using the Resource Perspective. When done you can wrap an EAR arround it.

If you do not want to apply any changes to your war you can just build a new WebApp (name it like your war), create the ear. Link both together and build the ear and than just exchange the "empty" war in your ear with the war you have.

Please have a look at the following thread where I described this more detailled for someone who had the same question:

https://www.sdn.sap.com/irj/sdn/profile?editmode=true&userid=2141849

Hope this helps

Cheers

Former Member
0 Kudos

thanks marcel,

thats exactly what i have tried doing.

I simply have to deply the given WAR file on WAS. Basically, its to demo how we can migrate all Java applications on NWDS. So, what i have done is created a blank Web module and created WAR. Then, created Enterprise Application project and added this blank Web module to it. Now, this EAR has blank WAR in it. I simply replaced the given WAR file with the blank WAR. I am yet to deply it. However, i am not sure if it works. Does this mean that Web module project is never executed, since that WAR added in the EAR is only getting executed?

Now, talking about the second approach where we unzip the WAR, can you plz ellaborate, wht all WAR contents would go into newly created projects contents.

Regards,

Apeksha

former_member698570
Active Participant
0 Kudos

Hi,

don't worry. It will work. If done this with a Web Application I received from a vendor. Normally it is deployed on Tomcat but we had to integrate the functionality into SAP Portal / SAP Web AS.

So I just created an empty Web Module Project and the Enterprise Project, linked them and built the EAR.

I just replaced the empty WAR in the generated EAR with the WAR I received from my Vendor and deployed it on SAP J2EE using Visual Admin.

In general you should be able to deploy every WAR on every APP Server with a servlet engine that conforms the SUN J2EE Specifications (SAP J2EE does)!

Does this mean that Web module project is never executed, since that WAR added in the EAR is only getting executed?

I don't really understand this question? The result of your Web Module Built is the WAR file. By linking it to your EAR you just achieve that the WAR File is put into EAR when you build the EAR. Since your Web Module Project has the same name as your WAR File (I hope it does) you just pretend that the WAR File you are putting in the EAR replacing the empty one was the one that was built within NWDS.

The Web Module is the one that is being executed after deployment. It contains all the Code. The Enterprise App is just a wrapper around it. I don't know why it is not possible to directly deploy a WAR File to J2EE.

It could be that you get some problems with Libraries in your Web App that also exist on J2EE (e.g. Java Mail)

I had the problem with Java Mail. The Version in WebApp was newer than the one used in J2EE so some functionality did not work at the beginning. Since there seems to be no way to tell the J2EE Classloader to load the Child Libraries first instead of parent I had to replace the mail.jar in SAP J2EE with my own one.

You will probably not even face such a problem so just ignore it for now!!

Unpack the WAR to some folder in your local filesystem using a ZIP Program. Then open your File Browser (e.g. Windows Explorer if you are on Windows) and put your NWDS besides it. Then just drag and drop the files from your File Explorer to NWDS using the Resource Perspective (as described above)

It is some manual work but there is no other way around this if you want to build your Web App in NWDS in order to avoid exchanging the WAR in your EAR everytime you deploy it!

If you have further questions let me know

Cheers

Answers (0)