0
votes

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.

2
Actually your question isn't specific to either unix or web services. It's a general question about deploying/packaging a Java EE web application. It's the same on every OS and it's the same no matter what libraries you use.Joachim Sauer
"JAX-RS" <-- Are you sure you don't want the JAX-WS libraries?Powerlord
@powelord: JAX-RS because its easier to build a RESTful webservice using that API.Sashi Kiran Challa

2 Answers

0
votes

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