Link to home
Start Free TrialLog in
Avatar of ashutoshleo
ashutoshleo

asked on

problem in using beans in tomcat

The problem seems to be very frequent among tomcat users, as there are a lot of similar questions on web. well the problem is that the tomcat can't find the classes though i put them in webapps/ROOT/myapps/WEB-INF/classes folder. if i put them in shared folder then it can find them.
i don't know what to do with this.

Avatar of thanassis
thanassis

change
webapps/ROOT/myapps/WEB-INF/classes
with
webapps/myapps/WEB-INF/classes
and then restart tomcat
Avatar of ashutoshleo

ASKER

no then it starts giving this error.(see below)
but if i put the class file in shared/classes/ then it can find that class there
i hope these lines below will give more clues to diagnos whats wrong with my setup



type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 6 in the jsp file: /mail/mail.jsp

Generated servlet error:
    [javac] Compiling 1 source file

C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\mail\mail_jsp.java:47: cannot resolve symbol
symbol  : class mailBean
location: package jspClasses
      jspClasses.mailBean mb = null;
                ^



An error occurred at line: 6 in the jsp file: /mail/mail.jsp

Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\mail\mail_jsp.java:49: cannot resolve symbol
symbol  : class mailBean
location: package jspClasses
        mb = (jspClasses.mailBean) pageContext.getAttribute("mb", PageContext.SESSION_SCOPE);
                        ^



An error occurred at line: 6 in the jsp file: /mail/mail.jsp

Generated servlet error:
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\mail\mail_jsp.java:52: cannot resolve symbol
symbol  : class mailBean
location: package jspClasses
            mb = (jspClasses.mailBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "jspClasses.mailBean");
                            ^
3 errors


      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
      at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:340)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      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:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
      at java.lang.Thread.run(Thread.java:536)

ASKER CERTIFIED SOLUTION
Avatar of thanassis
thanassis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I tried that too
but its giving the same mistake
i don't know what to do
may be i'll simply use the shared folder only
i got it
it worked when i used  following folder-
webapps\ROOT\WEB-INF\classes\jspClasses
thanks for support thanassis
i don't can i accept ur comment as answer b'cos it didn't gave me the fully correct solution but i gave me a lot of clue
so i at my part accept it as answer
i hope its okay with experts-exchange.com's rules
thanks