RE: (newb) Tomcat servlet mapping problem

2006-01-24 Thread Darren Hall

 Hmm, you're mixing up that /servlet story.
 Better remove everything named servlet from
 your environment... It is only confusing.
 
 Create app.xml, put the Context path /
 or /app, and then /FCLxyzServlet or
 /app/FCLxyzServlet are the correct URLs.
 
 Does that make any sense?
 
 Georg

Yes it does, and thanks for the help Georg. 
=}




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Darren Hall
 Not sure if your first sentence meant you found the problem, but just to
 make sure it's clear, the current Servlet Spec does require that servlet
 classes be in a package.
 
  - Chuck

Doh!

That's not good. Could that be the cause of the ClassDefNotFound error I'm
getting? I've inherited this code, and we will be designing a new site, and
I *will* be using packages - but that doesn't change the current situation,
which is, I need to keep the existing site running while the new site is
being developed. I need to find out how to get the old code deployed on
tomcat 5.0 and get the servlet mappings working properly so that we no
longer need to use the invoker servlet to keep the site functioning. Is
there a way I can map these servlets (in the web.xml file) so that Tomcat
can see them and execute them?




-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 22, 2006 9:19 PM
To: Tomcat Users List
Subject: RE: (newb) Tomcat servlet mapping problem

 From: Darren Hall [mailto:[EMAIL PROTECTED] 
 Subject: RE: (newb) Tomcat servlet mapping problem
 
 I have. The servlets I am trying to deploy (err, map?) do not 
 have a package associated with them.

Not sure if your first sentence meant you found the problem, but just to
make sure it's clear, the current Servlet Spec does require that servlet
classes be in a package.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Caldarale, Charles R
 From: Darren Hall [mailto:[EMAIL PROTECTED] 
 Subject: RE: (newb) Tomcat servlet mapping problem
 
 Is there a way I can map these servlets (in the web.xml file) so 
 that Tomcat can see them and execute them?

Not that I'm aware of, since the application code is in violation of the
spec.  Others with more experience may know some tricks.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Len Popp
On 1/23/06, Darren Hall [EMAIL PROTECTED] wrote:
   From: Darren Hall [mailto:[EMAIL PROTECTED]
   Subject: RE: (newb) Tomcat servlet mapping problem
  
   Is there a way I can map these servlets (in the web.xml file) so
   that Tomcat can see them and execute them?
 
  Not that I'm aware of, since the application code is in violation of the
  spec.  Others with more experience may know some tricks.
 
  - Chuck

 Well, that really stinks. That means I have either a big code change ahead
 of me, or we need to continue using the invoker servlet for now.

 Thanks for your help, Chuck.

 If anyone knows a way that I can map a servlet that is not in a package
 through the web.xml, please let me know.

 Thanks

 Darren

As far as I can see, it just works. Whether it's correct or not, it
does seem work in Tomcat 5.5.12 and I know it worked in 5.0.28 too. So
this is probably not the cause of your problem. Try putting one
servlet in a package to see if that makes a difference, before you try
to change them all.

Here's a servlet declaration that I just tested:
servlet
  servlet-nameTest/servlet-name
  servlet-classTest/servlet-class
/servlet
servlet-mapping
  servlet-nameTest/servlet-name
  url-pattern/test/url-pattern
/servlet-mapping

--
Len

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Petr Hadraba
Hi,

sorry for my question, but I'm googling, reading manuals and still no answer...

So. The question si very simple:

How can I ommit the servlet name in the URL?

Ex.: I have http://localhost:8080/ServletTest/path_in_the_servlet_and arguments

and I need http://localhost:8080/path_in_the_servlet_and arguments

I will run under Tomcat only one servlet; and I want to handle all the domain.

To override DefaultServlet is, I think, not so good solution, isn't it?

Thank you very much for your tips.

PETR


On 1/23/06, Len Popp [EMAIL PROTECTED] wrote:
 On 1/23/06, Darren Hall [EMAIL PROTECTED] wrote:
From: Darren Hall [mailto:[EMAIL PROTECTED]
Subject: RE: (newb) Tomcat servlet mapping problem
   
Is there a way I can map these servlets (in the web.xml file) so
that Tomcat can see them and execute them?
  
   Not that I'm aware of, since the application code is in violation of the
   spec.  Others with more experience may know some tricks.
  
   - Chuck
 
  Well, that really stinks. That means I have either a big code change ahead
  of me, or we need to continue using the invoker servlet for now.
 
  Thanks for your help, Chuck.
 
  If anyone knows a way that I can map a servlet that is not in a package
  through the web.xml, please let me know.
 
  Thanks
 
  Darren

 As far as I can see, it just works. Whether it's correct or not, it
 does seem work in Tomcat 5.5.12 and I know it worked in 5.0.28 too. So
 this is probably not the cause of your problem. Try putting one
 servlet in a package to see if that makes a difference, before you try
 to change them all.

 Here's a servlet declaration that I just tested:
 servlet
   servlet-nameTest/servlet-name
   servlet-classTest/servlet-class
 /servlet
 servlet-mapping
   servlet-nameTest/servlet-name
   url-pattern/test/url-pattern
 /servlet-mapping

 --
 Len

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Petr Hadraba
Hi,

sorry for my question, but I'm googling, reading manuals and still no answer...

So. The question si very simple:

How can I ommit the servlet name in the URL?

Ex.: I have http://localhost:8080/ServletTest/path_in_the_servlet_and arguments

and I need http://localhost:8080/path_in_the_servlet_and arguments

I will run under Tomcat only one servlet; and I want to handle all the domain.

To override DefaultServlet is, I think, not so good solution, isn't it?

Thank you very much for your tips.

PETR


On 1/23/06, Petr Hadraba [EMAIL PROTECTED] wrote:
 Hi,

 sorry for my question, but I'm googling, reading manuals and still no 
 answer...

 So. The question si very simple:

 How can I ommit the servlet name in the URL?

 Ex.: I have http://localhost:8080/ServletTest/path_in_the_servlet_and 
 arguments

 and I need http://localhost:8080/path_in_the_servlet_and arguments

 I will run under Tomcat only one servlet; and I want to handle all the domain.

 To override DefaultServlet is, I think, not so good solution, isn't it?

 Thank you very much for your tips.

 PETR


 On 1/23/06, Len Popp [EMAIL PROTECTED] wrote:
  On 1/23/06, Darren Hall [EMAIL PROTECTED] wrote:
 From: Darren Hall [mailto:[EMAIL PROTECTED]
 Subject: RE: (newb) Tomcat servlet mapping problem

 Is there a way I can map these servlets (in the web.xml file) so
 that Tomcat can see them and execute them?
   
Not that I'm aware of, since the application code is in violation of the
spec.  Others with more experience may know some tricks.
   
- Chuck
  
   Well, that really stinks. That means I have either a big code change ahead
   of me, or we need to continue using the invoker servlet for now.
  
   Thanks for your help, Chuck.
  
   If anyone knows a way that I can map a servlet that is not in a package
   through the web.xml, please let me know.
  
   Thanks
  
   Darren
 
  As far as I can see, it just works. Whether it's correct or not, it
  does seem work in Tomcat 5.5.12 and I know it worked in 5.0.28 too. So
  this is probably not the cause of your problem. Try putting one
  servlet in a package to see if that makes a difference, before you try
  to change them all.
 
  Here's a servlet declaration that I just tested:
  servlet
servlet-nameTest/servlet-name
servlet-classTest/servlet-class
  /servlet
  servlet-mapping
servlet-nameTest/servlet-name
url-pattern/test/url-pattern
  /servlet-mapping
 
  --
  Len
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



RE: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Darren Hall
 On 1/23/06, Darren Hall [EMAIL PROTECTED] wrote:
From: Darren Hall [mailto:[EMAIL PROTECTED]
Subject: RE: (newb) Tomcat servlet mapping problem
   
Is there a way I can map these servlets (in the web.xml file) so
that Tomcat can see them and execute them?
  
 
 As far as I can see, it just works. Whether it's correct or not, it
 does seem work in Tomcat 5.5.12 and I know it worked in 5.0.28 too. So
 this is probably not the cause of your problem. Try putting one
 servlet in a package to see if that makes a difference, before you try
 to change them all.
 
 Here's a servlet declaration that I just tested:
 servlet
   servlet-nameTest/servlet-name
   servlet-classTest/servlet-class
 /servlet
 servlet-mapping
   servlet-nameTest/servlet-name
   url-pattern/test/url-pattern
 /servlet-mapping
 
 --
 Len

ok, the start of this thread got lost... let me try and do a brief
refresher...

I'm working with Tomcat 5.0, Apache 2, and a whole bunch of servlets that I
inherited. The website is a combination of static HTML and java. 95% of the
java code is implemented in servlets (that write out the dynamic HTML) and
NONE of the Java code is in packages.

The HTML on the site, when referring to servlets, uses relative paths like
form action=../servlet/servlet-name. In order to remove the invoker
servlet, I need to map all the servlets on the site through a web.xml file.

Initially, I was getting a resource unavailable error from Tomcat, but it
now appears as if my servlet mapping was wrong. (my app lived in the
${catalina.home}/webapp/servlet directory, and my web.xml was mapping a
servlet to url-mapping/servlet/[servlet-name]/url-mapping.

I fixed this by removing the '/servlet' in the url-mapping tag, and I now
get a stack trace with a ClassDefNotFound [servlet-name] error. This error
occurs when I point at Tomcat directly, so I know the error has nothing to
do with Apache. I now have a stripped down web.xml file that looks like this
(minus the xml and DOCTYPE directives):
...
web-app
  servlet
servlet-nameFLCUpEvDisplayServlet/servlet-name
servlet-classFLCUpEvDisplayServlet/servlet-class
  /servlet
  servlet-mapping
servlet-nameFLCUpEvDisplayServlet/servlet-name
url-pattern/FLCUpEvDisplayServlet/url-pattern
  /servlet-mapping
/web-app

Now everytime I hit the servlet, I get the ClassDefNotFound error, and
after that I see an entry in the log file:

2006-01-23 11:35:53 StandardContext[/servlet]Marking servlet
FLCUpEvDisplayServlet as unavailable
2006-01-23 11:35:53 StandardContext[/servlet]Error loading WebappClassLoader
  delegate: false
  repositories:
/WEB-INF/classes/

after which I get a resource is not available error again, until I stop
and restart Tomcat.

So, my question is... why am I getting the ClassDefNotFound error, and how
do I correct it (or can I, given my current configuration)?

Thanks

Darren



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Darren Hall
As an add-on -
I successfully mapped the Tomcat servlet example HelloWorldServlet to my
/servlet directory successfully through my web.xml file. I did this to make
sure that a servlet with no package could be deployed the way I am
attempting (HelloWorldExample has no package). The ONLY error I encountered
while deploying the HelloWorldExample, was it complained that the
ResourceBundle the code was looking for couldn't be found. I recompiled the
servlet without the ResourceBundle code and the servlet worked correctly.
(I wasn't sure how to configure the ResourceBundle in the code. I copied all
the files the resource bundle seemed to be referring to into my /servlet
directory along with the compiled HelloWorldServlet code, but it still
complained on execution that it couldn't locate the resource, so it was
easier for me to comment it out.)

This tells me I can definitely deploy a servlet the way I am trying to, but
it also raises questions about why the resource bundle couldn't be located.
Is all of this really a classpath or class loader issue in some way?


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 23, 2006 2:46 PM
To: 'Tomcat Users List'
Subject: RE: (newb) Tomcat servlet mapping problem

 On 1/23/06, Darren Hall [EMAIL PROTECTED] wrote:
From: Darren Hall [mailto:[EMAIL PROTECTED]
Subject: RE: (newb) Tomcat servlet mapping problem
   
Is there a way I can map these servlets (in the web.xml file) so
that Tomcat can see them and execute them?
  
 
 As far as I can see, it just works. Whether it's correct or not, it
 does seem work in Tomcat 5.5.12 and I know it worked in 5.0.28 too. So
 this is probably not the cause of your problem. Try putting one
 servlet in a package to see if that makes a difference, before you try
 to change them all.
 
 Here's a servlet declaration that I just tested:
 servlet
   servlet-nameTest/servlet-name
   servlet-classTest/servlet-class
 /servlet
 servlet-mapping
   servlet-nameTest/servlet-name
   url-pattern/test/url-pattern
 /servlet-mapping
 
 --
 Len

ok, the start of this thread got lost... let me try and do a brief
refresher...

I'm working with Tomcat 5.0, Apache 2, and a whole bunch of servlets that I
inherited. The website is a combination of static HTML and java. 95% of the
java code is implemented in servlets (that write out the dynamic HTML) and
NONE of the Java code is in packages.

The HTML on the site, when referring to servlets, uses relative paths like
form action=../servlet/servlet-name. In order to remove the invoker
servlet, I need to map all the servlets on the site through a web.xml file.

Initially, I was getting a resource unavailable error from Tomcat, but it
now appears as if my servlet mapping was wrong. (my app lived in the
${catalina.home}/webapp/servlet directory, and my web.xml was mapping a
servlet to url-mapping/servlet/[servlet-name]/url-mapping.

I fixed this by removing the '/servlet' in the url-mapping tag, and I now
get a stack trace with a ClassDefNotFound [servlet-name] error. This error
occurs when I point at Tomcat directly, so I know the error has nothing to
do with Apache. I now have a stripped down web.xml file that looks like this
(minus the xml and DOCTYPE directives):
...
web-app
  servlet
servlet-nameFLCUpEvDisplayServlet/servlet-name
servlet-classFLCUpEvDisplayServlet/servlet-class
  /servlet
  servlet-mapping
servlet-nameFLCUpEvDisplayServlet/servlet-name
url-pattern/FLCUpEvDisplayServlet/url-pattern
  /servlet-mapping
/web-app

Now everytime I hit the servlet, I get the ClassDefNotFound error, and
after that I see an entry in the log file:

2006-01-23 11:35:53 StandardContext[/servlet]Marking servlet
FLCUpEvDisplayServlet as unavailable
2006-01-23 11:35:53 StandardContext[/servlet]Error loading WebappClassLoader
  delegate: false
  repositories:
/WEB-INF/classes/

after which I get a resource is not available error again, until I stop
and restart Tomcat.

So, my question is... why am I getting the ClassDefNotFound error, and how
do I correct it (or can I, given my current configuration)?

Thanks

Darren



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Caldarale, Charles R
 From: Darren Hall [mailto:[EMAIL PROTECTED] 
 Subject: RE: (newb) Tomcat servlet mapping problem
 
 So, my question is... why am I getting the ClassDefNotFound 
 error, and how do I correct it (or can I, given my current
 configuration)?

Simplistic packageless servlets may well work, but real ones without
packages have caused grief for several people on this list.  Take a look
at:
http://tomcat.apache.org/faq/classnotfound.html
for more details.

Until that potential source of class loading confusion is removed, it
may be difficult to resolve any other issues you may be encountering.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Mike Sabroff

url-pattern/simple-servlet/url-pattern
should be
url-pattern/simple-servlet/*/url-pattern



Georg Sauer-Limbach wrote:

Darren,

if I look at your original configuration


servlet-mapping
servlet-nameSimpleServlet/servlet-name
url-pattern/simple-servlet/url-pattern
/servlet-mapping

---snip---
Context path=/simple-servlet docBase=SimpleServlet 
reloadable=true

debug=99


then, if I am not overlooking something,
the correct URL to invoke the servlet is

http://localhost/simple-servlet/simple-servlet

because the first simple-servlet is the
Context path where the webapp resides, and
the second simple-servlet is the URL for
the servlet inside the webapp, like correctly
configured in the webapp descriptor.

Georg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Mike Sabroff
Web Services Developer
[EMAIL PROTECTED]
920-568-8379


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Darren Hall
Georg,

 if I look at your original configuration
 
  servlet-mapping
  servlet-nameSimpleServlet/servlet-name
  url-pattern/simple-servlet/url-pattern
  /servlet-mapping
 ---snip---
  Context path=/simple-servlet docBase=SimpleServlet 
 reloadable=true debug=99
 
 then, if I am not overlooking something,
 the correct URL to invoke the servlet is
 
 http://localhost/simple-servlet/simple-servlet
 
 because the first simple-servlet is the
 Context path where the webapp resides, and
 the second simple-servlet is the URL for
 the servlet inside the webapp, like correctly
 configured in the webapp descriptor.
 
You are correct. I realized this yesterday while playing with this problem.
I've since removed my servlet.xml file that contains the Context tag
specifying the docBase and path. 

I've gotten over this hurdle and immediately gotten hung up on the next one.
=P The only file I'm using for mapping the servlet now is the web.xml file
in the ${catalina.home}/webapps/servlet/WEB-INF directory.

The new issue is ClassDefNotFound that occurs when I point my browser at
the servlet (see last message, because I'm not retyping that 'brief' recap
again).

Thanks, though. I do appreciate the help.

Darren



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Georg Sauer-Limbach

Mike Sabroff wrote:

url-pattern/simple-servlet/url-pattern
should be
url-pattern/simple-servlet/*/url-pattern


Does not need to. You can specify paths without
wildcards, which then only match that very url.

The whole story about servlet mappings (which is
quite short actually) is concisely explained in
section 11.2 of the Servlet specification, which
is available at

http://java.sun.com/products/servlet/download.html#specs

Georg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newb) Tomcat servlet mapping problem

2006-01-23 Thread Georg Sauer-Limbach

Darren Hall wrote:


(I wasn't sure how to configure the ResourceBundle in the code. I copied all
the files the resource bundle seemed to be referring to into my /servlet
directory along with the compiled HelloWorldServlet code, but it still
complained on execution that it couldn't locate the resource, so it was
easier for me to comment it out.)


Better forget about the /servlet url|directory.
It was only a made-up url segment for the invoker.
In production environments, never use that, but
explicit Context paths.

Put your servlet.xml (or whatever named, better
name it something like myapp.xml) in place again,
using a nice Context path.

After that, you can put all your servlets with
no package in WEB-INF/classes. This will also
be the place where your resource bundles will
be found.

Then, these mappings are perfectly alright:


web-app
  servlet
servlet-nameFLCUpEvDisplayServlet/servlet-name
servlet-classFLCUpEvDisplayServlet/servlet-class
  /servlet
  servlet-mapping
servlet-nameFLCUpEvDisplayServlet/servlet-name
url-pattern/FLCUpEvDisplayServlet/url-pattern
  /servlet-mapping
/web-app




Now everytime I hit the servlet, I get the ClassDefNotFound error, and
after that I see an entry in the log file:

2006-01-23 11:35:53 StandardContext[/servlet]Marking servlet
FLCUpEvDisplayServlet as unavailable
2006-01-23 11:35:53 StandardContext[/servlet]Error loading WebappClassLoader
  delegate: false
  repositories:
/WEB-INF/classes/



Hmm, you're mixing up that /servlet story.
Better remove everything named servlet from
your environment... It is only confusing.

Create app.xml, put the Context path /
or /app, and then /FCLxyzServlet or
/app/FCLxyzServlet are the correct URLs.

Does that make any sense?

Georg


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-22 Thread Darren Hall
Thanks for your help Warren.
I think I've made some progress on this problem, but I've encountered
another error. Here's where I am now...

I commented out all references to JK2 and downloaded
mod_jk-apache-2.0.55.so. I've set up mod_jk in apache's httpd.conf, and I am
now connecting to Tomcat successfully that way (example servlets have been
mapped successfully).

It looks like my original problem was caused by a simple mapping error. My
httpd.conf file now has a Location tag that forwards all requests for
'/servlet', as such
# Send servlet for context /servlet to 'worker1'
Location /servlet/*
  JkMount worker1
/Location

Under webapps, I've created a 'servlet' directory, and my
webapps/servlet/WEB-INF/web.xml file looks like this (note, I removed the
'/servlet' from the url-pattern, and this fixed my 'resource not found'
issue) -

?xml version=1.0 encoding=ISO-8859-1?
!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-nameFLCUpEvDisplayServlet/servlet-name
servlet-classFLCUpEvDisplayServlet/servlet-class
/servlet
servlet-mapping
servlet-nameFLCUpEvDisplayServlet/servlet-name
url-pattern/FLCUpEvDisplayServlet/url-pattern
/servlet-mapping
/web-app 

So, I've made some progress (I think), but now I'm getting a new error -

2006-01-22 19:21:01 StandardWrapperValve[FLCUpEvDisplayServlet]: Allocate
exception for servlet FLCUpEvDisplayServlet
javax.servlet.ServletException: Wrapper cannot find servlet class
FLCUpEvDisplayServlet or a class it depends on

So did I hit my servlet, or did the classloader fail to locate it??

Thanks.



-Original Message-
From: Warren Pace [mailto:[EMAIL PROTECTED] 
Sent: Saturday, January 21, 2006 9:34 AM
To: Tomcat Users List
Subject: Re: (newb) Tomcat servlet mapping problem


 
 From: Darren Hall [EMAIL PROTECTED]
 Date: 2006/01/20 Fri PM 02:28:22 EST
 To: users@tomcat.apache.org
 Subject: (newb) Tomcat servlet mapping problem
 
 I'm running Tomcat 5.0.30 and Apache 2.0 (both are running fine and
without
 errors).
 
 I've connected them using mod_jk2, and I can see that apache is correctly
 forwarding URLs specified in the workers2.properties file correctly.
 
 
 I am now attempting to map a test servlet called SimpleServlet to an
URL.
 
 I've deployed the servlet in the directory SimpleServlet. In the
 webapps/SimpleServlet/WEB-INF directory I've added the following web.xml
 file:
 
  
 
 ?xml version=1.0 encoding=ISO-8859-1?
 
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 
 version=2.4
 
  
 
 servlet
 
 servlet-nameSimpleServlet/servlet-name
 
 servlet-classus.souther.simple.SimpleServlet/servlet-class
 
 /servlet
 
 
 servlet-mapping
 
 servlet-nameSimpleServlet/servlet-name
 
 url-pattern/simple-servlet/url-pattern
 
 /servlet-mapping
 
  
 
 /web-app
 
  
 
 In the ${catalina.home}/conf/Catalina/localhost directory, I've added the
 following SimpleServlet.xml file:
 
  
 
 ?xml version='1.0' encoding='utf-8'?
 
 !-- Make the servlet reloadable --
 
 Context path=/simple-servlet docBase=SimpleServlet reloadable=true
 debug=99
 
   Logger className=org.apache.catalina.logger.FileLogger
 
   directory=logs  prefix=simple. suffix=.log
 
   timestamp=true/
 
 /Context
 
  
 
 In the workers2.properties file (on the Apache side), I've added the
 following entry:
 
  
 
 [uri:localhost/simple-servlet/*]
 
 worker=ajp13:localhost:8009
 
 debug=99
 
  
 
 When I try to hit the URL http://localhost/simple-servlet I get back this
 response from Tomcat:
 
  
 
 HTTP Status 404 -/simple-servlet
 
 type Status report
 
 message /simple-servlet
 
 description The requested resource (/simple-servlet) is not available.
 
 Apache Tomcat / 5.0.30
 
  
 
 Can anyone please tell me why my servlet is not mapped to the URL
properly?
 
  
 
 Thanks.
 
  
 
 Darren
 
 
Darren,
 I'm pretty new to this as well.  Here are a couple of things I do know.
mod_jk2 is deprecated.  That doesn't mean it won't work but all development
effort has been re-focusted to mod_jk.  It's simple enough to download and
build.
 1)  Is your servlet in a package (us.souther.simple)?  Did it compile
without error?
 2)  Generally the directory tree for servlets in packages =
WEB-INF/classes/us/souther/simple (which is where your web.xml is telling
tomcat to look for the class file).
 3)  Double-check the path entry in your context tag.  I moved from tomcat 4
to tomcat 5.5, skipping the 5.0 releases so I can't provide any insight on
the context directives (in 5.5 you don't specify a context path).  Just make
sure it's pointing tomcat to something real.
 4) Some good resources are Jayson Falkner  Kevin Jones book Servlets

RE: (newb) Tomcat servlet mapping problem

2006-01-22 Thread Steve Ochani
Date sent:  Sun, 22 Jan 2006 19:55:36 -0500
From:   Darren Hall [EMAIL PROTECTED]
Subject:RE: (newb) Tomcat servlet mapping problem
To: 'Tomcat Users List' users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org

 
 So, I've made some progress (I think), but now I'm getting a new error
 -
 
 2006-01-22 19:21:01 StandardWrapperValve[FLCUpEvDisplayServlet]:
 Allocate exception for servlet FLCUpEvDisplayServlet
 javax.servlet.ServletException: Wrapper cannot find servlet class
 FLCUpEvDisplayServlet or a class it depends on
 
 So did I hit my servlet, or did the classloader fail to locate
 it??

Have you tried accessing the servlet directly via tomcat yet?
If going through tomcat itself gives an error then work on fixing that error 
first before worrying 
about mod_jk.

-Steve O.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-22 Thread Darren Hall
 
 Have you tried accessing the servlet directly via tomcat yet?
 If going through tomcat itself gives an error then work on fixing that 
 error first before worrying 
 about mod_jk.
 
 -Steve O.
 

I had not, but that was an excellent idea (kinda upset I didn't think of
that one myself =P).

I get the same error when trying to execute the servlet directly through
Tomcat. The same information is repeated in the log files. Unfortunately, I
don't have great logging (I may have it configured wrong - everything goes
to localhost.log and catalina.log, nothing goes to stdout.log or stderr.log
at all) so it makes fixing this problem that much more fun/challenging!


-Original Message-
From: Steve Ochani [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 22, 2006 8:37 PM
To: Darren Hall; 'Tomcat Users List'
Subject: RE: (newb) Tomcat servlet mapping problem

Date sent:  Sun, 22 Jan 2006 19:55:36 -0500
From:   Darren Hall [EMAIL PROTECTED]
Subject:RE: (newb) Tomcat servlet mapping problem
To: 'Tomcat Users List' users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org

 
 So, I've made some progress (I think), but now I'm getting a new error
 -
 
 2006-01-22 19:21:01 StandardWrapperValve[FLCUpEvDisplayServlet]:
 Allocate exception for servlet FLCUpEvDisplayServlet
 javax.servlet.ServletException: Wrapper cannot find servlet class
 FLCUpEvDisplayServlet or a class it depends on
 
 So did I hit my servlet, or did the classloader fail to locate
 it??

Have you tried accessing the servlet directly via tomcat yet?
If going through tomcat itself gives an error then work on fixing that error
first before worrying 
about mod_jk.

-Steve O.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newb) Tomcat servlet mapping problem

2006-01-22 Thread foo shyn
Have u checked ur web.xml configuration?
The error sounds like Tomcat facing problem finding ur servlet class file...

- Original Message - 
From: Darren Hall [EMAIL PROTECTED]
To: 'Tomcat Users List' users@tomcat.apache.org; [EMAIL PROTECTED]
Sent: Monday, January 23, 2006 9:43 AM
Subject: RE: (newb) Tomcat servlet mapping problem



 Have you tried accessing the servlet directly via tomcat yet?
 If going through tomcat itself gives an error then work on fixing that 
 error first before worrying
 about mod_jk.

 -Steve O.


I had not, but that was an excellent idea (kinda upset I didn't think of
that one myself =P).

I get the same error when trying to execute the servlet directly through
Tomcat. The same information is repeated in the log files. Unfortunately, I
don't have great logging (I may have it configured wrong - everything goes
to localhost.log and catalina.log, nothing goes to stdout.log or stderr.log
at all) so it makes fixing this problem that much more fun/challenging!


-Original Message-
From: Steve Ochani [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 22, 2006 8:37 PM
To: Darren Hall; 'Tomcat Users List'
Subject: RE: (newb) Tomcat servlet mapping problem

Date sent:  Sun, 22 Jan 2006 19:55:36 -0500
From:   Darren Hall [EMAIL PROTECTED]
Subject:RE: (newb) Tomcat servlet mapping problem
To: 'Tomcat Users List' users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org


 So, I've made some progress (I think), but now I'm getting a new error
 -

 2006-01-22 19:21:01 StandardWrapperValve[FLCUpEvDisplayServlet]:
 Allocate exception for servlet FLCUpEvDisplayServlet
 javax.servlet.ServletException: Wrapper cannot find servlet class
 FLCUpEvDisplayServlet or a class it depends on

 So did I hit my servlet, or did the classloader fail to locate
 it??

Have you tried accessing the servlet directly via tomcat yet?
If going through tomcat itself gives an error then work on fixing that error
first before worrying
about mod_jk.

-Steve O.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-22 Thread Darren Hall
 
 Have you tried accessing the servlet directly via tomcat yet?
 If going through tomcat itself gives an error then work on fixing that 
 error first before worrying 
 about mod_jk.
 
 -Steve O.


So, is this a simple classpath error? It looks like the classloader was
unable to find my servlet, but since the class lives in the
webapps/servlet/WEB-INF/classes directory, I thought it was included in the
classpath of the app server (or more specifically, my applications
classpath) by default. Is this not correct? And, if it's not correct...
where do I specify the classpath for the classloader for this app?

(Please forgive my Tomcat classloading ignorance.)

Darren

-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 22, 2006 8:44 PM
To: 'Tomcat Users List'; [EMAIL PROTECTED]
Subject: RE: (newb) Tomcat servlet mapping problem

 
 Have you tried accessing the servlet directly via tomcat yet?
 If going through tomcat itself gives an error then work on fixing that 
 error first before worrying 
 about mod_jk.
 
 -Steve O.
 

I had not, but that was an excellent idea (kinda upset I didn't think of
that one myself =P).

I get the same error when trying to execute the servlet directly through
Tomcat. The same information is repeated in the log files. Unfortunately, I
don't have great logging (I may have it configured wrong - everything goes
to localhost.log and catalina.log, nothing goes to stdout.log or stderr.log
at all) so it makes fixing this problem that much more fun/challenging!


-Original Message-
From: Steve Ochani [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 22, 2006 8:37 PM
To: Darren Hall; 'Tomcat Users List'
Subject: RE: (newb) Tomcat servlet mapping problem

Date sent:  Sun, 22 Jan 2006 19:55:36 -0500
From:   Darren Hall [EMAIL PROTECTED]
Subject:RE: (newb) Tomcat servlet mapping problem
To: 'Tomcat Users List' users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org

 
 So, I've made some progress (I think), but now I'm getting a new error
 -
 
 2006-01-22 19:21:01 StandardWrapperValve[FLCUpEvDisplayServlet]:
 Allocate exception for servlet FLCUpEvDisplayServlet
 javax.servlet.ServletException: Wrapper cannot find servlet class
 FLCUpEvDisplayServlet or a class it depends on
 
 So did I hit my servlet, or did the classloader fail to locate
 it??

Have you tried accessing the servlet directly via tomcat yet?
If going through tomcat itself gives an error then work on fixing that error
first before worrying 
about mod_jk.

-Steve O.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-22 Thread Darren Hall
 
 Have u checked ur web.xml configuration?
 The error sounds like Tomcat facing problem finding ur servlet class 
 file...


I have. The servlets I am trying to deploy (err, map?) do not have a package
associated with them. My class files live in the
${catalina.home}/webapps/servlet/WEB-INF/classes directory.
My ${catalina.home}/webapps/servlet/WEB-INF/web.xml looks like this (minus
the xml identifier and DOCTYPE tags at the top) -

web-app
servlet
servlet-nameFLCUpEvDisplayServlet/servlet-name
servlet-classFLCUpEvDisplayServlet/servlet-class
/servlet
servlet-mapping
servlet-nameFLCUpEvDisplayServlet/servlet-name
url-pattern/FLCUpEvDisplayServlet/url-pattern
/servlet-mapping
/web-app

-Original Message-
From: foo shyn [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 22, 2006 8:52 PM
To: Tomcat Users List
Subject: Re: (newb) Tomcat servlet mapping problem

Have u checked ur web.xml configuration?
The error sounds like Tomcat facing problem finding ur servlet class file...


- Original Message - 
From: Darren Hall [EMAIL PROTECTED]
To: 'Tomcat Users List' users@tomcat.apache.org; [EMAIL PROTECTED]
Sent: Monday, January 23, 2006 9:43 AM
Subject: RE: (newb) Tomcat servlet mapping problem



 Have you tried accessing the servlet directly via tomcat yet?
 If going through tomcat itself gives an error then work on fixing that 
 error first before worrying
 about mod_jk.

 -Steve O.


I had not, but that was an excellent idea (kinda upset I didn't think of
that one myself =P).

I get the same error when trying to execute the servlet directly through
Tomcat. The same information is repeated in the log files. Unfortunately, I
don't have great logging (I may have it configured wrong - everything goes
to localhost.log and catalina.log, nothing goes to stdout.log or stderr.log
at all) so it makes fixing this problem that much more fun/challenging!


-Original Message-
From: Steve Ochani [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 22, 2006 8:37 PM
To: Darren Hall; 'Tomcat Users List'
Subject: RE: (newb) Tomcat servlet mapping problem

Date sent:  Sun, 22 Jan 2006 19:55:36 -0500
From:   Darren Hall [EMAIL PROTECTED]
Subject:RE: (newb) Tomcat servlet mapping problem
To: 'Tomcat Users List' users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org


 So, I've made some progress (I think), but now I'm getting a new error
 -

 2006-01-22 19:21:01 StandardWrapperValve[FLCUpEvDisplayServlet]:
 Allocate exception for servlet FLCUpEvDisplayServlet
 javax.servlet.ServletException: Wrapper cannot find servlet class
 FLCUpEvDisplayServlet or a class it depends on

 So did I hit my servlet, or did the classloader fail to locate
 it??

Have you tried accessing the servlet directly via tomcat yet?
If going through tomcat itself gives an error then work on fixing that error
first before worrying
about mod_jk.

-Steve O.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: (newb) Tomcat servlet mapping problem

2006-01-22 Thread Caldarale, Charles R
 From: Darren Hall [mailto:[EMAIL PROTECTED] 
 Subject: RE: (newb) Tomcat servlet mapping problem
 
 I have. The servlets I am trying to deploy (err, map?) do not 
 have a package associated with them.

Not sure if your first sentence meant you found the problem, but just to
make sure it's clear, the current Servlet Spec does require that servlet
classes be in a package.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newb) Tomcat servlet mapping problem

2006-01-21 Thread Warren Pace

 
 From: Darren Hall [EMAIL PROTECTED]
 Date: 2006/01/20 Fri PM 02:28:22 EST
 To: users@tomcat.apache.org
 Subject: (newb) Tomcat servlet mapping problem
 
 I'm running Tomcat 5.0.30 and Apache 2.0 (both are running fine and without
 errors).
 
 I've connected them using mod_jk2, and I can see that apache is correctly
 forwarding URLs specified in the workers2.properties file correctly.
 
 
 I am now attempting to map a test servlet called SimpleServlet to an URL.
 
 I've deployed the servlet in the directory SimpleServlet. In the
 webapps/SimpleServlet/WEB-INF directory I've added the following web.xml
 file:
 
  
 
 ?xml version=1.0 encoding=ISO-8859-1?
 
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 
 version=2.4
 
  
 
 servlet
 
 servlet-nameSimpleServlet/servlet-name
 
 servlet-classus.souther.simple.SimpleServlet/servlet-class
 
 /servlet
 
 
 servlet-mapping
 
 servlet-nameSimpleServlet/servlet-name
 
 url-pattern/simple-servlet/url-pattern
 
 /servlet-mapping
 
  
 
 /web-app
 
  
 
 In the ${catalina.home}/conf/Catalina/localhost directory, I've added the
 following SimpleServlet.xml file:
 
  
 
 ?xml version='1.0' encoding='utf-8'?
 
 !-- Make the servlet reloadable --
 
 Context path=/simple-servlet docBase=SimpleServlet reloadable=true
 debug=99
 
   Logger className=org.apache.catalina.logger.FileLogger
 
   directory=logs  prefix=simple. suffix=.log
 
   timestamp=true/
 
 /Context
 
  
 
 In the workers2.properties file (on the Apache side), I've added the
 following entry:
 
  
 
 [uri:localhost/simple-servlet/*]
 
 worker=ajp13:localhost:8009
 
 debug=99
 
  
 
 When I try to hit the URL http://localhost/simple-servlet I get back this
 response from Tomcat:
 
  
 
 HTTP Status 404 -/simple-servlet
 
 type Status report
 
 message /simple-servlet
 
 description The requested resource (/simple-servlet) is not available.
 
 Apache Tomcat / 5.0.30
 
  
 
 Can anyone please tell me why my servlet is not mapped to the URL properly?
 
  
 
 Thanks.
 
  
 
 Darren
 
 
Darren,
 I'm pretty new to this as well.  Here are a couple of things I do know.  
mod_jk2 is deprecated.  That doesn't mean it won't work but all development 
effort has been re-focusted to mod_jk.  It's simple enough to download and 
build.
 1)  Is your servlet in a package (us.souther.simple)?  Did it compile without 
error?
 2)  Generally the directory tree for servlets in packages = 
WEB-INF/classes/us/souther/simple (which is where your web.xml is telling 
tomcat to look for the class file).
 3)  Double-check the path entry in your context tag.  I moved from tomcat 4 to 
tomcat 5.5, skipping the 5.0 releases so I can't provide any insight on the 
context directives (in 5.5 you don't specify a context path).  Just make sure 
it's pointing tomcat to something real.
 4) Some good resources are Jayson Falkner  Kevin Jones book Servlets and JSP 
The J2EE Web Tier, this mailing list, and Google.
Hope this helps.
Warren
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]