0 Replies Latest reply on Nov 3, 2017 6:06 AM by user4618454

    Configuring JSP files to call a class

    user4618454

      hi all.

      I am pretty new to the forum.

      As i was configuring jsp to  use a class kept in classes subdirectory.

      It is noteworthy that any jsp file or htm extension file is working fine. Problem is there when i call a class which is kept after compilation in the sub directory as mentioned before. I am working without any Eclopse or netbeans , Just using text editor to write my files;

      When i call i get a lot of messages:

       

      HTTP Status 500 - java.lang.NoClassDefFoundError: TestBean (wrong name: action/TestBean)


      type Exception report

      message java.lang.NoClassDefFoundError: TestBean (wrong name: action/TestBean)

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

      exception

      javax.servlet.ServletException: java.lang.NoClassDefFoundError: TestBean (wrong name: action/TestBean) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:348) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 

       

      root cause

      java.lang.NoClassDefFoundError: TestBean (wrong name: action/TestBean) java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClass(Unknown Source) java.security.SecureClassLoader.defineClass(Unknown Source) org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:3205) org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:1373) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1861) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1280) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1196) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450) org.apache.jasper.compiler.Node$Root.accept(Node.java:474) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) org.apache.jasper.compiler.Generator.generate(Generator.java:3591) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:251) org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:660) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 

       

      note The full stack trace of the root cause is available in the Apache Tomcat/7.0.82 logs.


      Apache Tomcat/7.0.82

      could anyone help.

      Thanks for the feedback.

      S.J