Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat: The requested resource () is not available.

 
Diego Braga
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!! I'm looking for an answer to my problem, and I'm going to explain what I mean.

I've created a .jar named yuhuuTunnel.jar that has the following structure:

yuhuuTunnel.jar:
--> web (contains the servlets)
--> *.class
--> HelloWorldServlet.class
--> META-INF
--> MANIFEST.MF
--> SimpleClient.class

The code of HelloWorldServlet.java is this:



then, using a .war file (created with ANT), I've created into /../tomcat/webapps/ a directory call yuhuuTunnel that has this structure:


The content of web.xml is the following:



Tomcat works correctly ( http://localhost:8080 return me the page of tomcat ) but when I try to use the HelloWoldServlet typing http://localhost:8080/yuhuuTunnel/HelloWorld into a browser, this one returns me the HTTP Status 404 - The requested resource () is not available.

What is wrong? The address that I type into the browser or there's an error into web.xml?


[BPSouther: Added code tags]
[ November 05, 2008: Message edited by: Ben Souther ]
 
Diego Braga
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a better view, I've re-write the structures of the yuhuuTunnel.jar and the structur of my web application in tomcat


yuhuuTunnel.jar:



 
rakesh sugirtharaj
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try doing a out.flush() and out.close() in your servlet.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing:


to




See section: SRV.11.2 in the servlet spec (link in my signature) if you are unsure about the syntax for servlet mapping url-patterns.
[ November 05, 2008: Message edited by: Ben Souther ]
 
Diego Braga
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've changed

<url-pattern>HelloWorld</url-pattern>

to:
<url-pattern>/HelloWorld</url-pattern>

Stopped and re-started Tomcat, but I still get the 404. Isn't a problem of flush or close!
 
Diego Braga
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something interesting: If I type

http://localhost:8080/yuhuuTunnel/HelloWorld

the message given back is: "The requested resource () is not available."

but if I type

http://localhost:8080/HelloWorld the message is different:

"The requested resource (/HelloWorld) is not available."
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I sounds like the application itself isn't being deployed.
Have you looked at any of the server logs to see if there are errors being logged at startup?
 
Diego Braga
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Diego Braga,

The question was:
Have you looked at any of the server logs to see if there are errors being logged at startup?


I can see from reading it that there is an exception being thrown when Tomcat tries to parse something....
Can you see what that 'something' is?
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My eyes caught this line

java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name SetutentiOnline


Now what is SetutentiOnline? And why is it present in your web.xml?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic