cancel
Showing results for 
Search instead for 
Did you mean: 

Project from tomcat to SAP WAS?

Former Member
0 Kudos

Hello,

i`ve a running some servelets in a .war file on my Tomcat. Now i want to deploy the same Project on my SAP WAS.

On my tomcat i just have to copy the .war file in the WepApps folder and start the tomcat.

What do i have to do to run the same .war file on the SAP WAS? Where do i have to copy the .war file? Do i need to change something?

regards

Toni

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hello,

Can any one help me in writing an ant task to start.stop configure a datasource and deploy an ear for SAP WAS 6.40

I was able to do all the above execpt configuring the datasource using the admin console

thanks in advance

sai

Former Member
0 Kudos

I have integrated the complete Project in the NetWeaver Developer Studio. I copied all the files and folders in the J2EE Development Perspective with the package Explorer.

The JSP Registry and Web content folder in the J2EE Explorer is empty.

I deployed the file, how expectet there is no jsp file.

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Did you copy your JSP files into the webContent directory?

Former Member
0 Kudos

I had the same problem attempting to get a tomcat .war deployed using NetWeaver Development Studio.

Check out DeployTool.bat in /usr/sap/J2E/JC00/j2ee/deploying, it was much easier to use, and actually worked.

Here's some extremely terse instructions that worked for me:

In DeployTool GUI:

Click Project -> New Project

Enter folder/name for new project files such as foo.dlp

Choose the Assembler tab.

Right click and select Add archive, then browse to .war file to add

Right Click on .war file and select Make Ear

Click on the Deployer Tab. Right click on foo.ear and select

connect (Administrator / *****), click connect

Right click on foo.ear and select Deployment -> Deploy Ear

At Application deployed, Do you want to start it, click Yes

Hope that helps.

Former Member
0 Kudos

I worked with some IDEs. They all have in common that their server administration and application deployment GUI do not work correctly in some cases.

I resolved this issue by using Apache Ant (as well all others who made this tool the de facto standard).

If anybody interested I am going to post an Ant example build file for Tomcat.

Former Member
0 Kudos

Now i have made the same directory strucure and copied the files in the Developer Studio. Then i make an war -> an ear file and deploeyed them.

But so programm still doesn't run.

In the WebComponent Project are no jsps in the JSP Registry. Can i add them there? I just found an option to create new jsps.

Have i to make new jsps an copy the source step by step?

It's not easy to deploy a project from tomcat to the WebAs.

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

What is the error messages you get?

Concerning your JSP's, the whole tree you see there reflects a directory structure. You got to copy your files exactly into this structure. This does not work in the J2EE View but right in the next tab, the Component View, it should work. Once your JSP's are there after a rebuild of the project you'll either see errors on the concrete documents or it will run after deployment.

Easy is a matter of definition: If you have ever ported any application server software before J2EE times you'll find this VERY easy. Of course it could be more easy, if we had some tools for this, but this currently is out of scope for development

Regards,

Benny

Former Member
0 Kudos

I have already done some of the tutorials.

The war file that i want to deploy on the SAP WAS is a bigger project that was develped for the tomcat.

Now i want to find out if/how i can run it on a SAP WAS.

You say i have to make the whole project again in th SAP Developer Studio to run it on the WAS?

Once i've heard something about "programming once and one everywhere"... but i think that was something with ejb's.

I`ll make the project stet by step in the SAP Dev. Studio.

Thx for your help, but i think there should be an easier way to run the the project on the WAS.

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Toni,

well, even this may work, if you justadd the war file into a project.

But expanding it is more or less copying under the right directory structure. The IDE will directly produce a war file from this on a mouse click.

Regards,

Benny

Former Member
0 Kudos

actually you don't need to reconstruct the entire project in net weaver developer studio. we have a similar situation where the app was build for weblogic. all i wanted to do, in the beginning, was to see if it runs on net weaver and if not what needs to change.

our build process uses ant files, which eventually generates the ejb, war and ear files, along with various deployment descriptor files required. in your example, to take a war file and deploy on net weaver involves:

  1. manually create an EAR file. yes, it is just an archive which can be created using the jar utility or simply using winzip and naming the file with an .ear extension.

  1. the minimally required contents of the EAR file is this:

yourapp.war

meta-inf\application.xml

of course, you can stick in other library/utility class jars or ejb jars. you can also add an application-j2ee-engine.xml or manifest.mf to the meta-inf dir.

  1. deploy the ear on net weaver using the visual admin tool. under node: server / services / deploy. you can navigate to where your ear file is.

don't expect it to deploy the first time. check the log files.

longer term, modify your build process to generate the war, ear and ejb-jars etc that are deployable on net weaver. then you can write some script to automate the ear deployment part as well (i think, i am about to start working on it). then the whole process is automated. no developer studio needed at all.

hope this helps and would love to hear more on how others do it, supporting multiple app servers that is.

wentao

Former Member
0 Kudos

Ok, now i have my war file and a new Enterprise Application Project.

When i want to Add Modules to my EAP i can just select the WebComponents that i have created in the Developer Studio.

I can`t select my war file because the Developer Studio doesn`t know that i have a war file, seems to be logical.

But how can i tell the Developer Studio that i have a war file and add that war file to my EAP?

I`ve tried to make a reference on the war file, but none of the J2EE Projects can do that.

... i`m totally screwed.

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Toni,

I'd recommend you first go through some of our tutorials where you learn this the natural way.

The WAr file has to exist as a project in the studio. I don't know if you just can import the WAR, better way is to expand it and let the studio make the WAR.

Then it is a rightclick on the ear file to include your WAR (option 'Add modules').

Regards,

Benny

Former Member
0 Kudos

To build the EAR file you have to create an Enterprise Application Project in the Developer Studio, then right-click on the application.xml file and add the WAR module.

Then in the Modules tab of application.xml you can define the context root for the Web project.

Former Member
0 Kudos

Hello Dov,

is there a way to deploy java archives without the Developer Studio or the Software Deployment Manager?

Development environments often use Ant tasks to deploy archives. What about Apache Ant within Netweaver?

Former Member
0 Kudos

You first have to put it in an EAR file, and then deploy it using the the SDM (Software deployment manager tool):

C:\usr\sap\<SID>\JC<INSTANCE>\SDM\program

If you use the NW Developer Studio, it is really easy to build this

Hope this helps,

Dov

Former Member
0 Kudos

Sounds easy, but how exacly do i create an ear-file?

I don`t know how i can put the war file in the developer studio to reference it with an Enterprice Application Project.