File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes deploying an application on Tomcat 5.5.17 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "deploying an application on Tomcat 5.5.17" Watch "deploying an application on Tomcat 5.5.17" New topic
Author

deploying an application on Tomcat 5.5.17

aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
hi Ranchers,
First if this is not the right place for this question, please put it wherever you see apropriate.

Second, the question: I have finished developping an application usinf NetBeans IDE 5.0, Now I want to deploy it on Tomcat 5.5.17, can you please detail the steps I should follow and especially the directory structure I must have ?
(I want to move everything to Tomcat, including Servlet source files).

Thank you in advance.
Best regards,
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Hi aymane,

We have a forum dedicated to Apache Tomcat.
I'll move this thread there for you.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The simplest way is to drop your webapp, (as a war file or a properly formed directory structure) into the webapps directory in Tomcat.

Does your IDE have a feature that packages your app for deployment?

If you want to try this with a pre-packaged war file, grab any of the wars on my site, http://simple.souther.us and drop them into your tomcat/webapps directory. Tomcat will unpack them and deploy them for you.
At this point, you will have a working example of a properly packaged web app to use as a reference.
aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
Ok.
But I want, is still be able to modify my application in tomcat.
I think I used the term "deploy" in the wrong place.
Let's say I want to move from NetBeans to Tomcat.

regards,
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You can work directly with the files.
JSPs will automatically update themselves.

For Java classes, you'll need to recompile and move your class files to the proper directories.

Your app can be configured within Tomcat to automatically reload itself when a class file is updated. Otherwise, you can reload it via the Tomcat manager or you could just restart Tomcat.
aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
move your class files to the proper directories


What are the proper directories (webapps/myApp/Web-INF/classes) ?
where should I put the .java files ? can I just compile them wherever ? and just bring the .class and put it there ?

thank you !
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The location of your .java files is irrelavant.
Tomcat does nothing with them.

Yes, the class files belong under
tomcat/{your webapp}/WEB-INF/classes/{your package}/{your class}.class

Yes, just compile them anywhere and move the class files there.
Better, use the -d switch in javac to specify where you want the compiled class files to be created.

Personally, I create a 'src' directory under WEB-INF and use the following shell script to compile single classes:

It should be pretty easy to port this to a windows .bat file for use on that OS.

For compiling the whole project, I use an ANT script.
aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
Thank you very much. Now It's clearer.
ButThe last 2 words you said, I want to know more. What is "ANT" and What is "Ant Script" ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deploying an application on Tomcat 5.5.17