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 deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "deployment" Watch "deployment" New topic
Author

deployment

shiva rao
Ranch Hand

Joined: May 26, 2005
Posts: 31
Hi All,

I created sample servlet and placed at WEB-INF\classes. And I created the web.xml kept under web-inf folder and created a war file using the following commonad.
jar cvf sam.war -C build .
Which intern created the mani-fest file.

And deploy this war on tomcat server. Now I am not able to access this servlet. Then I went to manager to manage application. It show me that this application started (status). But all other sample applications running on this server is working fine.

Did I missed anything while packing the war file.
I am using Tomcat 5.5.

Thanks in advance.
Shiva Rao
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Now I am not able to access this servlet.


What does this mean? Which URL are you hitting, and what response are you getting? What does your mapping in web.xml look like?
shiva rao
Ranch Hand

Joined: May 26, 2005
Posts: 31
Here is my web.xml is...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>SampleServlet</servlet-name>
<servlet-class>com.sample.SampleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SampleServlet</servlet-name>
<url-pattern>/sample</url-pattern>
</servlet-mapping>
</web-app>

I created the war as sam and context is same. I am using following url to access my sample
http://127.0.0.1:8080/sam/sample
It show the error 404.

description :The requested resource (/sam/sample) is not available.

Thanks
shiva
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I created sample servlet and placed at WEB-INF\classes


You mean WEB-INF\classes\com\sample\SampleServlet.class, right?'


Also:
Did the war file get unpacked?
If so, is there a WEB-INF directory in the root of the application?

You said you deployed it. How did you do it, the manager app, by dropping it in the webapps directory?
[ November 10, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
shiva rao
Ranch Hand

Joined: May 26, 2005
Posts: 31
Thanks all,

I figured out the problem. I made a mistake initially while specifying the url-patteren. After fixing it, my ant script is not picking up right version which caused this problem.

Now I need to fix the ant program.

Thanks again

shiva rao
 
 
subject: deployment