Question : Export Eclipse Web Service to Tomcat

Hi,

I've developed a web service. It runs fine within Eclipse on a Tomcat 6 Server. I want to deploy this to an external Tomcat server(not running within eclipse) but I am unsure how. Below are a list of newbie questions related to deploying. I have developed the service using axis2 in a similar fashion to the tutorial referenced here(my code is completely different but i used similar methodology) http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html

I know (I think!) I need to File>Export>Web>WAR File. Is this correct? There must be more to it!!

What do I do with the .jars referenced in Java Build Path and Java EE Module dependencies - do these get added to the WAR or do I need to manually copy this to tomcat server. If so to what folder?

The web service references .config files on my c: drive that sets up JDBC driver etc. I probably need to change location of these files to a folder in Tomcat? What is protocol?

The service also references a log4j properties stored file in the src folder. Where should I put this on Tomcat server?

The log4j properties file sets up a log file on my c: drive. I probabl need to edit location of log file, again what is protocol?

Is there an easy way of testing the deployed .war is running correctly?

Do I need to put the axis2 .jar on the Tomcat?


As you can see they are basically a list of newbie questions. All help appreciated.

Thanks
LL

Answer : Export Eclipse Web Service to Tomcat

LeonardoLeonardo, in short, YES!

The exported .WAR file should be placed in the {tomcat directory}/webapps folder.  Typically with auto deploy, you can just start Tomcat and be fine; however, have a look at this for details on deploy methods:
http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html

The .WAR file should include all your referenced JAR files; however, to make sure I typically put these files in WEB-INF/lib within my project and reference them in my build path from there.  I include Axis and Log4J JAR here unless you want same versions globally available, then you can put them in Tomcat's common/lib directory.  Same applies for your JDBC JAR(s).

Here is a reference for Tomcat and Log4J:
http://tomcat.apache.org/tomcat-5.5-doc/logging.html

(You would place the properties file into {tomcat directory}/common/classes directory under tomcat following this approach)

I unfortunately have tested mine manually, but should be able to use test cases in a framework like HttpUnit which is designed for web application unit testing.  

http://www.javaworld.com/javaworld/jw-04-2004/jw-0419-httpunit.html

Hope that helps.

Regards,
Kevin
Random Solutions  
 
programming4us programming4us