views:

64

answers:

2

I earlier got to create a simple RESTful webservice on my localhost using Eclipse IDE, Tomcat, and JAX-RS libraries.

I am now trying to move the same on to a different unix server which has Tomcat installed. I am not knowing how to get started as in what is equivalent to creating a "Dynamic Web Project" that I do in Eclipse. Do I need to just create a directory myself with all the sub-directories as created by Eclipse? Should this directory be placed in webapps folder in Tomcat container. Should META-INF and WEB-INF also be created by myself?

Where should I put my Java classes?

Can somebody please clarify this or direct me to any documentation about the same.

+1  A: 

You need to package your application in a WAR file.

The Sun Java EE 6 Tutorial has a chapter deciated to packaging.

It's pretty easy to export a web application as a war in Eclipse.

Joachim Sauer
Thank You Joachim.
Sashikiran Challa
A: 

Dynamic Web Project (right click) => Export => Web =>war file =>war export dialog

Creation of web application archive - WAR is the solution for your problem, but take care about all libraries that you need there.

You can easily extract (unzip) WAR file content and check your project structure and libraries needed and they will be in WAR's WEB-INF/lib.

Make sure that both Tomcats are set same way, make sure your code is all OS friendly (users, file paths, permissions)

Always write some test simple code that will run up on app start, and check all dependencies and libs, system clock, outside world network communication, so you can trace it in web app console or logger easily.

regards

reg