RE: Tomcat configuration problem: JSPs work, servlets don't

2003-01-22 Thread Turner, John

What error message do you get?

The default Invoker servlet is disabled by default for security reasons in
recent versions of 4.1.x.

John


 -Original Message-
 From: Felicia Neff [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 3:49 PM
 To: Tomcat Users List
 Subject: Tomcat configuration problem: JSPs work, servlets don't
 
 
 I am running Tomcat-4.1.18, Apache-1.3.27, and mod_jk-1.2.0.  
 The problem
 I am having is that while JSPs work, servlets don't.  This is 
 the relevant
 portion of my server.xml file:
   Host name=www.mydomain.org debug=0
appBase=/path/to/files liveDeploy=true
unpackWARs=false autoDeploy=true 
 workDir=/var/tomcat/work
 
 Valve className=org.apache.catalina.valves.AccessLogValve
  directory=/var/tomcat/log  
 prefix=tomcat_access_log.
  suffix=.log
  pattern=common resolveHosts=false/
 
 !-- Tomcat Root Context --
   Context path= docBase=/path/to/files debug=0 
 reloadable=true/
 
   /Host
 
 In /path/to/files, I have:
 hello.jsp
 WEB-INF/classes/HelloServlet.class
 WEB-INF/classes/HelloServlet.java
 
 From what I have read, if I don't have a web.xml in WEB-INF, then the
 default will be used.  Since this is just for testing, I'm 
 hoping that I
 don't need one.  The ultimate goal is to set this up for an 
 isp. so that
 users can put their servlets into place and have them work 
 without having
 the privileges to reload anything.
 Thanks in advance for your help. -- Felicia
 
 ~~
 [EMAIL PROTECTED]
 Panix Staff
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

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




Re: Tomcat configuration problem: JSPs work, servlets don't

2003-01-22 Thread Felicia Neff
Woops, I realize that I should have been more specific.  The error I get
is a 404 error.  I'm sure the servlet itself works, because I dropped it
into the examples directory and was able to run it. -- Felicia

On Wed, 22 Jan 2003, Felicia Neff wrote:

 I am running Tomcat-4.1.18, Apache-1.3.27, and mod_jk-1.2.0.  The problem
 I am having is that while JSPs work, servlets don't.  This is the relevant
 portion of my server.xml file:
   Host name=www.mydomain.org debug=0
appBase=/path/to/files liveDeploy=true
unpackWARs=false autoDeploy=true workDir=/var/tomcat/work

 Valve className=org.apache.catalina.valves.AccessLogValve
  directory=/var/tomcat/log  prefix=tomcat_access_log.
  suffix=.log
  pattern=common resolveHosts=false/

 !-- Tomcat Root Context --
   Context path= docBase=/path/to/files debug=0 reloadable=true/

   /Host

 In /path/to/files, I have:
 hello.jsp
 WEB-INF/classes/HelloServlet.class
 WEB-INF/classes/HelloServlet.java

 From what I have read, if I don't have a web.xml in WEB-INF, then the
 default will be used.  Since this is just for testing, I'm hoping that I
 don't need one.  The ultimate goal is to set this up for an isp. so that
 users can put their servlets into place and have them work without having
 the privileges to reload anything.
 Thanks in advance for your help. -- Felicia

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




Re: Tomcat configuration problem: JSPs work, servlets don't

2003-01-22 Thread Felicia Neff
The exact error I get when I try to access
http://www.mydomain.org/servlet/HelloServlet is:

HTTP Status 404 - /servlet/HelloServlet

type Status report

message /servlet/HelloServlet

description The requested resource (/servlet/HelloServlet) is not
available.
Apache Tomcat/4.1.18

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




RE: Tomcat configuration problem: JSPs work, servlets don't

2003-01-22 Thread Turner, John

Sorry, I should have been clearer.  

Have you mapped HelloServlet in web.xml?  You can't just drop a servlet into
a directory anymore, especially the default ROOT directory...the default
Invoker servlet (which used to let you just drop a servlet into a directory
and have it work) is disabled by default for security reasons in recent
versions of 4.1.x.  The examples directory has the Invoker servlet enabled,
that's why it works there and not elsewhere.

If you really must enable the Invoker servlet (not recommended, definitely
not for a production machine, so eventually you will have to understand how
to map it in web.xml anyway so you might as well start now), then edit
CATALINA_HOME/conf/web.xml and enable the following by removing the !--
and the --, then restart Tomcat:

!-- The mapping for the invoker servlet --
!--
servlet-mapping
servlet-nameinvoker/servlet-name
url-pattern/servlet/*/url-pattern
/servlet-mapping
--

The preferred and recommended method is to explicitly map your servlet in
your application's web.xml file, something like:

servlet
servlet-nameHelloServlet/servlet-name
servlet-class
  path.to.my.class.files.HelloServlet
/servlet-class
/servlet
servlet-mapping
servlet-nameHelloServlet/servlet-name
url-pattern/HelloServlet/url-pattern
/servlet-mapping

For more info check the docs.

John

 -Original Message-
 From: Felicia Neff [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 22, 2003 4:58 PM
 To: Tomcat Users List
 Subject: Re: Tomcat configuration problem: JSPs work, servlets don't
 
 
 The exact error I get when I try to access
 http://www.mydomain.org/servlet/HelloServlet is:
 
 HTTP Status 404 - /servlet/HelloServlet
 
 type Status report
 
 message /servlet/HelloServlet
 
 description The requested resource (/servlet/HelloServlet) is not
 available.
 Apache Tomcat/4.1.18
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 

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




RE: Tomcat configuration problem: JSPs work, servlets don't

2003-01-22 Thread Felicia Neff
That's exactly what I needed to know.  Thanks. -- Felicia

On Wed, 22 Jan 2003, Turner, John wrote:


 Sorry, I should have been clearer.

 Have you mapped HelloServlet in web.xml?  You can't just drop a servlet into
 a directory anymore, especially the default ROOT directory...the default
 Invoker servlet (which used to let you just drop a servlet into a directory
 and have it work) is disabled by default for security reasons in recent
 versions of 4.1.x.  The examples directory has the Invoker servlet enabled,
 that's why it works there and not elsewhere.

 If you really must enable the Invoker servlet (not recommended, definitely
 not for a production machine, so eventually you will have to understand how
 to map it in web.xml anyway so you might as well start now), then edit
 CATALINA_HOME/conf/web.xml and enable the following by removing the !--
 and the --, then restart Tomcat:

 !-- The mapping for the invoker servlet --
 !--
 servlet-mapping
 servlet-nameinvoker/servlet-name
 url-pattern/servlet/*/url-pattern
 /servlet-mapping
 --

 The preferred and recommended method is to explicitly map your servlet in
 your application's web.xml file, something like:

 servlet
 servlet-nameHelloServlet/servlet-name
 servlet-class
   path.to.my.class.files.HelloServlet
 /servlet-class
 /servlet
 servlet-mapping
 servlet-nameHelloServlet/servlet-name
 url-pattern/HelloServlet/url-pattern
 /servlet-mapping

 For more info check the docs.

 John

  -Original Message-
  From: Felicia Neff [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, January 22, 2003 4:58 PM
  To: Tomcat Users List
  Subject: Re: Tomcat configuration problem: JSPs work, servlets don't
 
 
  The exact error I get when I try to access
  http://www.mydomain.org/servlet/HelloServlet is:
 
  HTTP Status 404 - /servlet/HelloServlet
 
  type Status report
 
  message /servlet/HelloServlet
 
  description The requested resource (/servlet/HelloServlet) is not
  available.
  Apache Tomcat/4.1.18
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 

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



~~
[EMAIL PROTECTED]
Panix Staff

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