You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Teh Noranis Mohd Aris <te...@yahoo.com> on 2005/12/20 06:56:38 UTC

Please Help! Error in using Packages

Hi,
I'm learning to use packages from a book example to
create my own servlet instead of putting the code in
the examples webapp. However the following error
occurs:

HTTP Status 404 -
/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
________________________________________
type Status report
message
/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
description The requested resource
(/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet)
is not available.
________________________________________
Apache Tomcat/4.1.31

How can I fix the error? I'm sure that the servlet is
in the correct directory and I've put the web.xml in
the WEB-INF directory. Did I miss anything? Please
help. Thanks.

Yours Sincerely,
TEH

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by Teh Noranis Mohd Aris <te...@yahoo.com>.
Actually, it's only a small matter. I accessed the url
from the browser by not following the correct path as
in the url-pattern in web.xml file. That's why I got
the error message 404 where the path is not available.

TEH 

--- KJ R <kj...@yahoo.com> wrote:

> Usually, when you solve a problem, it's helpful to
> post what the solution was, even if it was something
> silly, it could possibly help someone else.
> 
> K
> 
> --- Teh Noranis Mohd Aris <te...@yahoo.com>
> wrote:
> 
> > Dear all,
> > I've already solve the problem. Thanks to all who
> > had
> > contributed.
> > 
> > TEH
> > 
> > 
> > --- Prasad <li...@gmail.com> wrote:
> > 
> > > Teh,
> > > 
> > > The web.xml looks fine to me.  Can  you confirm
> > that
> > > you war file is 
> > > packaged correctly i.e
> > > its created with proper packages structure and
> > > dir/file names.
> > > 
> > > Also, I was wondering why are you being asked to
> > > (explicitly) create a 
> > > <context> element in server.xml. Is it a TC v4.x
> > > requirement ?
> > > I have used TC 3,4 and 5 but never was I
> required
> > to
> > > explicitly create a 
> > > context entry in server.xml for any webapp.
> > > 
> > > I used more of a traditional way of dropping a
> war
> > > file into webapps/ 
> > > and re-starting the container and it has been
> > > working
> > > fine for me so far.
> > > 
> > > Experts, any thoughts on this one ?
> > > 
> > > Teh, if you are sure that the deployed WAR is
> sane
> > > then we should wait 
> > > for experts to provide an answer.
> > > 
> > > -Prasad.
> > > 
> > > Teh Noranis Mohd Aris wrote:
> > > 
> > > >The web.xml looks like this:
> > > >
> > > ><?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/j2ee/dtds/web-app_2_3.dtd">
> > > >
> > > ><web-app>
> > > >
> > > >  <servlet>
> > > >    <servlet-name>MyFirstServlet</servlet-name>
> > > >   
> > >
> >
>
><servlet-class>com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet</servlet-class>
> > > >  </servlet>
> > > >
> > > >  <servlet-mapping>
> > > >    <servlet-name>MyFirstServlet</servlet-name>
> > > >    <url-pattern>
> > > >      /MyFirstServlet
> > > >    </url-pattern>
> > > >  </servlet-mapping>
> > > >
> > > ></web-app>
> > > >
> > > >I placed the web.xml in
> > > >c:\jakarta-tomcat-4.1.31\webapps\ch03\WEB-INF
> > > >directory.
> > > >
> > > >How about the server.xml file in
> > > >c:\jakarta-tomcat-4.1.31\conf directory? The
> > > original
> > > >file looks like this:
> > > >
> > > >.
> > > >.
> > > >.
> > > ><!-- Tomcat Examples Context -->
> > > >        <Context path="/examples"
> > > docBase="examples"
> > > >debug="0"
> > > >                 reloadable="true"
> > > >crossContext="true">
> > > >          <Logger
> > >
> >className="org.apache.catalina.logger.FileLogger"
> > > >                    
> > > prefix="localhost_examples_log."
> > > >suffix=".txt"
> > > >        	  timestamp="true"/>
> > > >          <Ejb   name="ejb/EmplRecord"
> > > type="Entity"
> > > >                
> > > >home="com.wombat.empl.EmployeeRecordHome"
> > > >              
> > > >remote="com.wombat.empl.EmployeeRecord"/>
> > > >.
> > > >.
> > > >.
> > > >
> > > >Should I replace <Context path="/examples" to
> > > <Context
> > > >path="ch03" and docBase="examples" to
> > > >docBase="myfirstwebapp" (the war file for
> > > >myfirstwebapp in the
> > > >c:\jakarta-tomcat-4.1.31\webapps\ch03
> directory)?
> > > >Thanks.
> > > >
> > > >TEH  
> > > >
> > > >--- Prasad <li...@gmail.com> wrote:
> > > >
> > > >  
> > > >
> > > >>Can you post your web.xml. I think I can help
> > you
> > > >>with this but only 
> > > >>after looking at your web.xml.
> > > >>I think the problem is with <servlet> and
> > > >><servlet-mapping> in your 
> > > >>web.xml. Moreover as David said, you can find
> > all
> > > >>the information in the 
> > > >>Docs.
> > > >>-Prasad.
> > > >>
> > > >>
> > > >>    
> > > >>
> > >
> >
>
>---------------------------------------------------------------------
> > > >  
> > > >
> > > >>To unsubscribe, e-mail:
> > > >>users-unsubscribe@tomcat.apache.org
> > > >>For additional commands, e-mail:
> > > >>users-help@tomcat.apache.org
> > > >>
> > > >>
> > > >>    
> > > >>
> > > >
> > > >
> > >
> >
> >__________________________________________________
> > > >Do You Yahoo!?
> > > >Tired of spam?  Yahoo! Mail has the best spam
> > > protection around 
> > > >http://mail.yahoo.com 
> > > >
> > >
> >
>
>---------------------------------------------------------------------
> > > >To unsubscribe, e-mail:
> > > users-unsubscribe@tomcat.apache.org
> > > >For additional commands, e-mail:
> > > users-help@tomcat.apache.org
> > > >
> > > >
> > > >  
> > > >
> > > 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail:
> > > users-help@tomcat.apache.org
> > > 
> > > 
> > 
> > 
> > 
> > 	
> > 		
> > __________________________________ 
> 
=== message truncated ===



		
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by KJ R <kj...@yahoo.com>.
Usually, when you solve a problem, it's helpful to
post what the solution was, even if it was something
silly, it could possibly help someone else.

K

--- Teh Noranis Mohd Aris <te...@yahoo.com>
wrote:

> Dear all,
> I've already solve the problem. Thanks to all who
> had
> contributed.
> 
> TEH
> 
> 
> --- Prasad <li...@gmail.com> wrote:
> 
> > Teh,
> > 
> > The web.xml looks fine to me.  Can  you confirm
> that
> > you war file is 
> > packaged correctly i.e
> > its created with proper packages structure and
> > dir/file names.
> > 
> > Also, I was wondering why are you being asked to
> > (explicitly) create a 
> > <context> element in server.xml. Is it a TC v4.x
> > requirement ?
> > I have used TC 3,4 and 5 but never was I required
> to
> > explicitly create a 
> > context entry in server.xml for any webapp.
> > 
> > I used more of a traditional way of dropping a war
> > file into webapps/ 
> > and re-starting the container and it has been
> > working
> > fine for me so far.
> > 
> > Experts, any thoughts on this one ?
> > 
> > Teh, if you are sure that the deployed WAR is sane
> > then we should wait 
> > for experts to provide an answer.
> > 
> > -Prasad.
> > 
> > Teh Noranis Mohd Aris wrote:
> > 
> > >The web.xml looks like this:
> > >
> > ><?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/j2ee/dtds/web-app_2_3.dtd">
> > >
> > ><web-app>
> > >
> > >  <servlet>
> > >    <servlet-name>MyFirstServlet</servlet-name>
> > >   
> >
>
><servlet-class>com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet</servlet-class>
> > >  </servlet>
> > >
> > >  <servlet-mapping>
> > >    <servlet-name>MyFirstServlet</servlet-name>
> > >    <url-pattern>
> > >      /MyFirstServlet
> > >    </url-pattern>
> > >  </servlet-mapping>
> > >
> > ></web-app>
> > >
> > >I placed the web.xml in
> > >c:\jakarta-tomcat-4.1.31\webapps\ch03\WEB-INF
> > >directory.
> > >
> > >How about the server.xml file in
> > >c:\jakarta-tomcat-4.1.31\conf directory? The
> > original
> > >file looks like this:
> > >
> > >.
> > >.
> > >.
> > ><!-- Tomcat Examples Context -->
> > >        <Context path="/examples"
> > docBase="examples"
> > >debug="0"
> > >                 reloadable="true"
> > >crossContext="true">
> > >          <Logger
> > >className="org.apache.catalina.logger.FileLogger"
> > >                    
> > prefix="localhost_examples_log."
> > >suffix=".txt"
> > >        	  timestamp="true"/>
> > >          <Ejb   name="ejb/EmplRecord"
> > type="Entity"
> > >                
> > >home="com.wombat.empl.EmployeeRecordHome"
> > >              
> > >remote="com.wombat.empl.EmployeeRecord"/>
> > >.
> > >.
> > >.
> > >
> > >Should I replace <Context path="/examples" to
> > <Context
> > >path="ch03" and docBase="examples" to
> > >docBase="myfirstwebapp" (the war file for
> > >myfirstwebapp in the
> > >c:\jakarta-tomcat-4.1.31\webapps\ch03 directory)?
> > >Thanks.
> > >
> > >TEH  
> > >
> > >--- Prasad <li...@gmail.com> wrote:
> > >
> > >  
> > >
> > >>Can you post your web.xml. I think I can help
> you
> > >>with this but only 
> > >>after looking at your web.xml.
> > >>I think the problem is with <servlet> and
> > >><servlet-mapping> in your 
> > >>web.xml. Moreover as David said, you can find
> all
> > >>the information in the 
> > >>Docs.
> > >>-Prasad.
> > >>
> > >>
> > >>    
> > >>
> >
>
>---------------------------------------------------------------------
> > >  
> > >
> > >>To unsubscribe, e-mail:
> > >>users-unsubscribe@tomcat.apache.org
> > >>For additional commands, e-mail:
> > >>users-help@tomcat.apache.org
> > >>
> > >>
> > >>    
> > >>
> > >
> > >
> >
> >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > >http://mail.yahoo.com 
> > >
> >
>
>---------------------------------------------------------------------
> > >To unsubscribe, e-mail:
> > users-unsubscribe@tomcat.apache.org
> > >For additional commands, e-mail:
> > users-help@tomcat.apache.org
> > >
> > >
> > >  
> > >
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail:
> > users-help@tomcat.apache.org
> > 
> > 
> 
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! for Good - Make a difference this year. 
> http://brand.yahoo.com/cybergivingweek2005/
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by Teh Noranis Mohd Aris <te...@yahoo.com>.
Dear all,
I've already solve the problem. Thanks to all who had
contributed.

TEH


--- Prasad <li...@gmail.com> wrote:

> Teh,
> 
> The web.xml looks fine to me.  Can  you confirm that
> you war file is 
> packaged correctly i.e
> its created with proper packages structure and
> dir/file names.
> 
> Also, I was wondering why are you being asked to
> (explicitly) create a 
> <context> element in server.xml. Is it a TC v4.x
> requirement ?
> I have used TC 3,4 and 5 but never was I required to
> explicitly create a 
> context entry in server.xml for any webapp.
> 
> I used more of a traditional way of dropping a war
> file into webapps/ 
> and re-starting the container and it has been
> working
> fine for me so far.
> 
> Experts, any thoughts on this one ?
> 
> Teh, if you are sure that the deployed WAR is sane
> then we should wait 
> for experts to provide an answer.
> 
> -Prasad.
> 
> Teh Noranis Mohd Aris wrote:
> 
> >The web.xml looks like this:
> >
> ><?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/j2ee/dtds/web-app_2_3.dtd">
> >
> ><web-app>
> >
> >  <servlet>
> >    <servlet-name>MyFirstServlet</servlet-name>
> >   
>
><servlet-class>com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet</servlet-class>
> >  </servlet>
> >
> >  <servlet-mapping>
> >    <servlet-name>MyFirstServlet</servlet-name>
> >    <url-pattern>
> >      /MyFirstServlet
> >    </url-pattern>
> >  </servlet-mapping>
> >
> ></web-app>
> >
> >I placed the web.xml in
> >c:\jakarta-tomcat-4.1.31\webapps\ch03\WEB-INF
> >directory.
> >
> >How about the server.xml file in
> >c:\jakarta-tomcat-4.1.31\conf directory? The
> original
> >file looks like this:
> >
> >.
> >.
> >.
> ><!-- Tomcat Examples Context -->
> >        <Context path="/examples"
> docBase="examples"
> >debug="0"
> >                 reloadable="true"
> >crossContext="true">
> >          <Logger
> >className="org.apache.catalina.logger.FileLogger"
> >                    
> prefix="localhost_examples_log."
> >suffix=".txt"
> >        	  timestamp="true"/>
> >          <Ejb   name="ejb/EmplRecord"
> type="Entity"
> >                
> >home="com.wombat.empl.EmployeeRecordHome"
> >              
> >remote="com.wombat.empl.EmployeeRecord"/>
> >.
> >.
> >.
> >
> >Should I replace <Context path="/examples" to
> <Context
> >path="ch03" and docBase="examples" to
> >docBase="myfirstwebapp" (the war file for
> >myfirstwebapp in the
> >c:\jakarta-tomcat-4.1.31\webapps\ch03 directory)?
> >Thanks.
> >
> >TEH  
> >
> >--- Prasad <li...@gmail.com> wrote:
> >
> >  
> >
> >>Can you post your web.xml. I think I can help you
> >>with this but only 
> >>after looking at your web.xml.
> >>I think the problem is with <servlet> and
> >><servlet-mapping> in your 
> >>web.xml. Moreover as David said, you can find all
> >>the information in the 
> >>Docs.
> >>-Prasad.
> >>
> >>
> >>    
> >>
>
>---------------------------------------------------------------------
> >  
> >
> >>To unsubscribe, e-mail:
> >>users-unsubscribe@tomcat.apache.org
> >>For additional commands, e-mail:
> >>users-help@tomcat.apache.org
> >>
> >>
> >>    
> >>
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> >http://mail.yahoo.com 
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> >For additional commands, e-mail:
> users-help@tomcat.apache.org
> >
> >
> >  
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 



	
		
__________________________________ 
Yahoo! for Good - Make a difference this year. 
http://brand.yahoo.com/cybergivingweek2005/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by Prasad <li...@gmail.com>.
Teh,

The web.xml looks fine to me.  Can  you confirm that you war file is 
packaged correctly i.e
its created with proper packages structure and dir/file names.

Also, I was wondering why are you being asked to (explicitly) create a 
<context> element in server.xml. Is it a TC v4.x requirement ?
I have used TC 3,4 and 5 but never was I required to explicitly create a 
context entry in server.xml for any webapp.

I used more of a traditional way of dropping a war file into webapps/ 
and re-starting the container and it has been working
fine for me so far.

Experts, any thoughts on this one ?

Teh, if you are sure that the deployed WAR is sane then we should wait 
for experts to provide an answer.

-Prasad.

Teh Noranis Mohd Aris wrote:

>The web.xml looks like this:
>
><?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/j2ee/dtds/web-app_2_3.dtd">
>
><web-app>
>
>  <servlet>
>    <servlet-name>MyFirstServlet</servlet-name>
>   
><servlet-class>com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet</servlet-class>
>  </servlet>
>
>  <servlet-mapping>
>    <servlet-name>MyFirstServlet</servlet-name>
>    <url-pattern>
>      /MyFirstServlet
>    </url-pattern>
>  </servlet-mapping>
>
></web-app>
>
>I placed the web.xml in
>c:\jakarta-tomcat-4.1.31\webapps\ch03\WEB-INF
>directory.
>
>How about the server.xml file in
>c:\jakarta-tomcat-4.1.31\conf directory? The original
>file looks like this:
>
>.
>.
>.
><!-- Tomcat Examples Context -->
>        <Context path="/examples" docBase="examples"
>debug="0"
>                 reloadable="true"
>crossContext="true">
>          <Logger
>className="org.apache.catalina.logger.FileLogger"
>                     prefix="localhost_examples_log."
>suffix=".txt"
>        	  timestamp="true"/>
>          <Ejb   name="ejb/EmplRecord" type="Entity"
>                
>home="com.wombat.empl.EmployeeRecordHome"
>              
>remote="com.wombat.empl.EmployeeRecord"/>
>.
>.
>.
>
>Should I replace <Context path="/examples" to <Context
>path="ch03" and docBase="examples" to
>docBase="myfirstwebapp" (the war file for
>myfirstwebapp in the
>c:\jakarta-tomcat-4.1.31\webapps\ch03 directory)?
>Thanks.
>
>TEH  
>
>--- Prasad <li...@gmail.com> wrote:
>
>  
>
>>Can you post your web.xml. I think I can help you
>>with this but only 
>>after looking at your web.xml.
>>I think the problem is with <servlet> and
>><servlet-mapping> in your 
>>web.xml. Moreover as David said, you can find all
>>the information in the 
>>Docs.
>>-Prasad.
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail:
>>users-help@tomcat.apache.org
>>
>>
>>    
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by Teh Noranis Mohd Aris <te...@yahoo.com>.
The web.xml looks like this:

<?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/j2ee/dtds/web-app_2_3.dtd">

<web-app>

  <servlet>
    <servlet-name>MyFirstServlet</servlet-name>
   
<servlet-class>com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>MyFirstServlet</servlet-name>
    <url-pattern>
      /MyFirstServlet
    </url-pattern>
  </servlet-mapping>

</web-app>

I placed the web.xml in
c:\jakarta-tomcat-4.1.31\webapps\ch03\WEB-INF
directory.

How about the server.xml file in
c:\jakarta-tomcat-4.1.31\conf directory? The original
file looks like this:

.
.
.
<!-- Tomcat Examples Context -->
        <Context path="/examples" docBase="examples"
debug="0"
                 reloadable="true"
crossContext="true">
          <Logger
className="org.apache.catalina.logger.FileLogger"
                     prefix="localhost_examples_log."
suffix=".txt"
        	  timestamp="true"/>
          <Ejb   name="ejb/EmplRecord" type="Entity"
                
home="com.wombat.empl.EmployeeRecordHome"
              
remote="com.wombat.empl.EmployeeRecord"/>
.
.
.

Should I replace <Context path="/examples" to <Context
path="ch03" and docBase="examples" to
docBase="myfirstwebapp" (the war file for
myfirstwebapp in the
c:\jakarta-tomcat-4.1.31\webapps\ch03 directory)?
Thanks.

TEH  

--- Prasad <li...@gmail.com> wrote:

> Can you post your web.xml. I think I can help you
> with this but only 
> after looking at your web.xml.
> I think the problem is with <servlet> and
> <servlet-mapping> in your 
> web.xml. Moreover as David said, you can find all
> the information in the 
> Docs.
> -Prasad.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by Prasad <li...@gmail.com>.
Can you post your web.xml. I think I can help you with this but only 
after looking at your web.xml.
I think the problem is with <servlet> and <servlet-mapping> in your 
web.xml. Moreover as David said, you can find all the information in the 
Docs.
-Prasad.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by David Smith <dn...@cornell.edu>.
Don't use the classpath if you can possibly avoid it.  Tomcat has a 
classloader scheme to handle this stuff for you.  The good old days of 
messing with the classpath weren't so good (early tomcat 3 releases). :-)

This website might help you get things together:
http://tomcat.apache.org/tomcat-4.1-doc/appdev/index.html

Here's a page that describes the <Context> element you need to write 
into server.xml:
http://tomcat.apache.org/tomcat-4.1-doc/config/context.html

In general, the docs on the tomcat site are fairly complete and should 
be used along with your book.

--David

Teh Noranis Mohd Aris wrote:

>Hi,
>I'm using Windows XP operating system, I've already
>set the servlet.jar file to the CLASSPATH. I'm using
>Tomcat version 4.1.31. I haven't made the context for
>"myfirstwebapp" in server.xml. How can it be done? The
>explanation in the book I'm using is not that clear.
>Please help. Thank you so much.
>
>Yours Sincerely,
>TEH 
>
>--- marju jalloh <ja...@yahoo.com> wrote:
>
>  
>
>>What is your enviroment,which version are you using.
>>  Have you made context for "myfirstwebapp" in
>>server.xml
>>  
>>  -Marju
>>
>>Teh Noranis Mohd Aris <te...@yahoo.com> wrote:
>> Hi,
>>I'm learning to use packages from a book example to
>>create my own servlet instead of putting the code in
>>the examples webapp. However the following error
>>occurs:
>>
>>HTTP Status 404 -
>>
>>    
>>
>/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
>  
>
>>________________________________________
>>type Status report
>>message
>>
>>    
>>
>/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
>  
>
>>description The requested resource
>>
>>    
>>
>(/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet)
>  
>
>>is not available.
>>________________________________________
>>Apache Tomcat/4.1.31
>>
>>How can I fix the error? I'm sure that the servlet
>>is
>>in the correct directory and I've put the web.xml in
>>the WEB-INF directory. Did I miss anything? Please
>>help. Thanks.
>>
>>Yours Sincerely,
>>TEH
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam
>>protection around 
>>http://mail.yahoo.com 
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail:
>>users-help@tomcat.apache.org
>>
>>
>>
>>
>>__________________________________________________
>>Do You Yahoo!?
>>Tired of spam?  Yahoo! Mail has the best spam
>>protection around 
>>http://mail.yahoo.com 
>>    
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by Teh Noranis Mohd Aris <te...@yahoo.com>.
Hi,
I'm using Windows XP operating system, I've already
set the servlet.jar file to the CLASSPATH. I'm using
Tomcat version 4.1.31. I haven't made the context for
"myfirstwebapp" in server.xml. How can it be done? The
explanation in the book I'm using is not that clear.
Please help. Thank you so much.

Yours Sincerely,
TEH 

--- marju jalloh <ja...@yahoo.com> wrote:

> What is your enviroment,which version are you using.
>   Have you made context for "myfirstwebapp" in
> server.xml
>   
>   -Marju
> 
> Teh Noranis Mohd Aris <te...@yahoo.com> wrote:
>  Hi,
> I'm learning to use packages from a book example to
> create my own servlet instead of putting the code in
> the examples webapp. However the following error
> occurs:
> 
> HTTP Status 404 -
>
/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
> ________________________________________
> type Status report
> message
>
/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
> description The requested resource
>
(/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet)
> is not available.
> ________________________________________
> Apache Tomcat/4.1.31
> 
> How can I fix the error? I'm sure that the servlet
> is
> in the correct directory and I've put the web.xml in
> the WEB-INF directory. Did I miss anything? Please
> help. Thanks.
> 
> Yours Sincerely,
> TEH
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:
> users-help@tomcat.apache.org
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Please Help! Error in using Packages

Posted by marju jalloh <ja...@yahoo.com>.
What is your enviroment,which version are you using.
  Have you made context for "myfirstwebapp" in server.xml
  
  -Marju

Teh Noranis Mohd Aris <te...@yahoo.com> wrote:  Hi,
I'm learning to use packages from a book example to
create my own servlet instead of putting the code in
the examples webapp. However the following error
occurs:

HTTP Status 404 -
/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
________________________________________
type Status report
message
/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet
description The requested resource
(/ch03/servlet/com.wrox.projsp.ch03.myfirstwebapp.MyFirstServlet)
is not available.
________________________________________
Apache Tomcat/4.1.31

How can I fix the error? I'm sure that the servlet is
in the correct directory and I've put the web.xml in
the WEB-INF directory. Did I miss anything? Please
help. Thanks.

Yours Sincerely,
TEH

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com