2 Replies Latest reply on Jul 14, 2004 6:59 AM by gtraas

    Error instantiating class file

    gtraas Newbie

      Hi all,

      I've just downloading and installed JBoss 3.2.5 with Tomcat embedded. The problem I'm having, is this :

      I've deployed my war file (exploded) to the /server/default/deploy folder and I see in JBoss's startup that Tomcat has seen and deployed it, but then when I try to access my Servlets, I get the following error:

      type Exception report
      
      message
      
      description The server encountered an internal error () that prevented it from fulfilling this request.
      
      exception
      
      javax.servlet.ServletException: Error instantiating servlet class chpt3.RegisterServlet
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:986)
      
      
      root cause
      
      java.lang.Error: Unresolved compilation problems:
       The import javax.servlet cannot be resolved
       The import javax.servlet cannot be resolved
       The import javax.servlet cannot be resolved
       The import javax.servlet cannot be resolved
       HttpServlet cannot be resolved or is not a valid superclass
       HttpServletRequest cannot be resolved (or is not a valid type) for the parameter request of the method doGet
       HttpServletResponse cannot be resolved (or is not a valid type) for the parameter response of the method doGet
       ServletException cannot be resolved (or is not an exception type) for the method doGet
       HttpServletRequest cannot be resolved (or is not a valid type) for the parameter request of the method doPost
       HttpServletResponse cannot be resolved (or is not a valid type) for the parameter response of the method doPost
       ServletException cannot be resolved (or is not an exception type) for the method doPost
      
       at chpt3.RegisterServlet.<init>(RegisterServlet.java:11)
      

      I've taken most of the stack trace out.

      Could someone please tell me why the imports can't be found?

      Thanks

        • 1. Re: Error instantiating class file
          Darran Lofthouse Master

          I've taken most of the stack trace out. - Don't do this, give people the full stack trace.

          • 2. Re: Error instantiating class file
            gtraas Newbie

            The full stack trace :

            type Exception report

            message

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

            exception

            javax.servlet.ServletException: Error instantiating servlet class chpt3.RegisterServlet
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:986)
            at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
            at java.lang.Thread.run(Thread.java:479)


            root cause

            java.lang.Error: Unresolved compilation problems:
            The import javax.servlet cannot be resolved
            The import javax.servlet cannot be resolved
            The import javax.servlet cannot be resolved
            The import javax.servlet cannot be resolved
            HttpServlet cannot be resolved or is not a valid superclass
            HttpServletRequest cannot be resolved (or is not a valid type) for the parameter request of the method doGet
            HttpServletResponse cannot be resolved (or is not a valid type) for the parameter response of the method doGet
            ServletException cannot be resolved (or is not an exception type) for the method doGet
            HttpServletRequest cannot be resolved (or is not a valid type) for the parameter request of the method doPost
            HttpServletResponse cannot be resolved (or is not a valid type) for the parameter response of the method doPost
            ServletException cannot be resolved (or is not an exception type) for the method doPost

            at chpt3.RegisterServlet.<init>(RegisterServlet.java:11)
            at java.lang.Class.newInstance0(Native Method)
            at java.lang.Class.newInstance(Class.java:232)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:977)
            at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
            at java.lang.Thread.run(Thread.java:479)