Re: Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-11 Thread Pid
On 11/06/2010 05:21, Vitalstatistix wrote:
 
 Yeh that was just a dodgy hack to get around my initial errors when using
 javac. I found out later the reason why javac wasn't working on my servlet
 class was because servlet-api.jar wasn't on the classpath,
 after adding that I was able to compile it the normal way. Also the solution
 is NOT to put it in the WEB-INF folder, you need to have your .class file in
 the build/classes/Yourpackage folder. 

It'll eventually need to end up in

 WEB-INF/classes/my/package.AServlet.class

or, inside a jar, e.g.

 WEB-INF/lib/myservlets.jar

or you won't be able to deploy the web app...


p

 Pid * wrote:

 On 10/06/2010 03:20, Vitalstatistix wrote:


 SOLVED:

 There was no HelloServlet.class file so I had to put an empty main method
 into the HelloServlet.java class and run it to generate the
 HelloServlet.class file, then I placed the class file in the WEB-INF
 folder
 and it all worked fine.

 Er, what?

 1. There's no need for an empty main method.
 2. We usually just compile a .java file to get a .class


 p

 Vitalstatistix wrote:

 Hey, I've just been working on this tutorial here:

 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

 It has been pretty good and I've got the jsp page to show the time but
 when I try going to the 
 HelloServlet I get the error 500.

 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

 Error Report
 type Exception report

 message 

 description The server encountered an internal error () that prevented
 it
 from fulfilling this request.

 exception 

 javax.servlet.ServletException: Wrapper cannot find servlet class
 com.example.servlets.HelloServlet or a class it depends on

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)


 root cause 

 java.lang.ClassNotFoundException: com.example.servlets.HelloServlet

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)


 web.xml file generated in my Eclipse web project

 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
 version=2.5
   display-nameFirstWebProject/display-name
   welcome-file-list
 welcome-fileindex.html/welcome-file
 welcome-fileindex.htm/welcome-file
 welcome-fileindex.jsp/welcome-file
 welcome-filedefault.html/welcome-file
 welcome-filedefault.htm/welcome-file
 welcome-filedefault.jsp/welcome-file
   /welcome-file-list
   servlet
 description/description
 display-nameHelloServlet/display-name
 servlet-nameHelloServlet/servlet-name
 servlet-classcom.example.servlets.HelloServlet/servlet-class
   /servlet
   servlet-mapping
 servlet-nameHelloServlet/servlet-name
 url-pattern/HelloServlet/url-pattern
   /servlet-mapping
 /web-app


 Sorry I don't know how to add code tags in this forum. I'm using Tomcat
 6.
 I've
 made no changes to ANY web.xml files, I simply followed that short basic
 tutorial step by step. My HelloServlet.java class is exactly the same as
 in the tutorial and is in the same package. 
 Could you please tell me why it can't seem to find the class?

 Thanks heaps,

 :)














  

 




signature.asc
Description: OpenPGP digital signature


Re: Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-10 Thread Pid
On 10/06/2010 03:20, Vitalstatistix wrote:
 
 
 SOLVED:
 
 There was no HelloServlet.class file so I had to put an empty main method
 into the HelloServlet.java class and run it to generate the
 HelloServlet.class file, then I placed the class file in the WEB-INF folder
 and it all worked fine.

Er, what?

1. There's no need for an empty main method.
2. We usually just compile a .java file to get a .class


p

 Vitalstatistix wrote:

 Hey, I've just been working on this tutorial here:

 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

 It has been pretty good and I've got the jsp page to show the time but
 when I try going to the 
 HelloServlet I get the error 500.

 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

 Error Report
 type Exception report

 message 

 description The server encountered an internal error () that prevented it
 from fulfilling this request.

 exception 

 javax.servlet.ServletException: Wrapper cannot find servlet class
 com.example.servlets.HelloServlet or a class it depends on

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  java.lang.Thread.run(Unknown Source)


 root cause 

 java.lang.ClassNotFoundException: com.example.servlets.HelloServlet

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  java.lang.Thread.run(Unknown Source)


 web.xml file generated in my Eclipse web project

 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
 version=2.5
   display-nameFirstWebProject/display-name
   welcome-file-list
 welcome-fileindex.html/welcome-file
 welcome-fileindex.htm/welcome-file
 welcome-fileindex.jsp/welcome-file
 welcome-filedefault.html/welcome-file
 welcome-filedefault.htm/welcome-file
 welcome-filedefault.jsp/welcome-file
   /welcome-file-list
   servlet
 description/description
 display-nameHelloServlet/display-name
 servlet-nameHelloServlet/servlet-name
 servlet-classcom.example.servlets.HelloServlet/servlet-class
   /servlet
   servlet-mapping
 servlet-nameHelloServlet/servlet-name
 url-pattern/HelloServlet/url-pattern
   /servlet-mapping
 /web-app


 Sorry I don't know how to add code tags in this forum. I'm using Tomcat 6.
 I've
 made no changes to ANY web.xml files, I simply followed that short basic
 tutorial step by step. My HelloServlet.java class is exactly the same as
 in the tutorial and is in the same package. 
 Could you please tell me why it can't seem to find the class?

 Thanks heaps,

 :)










 




signature.asc
Description: OpenPGP digital signature


Re: Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-10 Thread Vitalstatistix

Yeh that was just a dodgy hack to get around my initial errors when using
javac. I found out later the reason why javac wasn't working on my servlet
class was because servlet-api.jar wasn't on the classpath,
after adding that I was able to compile it the normal way. Also the solution
is NOT to put it in the WEB-INF folder, you need to have your .class file in
the build/classes/Yourpackage folder. 





Pid * wrote:
 
 On 10/06/2010 03:20, Vitalstatistix wrote:
 
 
 SOLVED:
 
 There was no HelloServlet.class file so I had to put an empty main method
 into the HelloServlet.java class and run it to generate the
 HelloServlet.class file, then I placed the class file in the WEB-INF
 folder
 and it all worked fine.
 
 Er, what?
 
 1. There's no need for an empty main method.
 2. We usually just compile a .java file to get a .class
 
 
 p
 
 Vitalstatistix wrote:

 Hey, I've just been working on this tutorial here:

 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

 It has been pretty good and I've got the jsp page to show the time but
 when I try going to the 
 HelloServlet I get the error 500.

 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

 Error Report
 type Exception report

 message 

 description The server encountered an internal error () that prevented
 it
 from fulfilling this request.

 exception 

 javax.servlet.ServletException: Wrapper cannot find servlet class
 com.example.servlets.HelloServlet or a class it depends on

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 java.lang.Thread.run(Unknown Source)


 root cause 

 java.lang.ClassNotFoundException: com.example.servlets.HelloServlet

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)

 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 java.lang.Thread.run(Unknown Source)


 web.xml file generated in my Eclipse web project

 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
 version=2.5
   display-nameFirstWebProject/display-name
   welcome-file-list
 welcome-fileindex.html/welcome-file
 welcome-fileindex.htm/welcome-file
 welcome-fileindex.jsp/welcome-file
 welcome-filedefault.html/welcome-file
 welcome-filedefault.htm/welcome-file
 welcome-filedefault.jsp/welcome-file
   /welcome-file-list
   servlet
 description/description
 display-nameHelloServlet/display-name
 servlet-nameHelloServlet/servlet-name
 servlet-classcom.example.servlets.HelloServlet/servlet-class
   /servlet
   servlet-mapping
 servlet-nameHelloServlet/servlet-name
 url-pattern/HelloServlet/url-pattern
   /servlet-mapping
 /web-app


 Sorry I don't know how to add code tags in this forum. I'm using Tomcat
 6.
 I've
 made no changes to ANY web.xml files, I simply followed that short basic
 tutorial step by step. My HelloServlet.java class is exactly the same as
 in the tutorial and is in the same package. 
 Could you please tell me why it can't seem to find the class?

 Thanks heaps,

 :)










 
 
 
 
  
 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-in-Eclipse-Error-500-java.lang.ClassNotFoundException-tp28830890p28851220.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-09 Thread Vitalstatistix

Hey, I've just been working on this tutorial here:

http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

It has been pretty good and I've got the jsp page to show the time but when
I try going to the 
HelloServlet I get the error 500.

http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html

Error Report
type Exception report

message 

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception 

javax.servlet.ServletException: Wrapper cannot find servlet class
com.example.servlets.HelloServlet or a class it depends on

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)


root cause 

java.lang.ClassNotFoundException: com.example.servlets.HelloServlet

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)


web.xml file generated in my Eclipse web project

?xml version=1.0 encoding=UTF-8?
web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
version=2.5
  display-nameFirstWebProject/display-name
  welcome-file-list
welcome-fileindex.html/welcome-file
welcome-fileindex.htm/welcome-file
welcome-fileindex.jsp/welcome-file
welcome-filedefault.html/welcome-file
welcome-filedefault.htm/welcome-file
welcome-filedefault.jsp/welcome-file
  /welcome-file-list
  servlet
description/description
display-nameHelloServlet/display-name
servlet-nameHelloServlet/servlet-name
servlet-classcom.example.servlets.HelloServlet/servlet-class
  /servlet
  servlet-mapping
servlet-nameHelloServlet/servlet-name
url-pattern/HelloServlet/url-pattern
  /servlet-mapping
/web-app


Sorry I don't know how to add code tags in this forum. I'm using Tomcat 6.
I've
made no changes to ANY web.xml files, I simply followed that short basic
tutorial step by step. My HelloServlet.java class is exactly the same as in
the tutorial and is in the same package. 
Could you please tell me why it can't seem to find the class?

Thanks heaps,

:)









-- 
View this message in context: 
http://old.nabble.com/Tomcat-in-Eclipse-Error-500-java.lang.ClassNotFoundException-tp28830890p28830890.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 6/9/2010 10:07 AM, Vitalstatistix wrote:
 Hey, I've just been working on this tutorial here:
 
 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html
 
 It has been pretty good and I've got the jsp page to show the time but when
 I try going to the HelloServlet I get the error 500.

 [...]

 javax.servlet.ServletException: Wrapper cannot find servlet class
 com.example.servlets.HelloServlet or a class it depends on

Looks like Tomcat can't find your servlet class.

 root cause 
 
 java.lang.ClassNotFoundException: com.example.servlets.HelloServlet

Okay, so you've gotten to the Hello World Servlet section? Do you have
this line of code at the very top of the file:

package com.example.servlets

?

Check the exact spelling: it's important.

   servlet
 description/description
 display-nameHelloServlet/display-name
 servlet-nameHelloServlet/servlet-name
 servlet-classcom.example.servlets.HelloServlet/servlet-class
   /servlet

This definition looks correct.

   servlet-mapping
 servlet-nameHelloServlet/servlet-name
 url-pattern/HelloServlet/url-pattern
   /servlet-mapping

This mapping is correct. You are visiting
http://yoursite/example/HelloServlet and getting 500, then?

 Sorry I don't know how to add code tags in this forum. I'm using Tomcat 6.
 I've
 made no changes to ANY web.xml files, I simply followed that short basic
 tutorial step by step. My HelloServlet.java class is exactly the same as in
 the tutorial and is in the same package. 
 Could you please tell me why it can't seem to find the class?

I'm not sure where Eclipse puts all its files, but if you could
track-down the location of the deployment directory (often something
like /foo/bar/tomcat-x.y.z/webapps/example) and give us a file listing
including subdirectories and files in those subdirectories, we might be
able to help.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwP36kACgkQ9CaO5/Lv0PBEYwCgr9l/3RYBkklIl37ELPpMlajY
UeYAoIui29MNCiWWu+vh/WbuTsgWqN8Y
=suF/
-END PGP SIGNATURE-

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



Re: Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-09 Thread Vitalstatistix

Hey thanks 4 the response,

Yes, I do have:

 package com.example.servlets;

At the top of my HelloServlet.java file.

So still stuck :(






Vitalstatistix wrote:
 
 Hey, I've just been working on this tutorial here:
 
 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html
 
 It has been pretty good and I've got the jsp page to show the time but
 when I try going to the 
 HelloServlet I get the error 500.
 
 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html
 
 Error Report
 type Exception report
 
 message 
 
 description The server encountered an internal error () that prevented it
 from fulfilling this request.
 
 exception 
 
 javax.servlet.ServletException: Wrapper cannot find servlet class
 com.example.servlets.HelloServlet or a class it depends on
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Unknown Source)
 
 
 root cause 
 
 java.lang.ClassNotFoundException: com.example.servlets.HelloServlet
 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Unknown Source)
 
 
 web.xml file generated in my Eclipse web project
 
 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
 version=2.5
   display-nameFirstWebProject/display-name
   welcome-file-list
 welcome-fileindex.html/welcome-file
 welcome-fileindex.htm/welcome-file
 welcome-fileindex.jsp/welcome-file
 welcome-filedefault.html/welcome-file
 welcome-filedefault.htm/welcome-file
 welcome-filedefault.jsp/welcome-file
   /welcome-file-list
   servlet
 description/description
 display-nameHelloServlet/display-name
 servlet-nameHelloServlet/servlet-name
 servlet-classcom.example.servlets.HelloServlet/servlet-class
   /servlet
   servlet-mapping
 servlet-nameHelloServlet/servlet-name
 url-pattern/HelloServlet/url-pattern
   /servlet-mapping
 /web-app
 
 
 Sorry I don't know how to add code tags in this forum. I'm using Tomcat 6.
 I've
 made no changes to ANY web.xml files, I simply followed that short basic
 tutorial step by step. My HelloServlet.java class is exactly the same as
 in the tutorial and is in the same package. 
 Could you please tell me why it can't seem to find the class?
 
 Thanks heaps,
 
 :)
 
 
 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-in-Eclipse-Error-500-java.lang.ClassNotFoundException-tp28830890p28837645.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-09 Thread Caldarale, Charles R
 From: Vitalstatistix [mailto:frozen_monke...@hotmail.com]
 Subject: Re: Tomcat in Eclipse Error 500
 java.lang.ClassNotFoundException
 
 Yes, I do have:
  package com.example.servlets;
 At the top of my HelloServlet.java file.

And where exactly is the .class file located?

What happens if you run Tomcat directly, not under Eclipse?

 - 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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat in Eclipse Error 500 java.lang.ClassNotFoundException

2010-06-09 Thread Vitalstatistix


SOLVED:

There was no HelloServlet.class file so I had to put an empty main method
into the HelloServlet.java class and run it to generate the
HelloServlet.class file, then I placed the class file in the WEB-INF folder
and it all worked fine.

Thanks






Vitalstatistix wrote:
 
 Hey, I've just been working on this tutorial here:
 
 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html
 
 It has been pretty good and I've got the jsp page to show the time but
 when I try going to the 
 HelloServlet I get the error 500.
 
 http://www.ibm.com/developerworks/opensource/library/os-eclipse-tomcat/index.html
 
 Error Report
 type Exception report
 
 message 
 
 description The server encountered an internal error () that prevented it
 from fulfilling this request.
 
 exception 
 
 javax.servlet.ServletException: Wrapper cannot find servlet class
 com.example.servlets.HelloServlet or a class it depends on
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Unknown Source)
 
 
 root cause 
 
 java.lang.ClassNotFoundException: com.example.servlets.HelloServlet
 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   java.lang.Thread.run(Unknown Source)
 
 
 web.xml file generated in my Eclipse web project
 
 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID
 version=2.5
   display-nameFirstWebProject/display-name
   welcome-file-list
 welcome-fileindex.html/welcome-file
 welcome-fileindex.htm/welcome-file
 welcome-fileindex.jsp/welcome-file
 welcome-filedefault.html/welcome-file
 welcome-filedefault.htm/welcome-file
 welcome-filedefault.jsp/welcome-file
   /welcome-file-list
   servlet
 description/description
 display-nameHelloServlet/display-name
 servlet-nameHelloServlet/servlet-name
 servlet-classcom.example.servlets.HelloServlet/servlet-class
   /servlet
   servlet-mapping
 servlet-nameHelloServlet/servlet-name
 url-pattern/HelloServlet/url-pattern
   /servlet-mapping
 /web-app
 
 
 Sorry I don't know how to add code tags in this forum. I'm using Tomcat 6.
 I've
 made no changes to ANY web.xml files, I simply followed that short basic
 tutorial step by step. My HelloServlet.java class is exactly the same as
 in the tutorial and is in the same package. 
 Could you please tell me why it can't seem to find the class?
 
 Thanks heaps,
 
 :)
 
 
 
 
 
 
 
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-in-Eclipse-Error-500-java.lang.ClassNotFoundException-tp28830890p28838037.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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