Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

What's wrong with me?

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i used tomcat 3.2.3 at home for half year and everything was fine. my system administrator
put tomcat 4 at our apache server and i can't find the reason for the fact that i don't succeed to run servlets on it! i do everything as i've done earlier,but it just doesn't work.
i opened a "classes" directory at
"..tomcat-install-directory.."/webaps/ROOT/WEB-INF
but the servlets i deploy there do not run.
i just get a message that the file were not found
. it looks like the path behaves like relative
domain for the machine... any suggestions?
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by the way, the servlets in the examples directory
are running ok.
come on guys, any ideas?
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by "the servlets i deploy " what do you mean? Have you written up a web.xml for this webapp, and all your mappings are in place?

You said: "it looks like the path behaves like relative domain for the machine". I don't understand that I'm afraid.

And what is the *exact* URL you are trying to load, and what is the error message?
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok,i'll try to explain it once more (took an english dictionary )
under the "servlets i deploy" i mean the servlets i've written and placed in webapps\ROOT\WEB-INF\classes directory.
i didn't make any changes in the web.xml file.
actually i used to use tomcat 3.3 and i don't remember myself changing it either. (is there any one-time change i should make there to run servlets?:confused
actually i didn't see any mappings to the webapps\examples\WEB-INF\classes but the rexample servlets in it run ok...
the url i try to load looks like www.zbc.de/servlet/TheServlet and what i get is apache's 404 error like this:" The requested resource (/servlet/TheServlet) is not available."
can you help me now?
10X.
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i wanted to write i run the url like this:
www.xbc.de:8080/servlet/TheServlet
sorry
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've never used the 'anonymous servlet' feature of Tomcat, as it is somewhat non-standard across servlet runners.

there's a pretty good explanation of what it is in the web.xml file in <CATALINA_HOME>/conf/web.xml

I've examined my own on my home system, and it appears to be 'on' and enabled.

Are you running Apache web server in front of Tomcat ? If you are, trying going right to port 8080 of Tomcat, and see if it will serve your servlet to you.

Also, I'd try putting the servlet in a proper web application, and not use the anonymous /servlet/* mapping provided by Tomcat. It's the more appropriate way of doing things anyways (in my view). This is how: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/deployment.html

As an off-the-wall, crazy last suggestion, have you tried http://yourdomain.com/ROOT/servlet/myServlet ?
[ January 19, 2002: Message edited by: Mike Curwen ]
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

well,may be this will help...
i found this in the web.xml file on the "problematic" machine :
<!-- The mapping for the default servlet -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- The mapping for the invoker servlet -->
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
on the machine where i don't have any problems running tomcat there is no part of 'default servlet' but only 'invoker' one.
i don't have a clue if there is any difference between the two. but still,can this make THE difference?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read what it says for that serlvet...My file has this mapping, so no, that's not the problem.
 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
I guess I am facing similar problems.
I created a new web app (test) with proper web.xml file.
<!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>
<display-name>Hello, World Application</display-name>
<description>
This is a simple web application with a source code organization
based on the recommendations of the Application Developer's Guide.
</description>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<description>
abc
</description>
<servlet-class>HelloServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>
</web-app>
Also added a context entry in server.xml:
<Context path="/test" docBase="test" debug="0"
reloadable="true"/>
Trying to run the simplest server "HelloWorld" but it says (/HelloServlet) is not available.

Some problem is there for certain
Deepak
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all,
I'm having a similar problem.
The following is the only url-pattern i can get this to run as. Any other pattern i try fails.

Here's my entire web.xml


does anyone know why I am stuck with that one url-pattern? the other patterns in the built-in examples seem to work fine for some reason!?!?
thanks mucho
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you putting the name of the webapp in the requested URL?

http://<hostname>:<port>/<webapp name>/<url pattern>

where webapp name is the folder name under webapps in which your application resides.
 
Saloon Keeper
Posts: 25461
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ability to ask Tomcat for a servlet not explictly named in the web.xml (no wildcards) I believe was omitted from Catalina. I don't know about modern-day Tomcat 3 versions.
I think there are two reasons why it wasn't a good idea in the first place. One is just basic security - you are now limited to only being able to talk to classes that are explicitly authorized.
I forget the other. It may be related. I suspect that if you're using an architecture where servlets forward to other servlets they could be abused if they could be invoked directly by a malicious client.
 
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic