Wrapper cannot find servlet class error
Hi all!
I'm receiving a mysterious error when I try to run my web ap. "Wrapper cannot find servlet class com.ruffalocody.report.ReportServlet or a class it depends on"
I'm running it on JBoss 3.2.7, and I have another web ap, made almost identical to this one which does not display the same error/exception.
If anyone could give me advice on what I should do to fix this, I'd very much appreciate it. :)
Full exception message:
javax.servlet.ServletException: Wrapper cannot find servlet class com.ruffalocody.report.ReportServlet or a class it depends on
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:162)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:534)
root cause
java.lang.ClassNotFoundException: com.ruffalocody.report.ReportServlet
java.net.URLClassLoader$1.run(URLClassLoader.java:199)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
java.lang.ClassLoader.loadClass(ClassLoader.java:289)
java.lang.ClassLoader.loadClass(ClassLoader.java:235)
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:162)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:534)the servlet class file ReportServlet.class is located in:
WEB-INF\classes\com\ruffalocody\report
web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>RprtSrvlt</servlet-name>
<servlet-class>com.ruffalocody.report.ReportServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RprtSrvlt</servlet-name>
<url-pattern>/reports</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<!-- Context Param -->
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>crystalreportviewers10</param-value>
</context-param>
<!-- Context Param End -->
</web-app>It's called from the index.jsp page w/ ulr: "reports?goTo=view"
Servlet code (not sure if it's useful, but including just in case):
* ReportServlet.java
* Created on February 1, 2007, 11:04 AM
package com.ruffalocody.report;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.crystaldecisions.reports.reportengineinterface.JPEReportSourceFactory;
import com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2;
import com.crystaldecisions.sdk.occa.report.reportsource.IReportSource;
import com.crystaldecisions.report.web.viewer.CrystalReportViewer;
import com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase;
* @author aerohner
* @version
public class ReportServlet extends HttpServlet
String rptLoc = "CR10_JRC_BeginHere.rpt";
/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
response.setContentType("text/html;charset=UTF-8");
String goTo = request.getParameter("goTo");
if(goTo != null && goTo.equals("view"))
viewReport(request, response);
}// end goTo view
else if(goTo != null && goTo.equals("export"))
exportReport(request, response);
}// end go to export
else
RequestDispatcher view = request.getRequestDispatcher("index.jsp");
view.forward(request,response);
private void viewReport(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
IReportSource rptSrc = setUpReportSource(request);
if (rptSrc != null)
// create viewer
CrystalReportViewer viewer = new CrystalReportViewer();
try
viewer.setReportSource(rptSrc);
forward(request, response, viewer);
catch(ReportSDKExceptionBase e)
e.printStackTrace();
}// if rptsrc not null
else
log("rptSrc is null");
}// end else not null
}// end viewReport(.)
private void exportReport(HttpServletRequest request, HttpServletResponse response)
}// end exportReport(.)
private IReportSource setUpReportSource(HttpServletRequest request)
IReportSourceFactory2 rptFact = new JPEReportSourceFactory();
IReportSource rptSrc = null;
try
rptSrc = (IReportSource)
rptFact.createReportSource(rptLoc, request.getLocale());
}// end try
catch (Exception e)
return rptSrc;
}// end setUpReportSource()
private void forward(HttpServletRequest request,
HttpServletResponse response, Object viewer)
throws ServletException, IOException
request.setAttribute("viewer", viewer);
RequestDispatcher view = request.getRequestDispatcher("viewer.jsp");
view.forward(request,response);
}// end forward(...)
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
processRequest(request, response);
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
processRequest(request, response);
/** Returns a short description of the servlet.
public String getServletInfo()
return "Short description";
// </editor-fold>
}Thanks :)
I'm curious. Could you strip off the "java." part of the package, so both in your sourcefile as in the directory structure? It may be that the java package is not allowed, but then I wouldn't know why you didn't get a compile error...
Similar Messages
-
Wrapper cannot find servlet class
Hi all
Can anyone please help me to resolve this error. It come about since I've provided the package (pa_sodev.pr_add_user_diary_event). My Java file is in Java Resources:src folder .
I don't have a folder called classes in my WEB_INF directory.
Many thanks
Zed
exception
javax.servlet.ServletException: Wrapper cannot find servlet class addEveProcess 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: addEveProcess
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
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)Edited by: Zed420 on Jan 31, 2010 6:09 PMThanks for your reply, can I ask if my setup is correct ?
I'm using Eclipse, on my left in Dynamic Web Perspective I have Servers and myProject.
In myProject ->Java Resources:src (this is where all my java files are with package) and WebContent.
In WebContent ->META-INF and WEB-INF
In WEB-INF ->(this is where I have lib folder and my xml & jsp files)
In lib I have Oracle connector .jar
Can someone confirm if this is the right setup please.
thanks
Zed -
Cannot Find Servlet class Error
Hello Everybody,
i have written a simple servlet and compiled it using j2sdk1.4 version and jsdk.jar.But when i try to load the servlet on the javawebserver2.0 it says it is unable to find servlet class though i have put the class file in the servlets directory.i even put the class in the classes directory.It works fine when i compile the same class using j2sdk1.3 version and jsdk.jar.
Please guide me as to what should be done to overcome this problem.
Thanks in Advance
Manikantan IyerHi mani2k_in ,
JavaWebserver2.0 --> This web server, by default uses JDK 1.1.8.
If you have compiled your classes using heigher versions, Webserver won't be able to find those classes which were added after JDK1.1.8.
That was the first problem regarding the J2sdk versions you have used.
You can override the default JVM usage of JavaWebServer2.0
Second the servlet problem.
Your environment should able to lookup the classes dyanmically jsdk.jar or servlet.jar.
If you are able to compile the servlet successfully, place it in servlets directory and access the servlet from a browser using the url http://servername:portnumber/servlet/Servletclass
Although you have placed your class file in servlets directory, you should access by using servlet in the URL.
If it doesn't solve your problem, please come back with more details.
Thanks,
Sanath Kumar -
I have a new computer and I have installed the latest version of Tomcat but kept the old free version of the Sun One Studio which I still had a setup file for (as I couldn't find it on this site anywhere for free anymore). The new version of Tomcat puts my webapps in a different area now being s1studio\tomcat401\webapps but there is another area for the server: C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\tomcat-docs. I use the first directory and that shows my jsp's etc but it doesn't find my servlets.
My problem I am having is that my log file is showing this:
2005-10-24 10:27:48 StandardHost[localhost]: Removing web application at context path /webdav
2005-10-24 10:27:52 StandardHost[localhost]: Removing web application at context path /examples
2005-10-24 10:27:52 StandardHost[localhost]: Removing web application at context path /tomcat-docs
2005-10-24 10:27:52 StandardHost[localhost]: Removing web application at context path
2005-10-24 10:27:52 StandardHost[localhost]: Removing web application at context path /manager
2005-10-24 10:28:11 WebappLoader[manager]: Deploying class repositories to work directory C:\Program Files\s1studio_jdk\s1studio\tomcat401\work\localhost\manager
2005-10-24 10:28:11 StandardManager[manager]: Seeding random number generator class java.security.SecureRandom
2005-10-24 10:28:11 StandardManager[manager]: Seeding of random number generator has been completed
2005-10-24 10:28:11 ContextConfig[manager]: Added certificates -> request attribute Valve
2005-10-24 10:28:11 ContextConfig[manager]: Configured an authenticator for method BASIC
2005-10-24 10:28:11 StandardWrapper[manager:default]: Loading container servlet default
2005-10-24 10:28:11 default: init
2005-10-24 10:28:11 StandardWrapper[manager:invoker]: Loading container servlet invoker
2005-10-24 10:28:11 invoker: init
2005-10-24 10:28:11 jsp: init
2005-10-24 10:28:11 StandardHost[localhost]: Installing web application at context path from URL file:C:\Program Files\s1studio_jdk\s1studio\tomcat401\webapps\ROOT
2005-10-24 10:28:11 WebappLoader[]: Deploying class repositories to work directory C:\Program Files\s1studio_jdk\s1studio\tomcat401\work\localhost\_
2005-10-24 10:28:11 StandardManager[]: Seeding random number generator class java.security.SecureRandom
2005-10-24 10:28:11 StandardManager[]: Seeding of random number generator has been completed
2005-10-24 10:28:11 ContextConfig[]: Added certificates -> request attribute Valve
2005-10-24 10:28:11 StandardWrapper[:default]: Loading container servlet default
2005-10-24 10:28:11 default: init
2005-10-24 10:28:11 StandardWrapper[:invoker]: Loading container servlet invoker
2005-10-24 10:28:11 invoker: init
2005-10-24 10:28:11 jsp: init
2005-10-24 10:28:11 StandardHost[localhost]: Installing web application at context path /tomcat-docs from URL file:C:\Program Files\s1studio_jdk\s1studio\tomcat401\webapps\tomcat-docs
2005-10-24 10:28:11 WebappLoader[tomcat-docs]: Deploying class repositories to work directory C:\Program Files\s1studio_jdk\s1studio\tomcat401\work\localhost\tomcat-docs
2005-10-24 10:28:11 StandardManager[tomcat-docs]: Seeding random number generator class java.security.SecureRandom
2005-10-24 10:28:11 StandardManager[tomcat-docs]: Seeding of random number generator has been completed
2005-10-24 10:28:12 ContextConfig[tomcat-docs]: Added certificates -> request attribute Valve
2005-10-24 10:28:12 StandardWrapper[tomcat-docs:default]: Loading container servlet default
2005-10-24 10:28:12 default: init
2005-10-24 10:28:12 StandardWrapper[tomcat-docs:invoker]: Loading container servlet invoker
2005-10-24 10:28:12 invoker: init
2005-10-24 10:28:12 jsp: init
2005-10-24 10:28:12 StandardHost[localhost]: Installing web application at context path /webdav from URL file:C:\Program Files\s1studio_jdk\s1studio\tomcat401\webapps\webdav
2005-10-24 10:28:12 WebappLoader[webdav]: Deploying class repositories to work directory C:\Program Files\s1studio_jdk\s1studio\tomcat401\work\localhost\webdav
2005-10-24 10:28:12 StandardManager[webdav]: Seeding random number generator class java.security.SecureRandom
2005-10-24 10:28:12 StandardManager[webdav]: Seeding of random number generator has been completed
2005-10-24 10:28:12 ContextConfig[webdav]: Added certificates -> request attribute Valve
2005-10-24 10:28:12 StandardWrapper[webdav:default]: Loading container servlet default
2005-10-24 10:28:12 default: init
2005-10-24 10:28:12 StandardWrapper[webdav:invoker]: Loading container servlet invoker
2005-10-24 10:28:12 invoker: init
2005-10-24 10:28:12 jsp: init
2005-10-24 10:29:55 StandardWrapper[:org.apache.catalina.INVOKER.CourseList]: Marking servlet org.apache.catalina.INVOKER.CourseList as unavailable
2005-10-24 10:29:55 invoker: Cannot allocate servlet instance for path /servlet/CourseList
javax.servlet.ServletException: Wrapper cannot find servlet class CourseList or a class it depends on
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:807)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:396)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
----- Root Cause -----
java.lang.ClassNotFoundException: CourseList
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1156)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:801)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:396)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
2005-10-24 10:54:35 StandardWrapper[:org.apache.catalina.INVOKER.CourseList]: Marking servlet org.apache.catalina.INVOKER.CourseList as unavailable
2005-10-24 10:54:35 invoker: Cannot allocate servlet instance for path /servlet/CourseList
javax.servlet.ServletException: Wrapper cannot find servlet class CourseList or a class it depends on
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:807)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:396)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
at java.lang.Thread.run(Thread.java:536)
----- Root Cause -----
and so it goes on.
My classes are in the directory as:
C:\Program Files\s1studio_jdk\s1studio\tomcat401\webapps\ROOT\servervirtualward\WEB-INF\classes\virtualward\java
and my web.xml is here: C:\Program Files\s1studio_jdk\s1studio\tomcat401\webapps\ROOT\servervirtualward\WEB-INF
and the code for the CourseList servlet is:
<servlet>
<servlet-name>virtualward.java.CourseList</servlet-name>
<servlet-class>virtualward.java.CourseList</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>virtualward.java.CourseList</servlet-name>
<url-pattern>/servlet/CourseList</url-pattern>
</servlet-mapping>The example servlets work fine and all .jsp's work within my project.
Can anyone spot what's wrong?
Thanks!!!I did a basic .jsp page and that worked so at least that's something. Here is my code for the .jsp that won't work. It worked perfectly on my old computer on the configuration with Tomcat4
<%@page import="virtualward.java.Student"%>
<jsp:useBean id="student" class="virtualward.java.Student" scope="session"/>
<%
String error = null; // set the error message to null for the initial visit
//to the page
if (request.getParameter("SUBMITTED") != null)
Student s = Student.findStudent(request.getParameter("userid"));
if (s == null)
error = "Login ID not found, please try again.";
else
//if the input password = the stored password
if (request.getParameter("userpword").equals(s.getPWord()))
//if login priviledges are 1 give them student access
if (s.getPrivilegeLevel()==1)
//store the details of that students details in a session from the object.
session.setAttribute("student", s);
//go to the page to display the details
response.sendRedirect("stuProfile.jsp");
} //if login priviledges are 2 or 3 direct them to a page that
//gives them Lecturer priviledges
else if (s.getPrivilegeLevel()==2 || s.getPrivilegeLevel()==3)
//store the details of that students details in a session from the object.
session.setAttribute("student", s);
//go to the page to display the details
//response.sendRedirect("selectProfile.jsp"); //old link
response.sendRedirect("maintenance/courseIdenti.jsp");
else
error = "Invalid Password";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Student Profile</title>
<link href="VWStyle.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #515151;
-->
</style>
</head>
<body>
<table width="450" height="125" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="8" colspan="3"><img src="images/tit_studentProf.gif" width="200" height="27"></td>
<td height="8"> </td>
</tr>
<tr>
<td width="8" height="8" background="images/corner01.gif"><img src="images/spacer.gif" width="8" height="8"></td>
<td height="8" colspan="2" background="images/top_tbl.gif"><img src="images/spacer.gif" width="8" height="8"></td>
<td width="8" height="8" background="images/corner02.gif"><img src="images/spacer.gif" width="8" height="8"></td>
</tr>
<tr>
<td background="images/left_tble.gif"> </td>
<td width="8" align="left" valign="top" class="bodyText"> </td>
<td align="left" valign="top" class="bodyText"><form method = POST ACTION="profileLogin.jsp">
<Input type="HIDDEN" name="SUBMITTED" VALUE="T">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<% if (error != null){%>
<strong> <FONT COLOR = "#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><%= error %></FONT></strong><br>
<% } %>
<td valign="top" class="bodyText">Login ID:</td>
<td valign="top" class="bodyText">Password:</td>
<td> </td>
</tr>
<tr>
<td width="155" valign="top" class="bodyText"><input name="userid" type="text" width="25">
</td>
<td width="136" valign="top" class="bodyText"><input name="userpword" type="password" size=25>
</td>
<td width="126" align="right" valign="top"><div align="left">
<input name="Submit" type="image" id="Submit" src="images/but_go.gif" alt="Click to login" width="36" height="26" border="0">
</div></td>
</tr>
<tr>
<td colspan="3" valign="top" class="bodyText"><strong>Login to view your profile<br>
</strong><font color="#FF0000" size="1" face="Verdana, Arial, Helvetica, sans-serif">In the case of forgetting your login details, contact your module co-ordinator.</font></td>
</tr>
</table>
</form></td>
<td background="images/right_tbl.gif"> </td>
</tr>
<tr>
<td width="8" height="8" background="images/corner03.gif"><img src="images/spacer.gif" width="8" height="8"></td>
<td height="8" colspan="2" background="images/bot_tbl.gif"><img src="images/spacer.gif" width="8" height="8"></td>
<td width="8" height="8" background="images/corner04.gif"><img src="images/spacer.gif" width="8" height="8"></td>
</tr>
</table>
</body>
</html> -
ServletException: Wrapper cannot find servlet ...
Hi,
I'm trying out a (/the first) piece of code I downloaded from a website of a book (http://books.brainysoftware.com/index.php?show=struts)
I got the following exception:
javax.servlet.ServletException: Wrapper cannot find servlet class app01a.ControllerServlet or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Unknown Source)I placed the directory, and its subsequent directories in my %TOMCAT_HOME%/webapps/ directory. The top level directory, and its children are:
app10a
|-bin
| |-app01a
| | |-Product.class
| | |-ControllerServlet.class
| | |-to
| | |-ProductTO.class
| |-jsp
| | |-displayAddProductForm.jsp
| | |-displaySavedProduct.jspI called this code using the following url:
http://localhost:8080/app01a/Controller?action=displayAddProductForm
As I'm new to this subject I think there is something wrong in my configuration. If you think I'm correct, could you point out what is wrong?
Tia
AbelFound the problem. The directory
app10a
|-bin
| |-app01a
| |-jsp
| |-src
| |-WEB-INF
| |- |-classes
| |- |-app01a (this one)was empty :-( (*oeps*)
Abel -
Cannot find symbol class error
hi there ,
i am creating a min class that links several classes and i am doing the following
public class Main{
public static void main(String[] args){
classOne a = new classOne();
classTwo b = new classTwo();
classThree c = new classThree();
// more classes with the same as above
i am saving all the classes in the same folder , and i am having this error twice with each line that i creat an instance for a class
cannot find symbol
symbol : class classOneare your classes all in the same package? do you in fact use packages?
Your best bet to get help here is by creating a Short, Self Contained, Correct (Compilable), Example or SSCCE. This is a small application that you create that is compilable and runnable, and demonstrates your error, but contains no extraneous, unnecessary code that is not associated with your problem. To see more about this and how to create this, please look at this link:
http://homepage1.nifty.com/algafield/sscce.html
Remember, this code must be compilable and runnable.
Also, if you do post your code, please use code tags so that your code will be well-formatted and readable. To do this, either highlight your code block and press the "code" button at the top above the message block or place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
[code]
// your code block goes here
[/code] -
"cannot find symbol : class Scanner" error message
I have an error message that says:
"cannot find symbol : class Scanner"
I tried typing at the top of the program
import java.util.Scanner;but I still have the same error message.
What should I do ?
Thank you in advancehttp://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
Since:
1.5
look at the javadoc, it says since 1.5 so it's not there in earlier versions.
just a guess -
"cannot find symbol class studentList" error
Hi I get this error
"cannot find symbol class studentList", but this class is at the same file and also it is in the same folder. so what's wrong .. and I checked the spelling it's the same.
I should create an object named myList of type studentList
and second, I call method menu() and pass it myList as actual parameter.
so I called the function menu which is should be in the main too
like this
myList.menu();
and menu method accepts as parameter an object of type studentList. and display the menu for the user to choose..
here is part my program:
public class ListTest
{ public void menu(Student L) // accepts parameter
System.out.println("");
System.out.println("Choose a number between 1 to 4");
System.out.println("1-Print Info of A Student ");
System.out.println("2-Print Info of All Students ");
System.out.println("3-Display grade of A Specific student");
System.out.println("4-Exit");
System.out.println("");
int choice = Stdin.readInteger();
while (choice != 5)
switch (choice) {
case 1:
L.PrintAStudent(int L);
break;
case 2:
L.PrintAll();
break;
case 3:
L.DisplayGPA();
break;
case 3:
System.exit(0);
break;
default:
System.out.println("wrong Number");
System.out.println("Enter a number between 1 to 4 ");
System.out.println("Enter 4 to Exit");
break;
System.out.println("");
System.out.println("Choose a number between 1 to 4");
System.out.println("1-Print Info of A Student ");
System.out.println("2-Print Info of All Students ");
System.out.println("3-Display grade of A Specific student");
System.out.println("4-Exit");
System.out.println("");
choice = Stdin.readInteger();
}// end method menu
public static void main(String args[ ])
{ studentList myList = new studentList();//myList object is created
myList.menu();
}//end main
}// end of class ListTest
you have mentioned about the class "studentList" but that class is not to be found in the code you have pasted. its instead "ListTest". And the "menu" function seems to b a part of "ListTest" class. Can you provide the structure of the classes "studentList" and "Student" so that the problem can be more clearly understood?
also you are using the variable "Stdin" in the line int choice = Stdin.readInteger(); where as you have not declared this variable.
in the "switch" statement you are calling two different functions for the same case "3" where as it should be "case 3" and "case 4" respectively.
in the "main" you are calling the "menu" function without any parameter while you actually want to pass argument of type "studentList". -
Servlet cannot find helper class
Hello
Under WEB-INF/classes I put ServletExample and SingletonExample. Compiling ServletExample, that makes use of SingletonExample, works.
In the directory WEB-INF/classes I also have another direcotry, test. And in WEB-INF/classes/test I put again ServletExample and SingletonExample.
Here I have tried in several ways to compile the servlet, but I always get an:
Cannot find symbol class SingletonExample.
I tried writing package test at the top of both files, and even at the top of only one of these two.
I even tried to make WEB-INF/classes/test/ServletExample make use of SingletonExample residing in WEB-INF/classes, but I didnt succeded.
What happens when you have subdirectory in WEB-INF/classes/? I think this is a MUST, to have subdirectory in large webapplication, so I really dont want to put everything in the classes directory.
Do you how to resolve this prolem? And: if Im in WEB-INF/classes/test and want to referr from a servlet residing in this direcory to a Singleton/helper class residing in WEB-INF/classes/, which approach do I have to use?
Thanks
PaoloJeez, you aren't gonna get very far in Java like this.
CLASSPATH is wrong - again. You're supposed to give JARs and paths where the class loader is supposed to look, not the actual .class file.
Also, you're not telling the compiler to put the .class file in the package directory structure.
Your example is pretty awful. Try this:
Put this code into c:\common
package common;
import common.test.TestDown; // What the hell is this? There is no package test, but there is a package named common.test
public class TestUp
public void sayHello()
System.out.println("Hello.....");
}Put this code into c:\common\test
package common.test;
import common.TestUp;
public class TestDown
public TestDown()
TestUp testUp = new TestUp();
testUp.sayHello();
public static void main(String[] args)
new TestDown();
}Open a command shell and navigate to c:\, then do the following:
Directory of c:
07/01/2005 03:43 PM <DIR> .
07/01/2005 03:43 PM <DIR> ..
07/01/2005 03:45 PM <DIR> common
0 File(s) 0 bytes
3 Dir(s) 74,909,675,520 bytes free
C:\>javac -d . common\*.java
C:\>javac -d . common\test\*.java
C:\>java -classpath . common.test.TestDown
Hello.....Once you've got your head around this, go learn Ant and have it compile your projects properly.
% -
Cannot find symbol class Usernamebean
hi i am new in j2ee
can some body help to give the solution.
i am always thankfull to everybody
i have a servlet where i am calling a bean of same package but servlet not compile giving that error
cannot find symbol class Usernamebean
servlet code
package ecomm; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; import bengalcom.*; public class Loginservelet extends HttpServlet { public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException { try { String accnum=req.getParameter("username"); String pinnum=req.getParameter("password"); try { Class.forName("com.mysql.jdbc.Driver"); Connection dbcon=DriverManager.getConnection("jdbc:mysql://localhost/ecomm","root",""); PreparedStatement s = dbcon.prepareStatement("select * from vendordetails where email = ? and password = ? and blocking='No' "); s.setString(1,accnum); s.setString(2,pinnum); ResultSet result=s.executeQuery(); boolean rowfound=false; rowfound=result.next(); if(rowfound==true) { String vname=result.getString("fname"); String vid=result.getString("vid"); String email=result.getString("email"); UsernameBean nameBean =new UsernameBean(); nameBean.setFirstName(accnum); HttpSession session = req.getSession(true); session.setAttribute("vname",vname); session.setAttribute("vid",vid); session.setAttribute("email",email); RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/earea.jsp?vname=vname&vid=vid&email=email"); dispatcher.forward(req,res); dbcon.close(); } else{ RequestDispatcher dispatcher=getServletContext().getRequestDispatcher("/eblock.jsp"); dispatcher.forward(req,res); } } catch(ClassNotFoundException e) { } } catch(SQLException e) { System.out.println(e.toString()); } } public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { doGet(req, res); } }Hi,
java is case sensitive, Check the case in class name.
Regards,
Ram -
Cannot find symbol class Scanner
hi all
i'm defining a class within a project so i can use the class inside my program, but the line:
Scanner keyboard = new Scanner(System.in);generates an error with my compiler:
cannot find symbol class Scanner
please helpyou aren't using jdk 5 or higher then. that's when scanner was added to the jdk.
download a modern jdk and you'll be fine.
% -
Cannot find package/class symbol
hello. i'm using netveans for the first time. i have a java application with 2 classes... pb.java with public class pb int package svr and cl.java with public class cl in package cli
that is..
file class package
pb pb svr
cl cl cli
pb.java compiles properly cl.java gioves error.
the error is in the following lines of code...
pb obj1 = new pb();
pb obj2 = new pb();i'm trying to make an object fo type pb from cl.java. the error i get is...
cannot find symbol
class pb
location cli.cl
i alse tried puttin svr.pb instead of pb but no use.
the entire cose is as follows...
pb.java
* pb.java
* Created on December 4, 2006, 8:56 AM
package svr;
public class pb
private double balance;
private double []lt = new double [10];
private int i=9;
public void deposit(double amt)
if(amt<=0)
System.out.println("Enter amount greater than 0");
else
balance=balance+amt;
if(i>=0)
lt=amt;
else
for(int j=9;j>=0;j--)
lt[i]=lt[i-1];
lt[0]=amt;
public void withdraw(double amt)
if(amt<=0)
System.out.println("Enter amount greater than 0");
else
if(amt>balance)
System.out.println("Balance lower than amount entered");
else
balance=balance-amt;
if(i>=0)
lt[i]=-amt;
else
for(int j=9;j>=0;j--)
lt[i]=lt[i-1];
lt[0]=-amt;
public void bal()
System.out.println("Balance: "+balance);
public void lts()
System.out.println("Last 10 Transactions");
for(int j=i;j>10;j++)
System.out.println(lt[j]);
public void statement()
lts();
bal();
cl.java
* cl.java
* Created on December 4, 2006, 8:58 AM
package cli;
class cl
public static void main(String[] args)
pb obj1 = new pb();
pb obj2 = new pb();
obj1.deposit(100.50);
obj1.statement();
obj2.deposit(200.75);
obj2.statement();
obj1.withdraw(25.50);
obj1.statement();
obj2.withdraw(100.25);
obj2.statement();For a beginner these tools are worst, because they
hide all the stuff a programmer needs to know to find
his way around Java. They should spend a few weeks
with the command line and a good text editor before
switching.
Just because an IDE does something for you, it
doesn't mean you don't need to kno wwhat it does.
Unless you volunteer to handle all "how do I do X in
Netbeans/Eclipse/Whatever", JAR and classpath
questions posted here by newbies yourself.I suppose I can agree with that to some extent. I wouldn't suggest to anyone that they just blindly trust whatever code the IDE inserts automatically.
But there's nothing wrong about learning by example. The IDE is willing to teach proper syntax, and eclipse will give suggestions about capitalizing class names and making constants all-caps.
There are things that frustrate new programmers where an IDE will be helpful, especially if the entire API is uncharted territory. -
Hi All,
Can any one help me regarding the issue?
Error:
package com.support.misc.feedback
I am getting the following error for the above line. But I have created the Hierarchy in folder structure. But still it is throwing the error.
1. Cannot find the class file for com.sapportals.htmlb.page.DynPage
2. This compilation unit indirectly references the missing type com.sapportals.htmlb.page.DynPage (typically some required class file is referencing a type outside the class path) FeedbackBean.java
Thanks in Advance.
Message was edited by: Gowsika KannanHi Gowsika,
the class needed is located in htmlb.jar which can be found under <irj-root>/WEB-INF/portal/portalapps/com.sap.portal.htmlb/lib
You need to integrate this jar in your .classpath
Hope this helps,
Robert
PS: Please do not post the same question 3 times -
Hi,
I was trying the "How to BI JAVA SDK in a Portal iView and get the following error.
The project was not built since its classpath is incomplete. Cannot find the class file for com.sap.portal.services.api.connectorgateway.IConnectorGatewayService. Fix the classpath and try rebuilding this project.
I have the following in my portalapp.xml file
<property name="SharingReference" value="com.sap.portal.ivs.connectorservice"/>
and i have also added the jar file "com.sap.portal.ivs.connectorservice_api" in the set of lib's
Has some faced a similar issue? or can someone suggest how I could possibly resolve this.
Thanks,
SmithaHi Smitha:
My webdynpro dc was build failed for "This compilation unit indirectly references the missing type com.sap.engine.services.webservices.espbase.client.dynamic.content.GenericObject (typically some required class file is referencing a type outside the classpath)".
How should i do? Thank you! -
i try to build my first servlet file. before i install the file into JWS, i compile the program, but it gave me messages like: "javax.servlet.http does not exist", "javax.servlet does not exist". i installed JavaWebServer properly, but cannot find jsdk class in the lib/jws.jar. does any one know where is the problem?? Thanks A Lot!!
you need to add servlet.jar to your classpath.
Maybe you are looking for
-
Adobe Extension Manager does not recognize me as a Creative Cloud Member.
I'm unable to activate several new extensions, particularly 2 of the paper textures. Adobe Extension Manager says I have to be a Creative Cloud member. I am. And I"m logged in.
-
Intel 82566 DM GbE compatible with High Performanc​e Driver?
Hello, Let me explain: I have IM Q35 motherboard that comes with 1x Intel 82566DM 10/100/1000 NIC and 1x Intel 82573L 10/100/1000 NIC. I need to get those 2 NICs working with the High Performance Driver from NI because of my network settings (I need
-
Tax calculation in Security deposit Agreement
Hi All, While I am running the postings for Security deposit agreement commercial lease In. the tax is being calculated for the security deposit the tax has to be exempted while posting. Experts please post any solution. Regards, Arjun.
-
Connect an iPod touch to a printer
Either by WiFi or via USB2 cable.
-
Query - Counting customers based on Top 80% condition
Hi all, We have a query, which counts the number of customers that makes up 80% of the sales. We have used a condition to do this. This works out quite well when we only have the customer in the drill down. However if we also include f.x. Division in