servlet mapping in Web.xml on Tomcat 5.5.7
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   kalyan_konduri
Posted On:   Tuesday, March 15, 2005 04:00 AM

Hi all, I am new to Tomcat 5.5.7. I have a small web application which will have JSPs, HTMLs, Servlets. I have created a directory structure in webapps for my application as Webapps /IMS(IMS is the name of my application)--here i put jsps and html files of my application -->/WEB-INF-- here i put web.xml and two folders -->/Classes-- here i put classes(servlets) for my application which will have some connection to mysql -->/lib--iput jar file for mysql connectivity The issue now is when i tried to connect to server using http://localhost:8080/IMS, the default home page is appeared but after i tried to post the data from index.html to   More>>


Hi all,

I am new to Tomcat 5.5.7. I have a small web application which will have JSPs, HTMLs, Servlets.



I have created a directory structure in webapps for my application as

Webapps
/IMS(IMS is the name of my application)--here i put jsps and html files of my application
-->/WEB-INF-- here i put web.xml and two folders
-->/Classes-- here i put classes(servlets) for my application which will have some connection to mysql
-->/lib--iput jar file for mysql connectivity




The issue now is when i tried to connect to server using
http://localhost:8080/IMS, the default home page is appeared but after i tried to post the data from index.html to the servlet ValidateUser...it is throwing an error





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 ValidateUser or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)



root cause

java.lang.ClassNotFoundException: ValidateUser
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)



I have put the servlet mapping even in web.xml.

Can any one help me out in this? I didnt change any of the other files on the server.



Thanks in Advance
Kalyan

   <<Less

Re: servlet mapping in Web.xml on Tomcat 5.5.7

Posted By:   Rajesh_Kodali  
Posted On:   Wednesday, March 23, 2005 04:33 AM

Enter the following in web.xml




ValidateUser

ValidateUser





ValidateUser

/ValidateUser






And also in index.html u have to specify

and method=get (or) post depends on how u handle it in ValidateUser

and be sure that ValidateUser is compiled and its class file is placed in classes folder

Re: servlet mapping in Web.xml on Tomcat 5.5.7

Posted By:   Anonymous  
Posted On:   Monday, March 21, 2005 09:31 PM

Hi Kalyan,

I think the problem can be either with the way you have mapped the servelet in the web.xml file or the way you have called the servlet when you sumit the form in the home page

Re: servlet mapping in Web.xml on Tomcat 5.5.7

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, March 17, 2005 08:37 AM

Make sure your servlet is in an explicitly named package, or else it gets stuck in the "default" package which has a name chosen by the server, and you would need to know that package name to refer to it (for Tomcat, probably "org.apache.somestuff...").

Re: servlet mapping in Web.xml on Tomcat 5.5.7

Posted By:   Anonymous  
Posted On:   Tuesday, March 15, 2005 11:09 AM

I guess the problem is with your classpath. Check if you have a proper classpath set in the environment.
About | Sitemap | Contact