cancel
Showing results for 
Search instead for 
Did you mean: 

How to deploy a war file from a different app server to the SAP one

Former Member
0 Kudos

Hello,

I hve recieved a war file from Tomcat that needs to be deployed on the SAP Java App server. As far as I know the SDM only allows to deploy ear files. How can I deploy this war to the app server?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member698570
Active Participant
0 Kudos

Hi Roy,

in order to deploy the WAR file you have to wrap an EAR around it. I had the same problem.

You can do this using Netweaver Developer studio.

Perform the following steps:

- Start NWDS

- Create a New Enterprise Application Project

- Create a New Web Module Project (name it like your war file => e.g. your war file is called myApp.war => call your Web Module myApp)

- Edit the application.xml of your Enterprise App if necessary (description, Displayname etc.)

- Link your Web Archive to your application archive (right Mouse click on Application Archive and from the Context Menu choose "Add Modules" => In the list choose your Web Module)

=> You can also perform a right mouse click on your web Module and from the context menu choose "Add to EAR Project" => In the list choose your Enterprise Application!

- Build Web Archive (right mouse click on your Web Module and from the context menu choose "Build Web Archive" => This will create a war file that has the same name as your war file! => If you do not see it try to switch to resource perspective!)

- Build Application archive (right mouse click on Application archive => from the context menu choose "Build Application Archive")

You are done

The EAR file is generated and will be created in your workspace.

Now browse to your workspace. Unpack the EAR using WinZip or any other Archiver program.

Replace the contained war with your war and repack the ear file (You can also use tools like Total Commander to directly replace the war file in the EAR with your war without having to unpack the war). You can also import your war into NWDS and rebuild it so you won't have to replace the WAR in the EAR but as your WAR is already built I would just replace it as described!

You can now deploy the ear file to SAP J2EE

Hope this helps (Reward points for helpful answers are appreciated!)

Cheers

Former Member
0 Kudos

Hi Marcel,

Thank you for the detailed solution but the way I see it, everytime I'm creating the EAR file I will have to replace the WAR inside. How can extract the WAR into the New Web Module Project so that I can see all the classes, jar files, jsp's, images etc in it through the NWDS? In the file->import I don't see an option to import an existing WAR into this project.

Roy

former_member698570
Active Participant
0 Kudos

Hi again,

There is an import file feature you can select from the web module context menu

Here you can browser to your folder and import a couple of files.

If you plan to continue developing your WEB project in NWDS you will have to get it working once in NWDS (maybe perform some manual steps / create directories etc. if you cannot get it imported correctly.)

Or if your original WEB App is an eclipse project just try importing the complete project into NWDS Workspace

Once it works you won't have any more trouble

Cheers

Former Member
0 Kudos

Hi,

When I import the WAR file into the WEB project in NWDS it just copies the file as it is to the web content folder it doesn't extract it. Now, sure I can extract it with some manual work myself, I'm just looking for a solution within the NWDS to do that for me.

former_member698570
Active Participant
0 Kudos

Hi,

I guess there is no direct way to do that.

Did you try to import a complete project into NWDS workspace or do you just have a war file? It's not that much work to get the war content into NWDS?

Just switch to resource perspective and drag&drop the files to the appropriate folders from your Windows Explorer

I don't think there is another way to achieve this

Cheers

Former Member
0 Kudos

I'll guess I'll do that then.

Thanks for your efforts tho Marcel, points assigned