java - HTTP Status 500 - Error instantiating servlet class com.servlet.Controller -


i trying out example given crud operations in jsp. getting error in calling controller.

when execute code given them i'm getting following error:

may 08, 2015 12:01:20 pm org.apache.catalina.core.standardservice startinternal info: starting service catalina may 08, 2015 12:01:20 pm org.apache.catalina.core.standardengine startinternal info: starting servlet engine: apache tomcat/7.0.59 may 08, 2015 12:01:20 pm org.apache.catalina.util.sessionidgeneratorbase createsecurerandom info: creation of securerandom instance session id generation using [sha1prng] took [147] milliseconds. may 08, 2015 12:01:20 pm org.apache.catalina.loader.webappclassloader validatejarfile info: validatejarfile(e:\coding\eclipse32juno\workspace\web\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\jtableservletsetup\web-inf\lib\servlet-api.jar) - jar not loaded. see servlet spec 3.0, section 10.7.2. offending class: javax/servlet/servlet.class may 08, 2015 12:01:21 pm org.apache.catalina.loader.webappclassloader validatejarfile info: validatejarfile(e:\coding\eclipse32juno\workspace\web\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\ajaxcurdjtableservlet\web-inf\lib\servlet-api.jar) - jar not loaded. see servlet spec 3.0, section 10.7.2. offending class: javax/servlet/servlet.class may 08, 2015 12:01:21 pm org.apache.coyote.abstractprotocol start info: starting protocolhandler ["http-bio-8080"] may 08, 2015 12:01:21 pm org.apache.coyote.abstractprotocol start info: starting protocolhandler ["ajp-bio-8009"] may 08, 2015 12:01:21 pm org.apache.catalina.startup.catalina start info: server startup in 1305 ms may 08, 2015 12:01:47 pm org.apache.catalina.core.applicationcontext log info: marking servlet controller unavailable may 08, 2015 12:01:47 pm org.apache.catalina.core.standardwrappervalve invoke severe: allocate exception servlet controller java.lang.classnotfoundexception: com.servlet.controller     @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1720)     @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571)     @ org.apache.catalina.core.defaultinstancemanager.loadclass(defaultinstancemanager.java:506)     @ org.apache.catalina.core.defaultinstancemanager.loadclassmaybeprivileged(defaultinstancemanager.java:488)     @ org.apache.catalina.core.defaultinstancemanager.newinstance(defaultinstancemanager.java:115)     @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1148)     @ org.apache.catalina.core.standardwrapper.allocate(standardwrapper.java:864)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:134)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:122)     @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:504)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:170)     @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:103)     @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:950)     @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:116)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:421)     @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1074)     @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:611)     @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:316)     @ java.util.concurrent.threadpoolexecutor.runworker(unknown source)     @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source)     @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61)     @ java.lang.thread.run(unknown source) 

then changed index.jsp below check if controller getting called:

<!doctype html> <html> <head> <title>crud operations using jtable in j2ee</title> <!-- include 1 of jtable styles. --> <link href="css/metro/blue/jtable.css" rel="stylesheet" type="text/css" /> <link href="css/jquery-ui-1.10.3.custom.css" rel="stylesheet"     type="text/css" /> <!-- include jtable script file. --> <script src="js/jquery-1.8.2.js" type="text/javascript"></script> <script src="js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script> <script src="js/jquery.jtable.js" type="text/javascript"></script>  <script type="text/javascript">     $(document).ready(function() {         $('#studenttablecontainer').jtable({             title : 'students list',             actions : {                 listaction : 'controller?action=list',                 createaction : 'controller?action=create',                 updateaction : 'controller?action=update',                 deleteaction : 'controller?action=delete'             },             fields : {                 studentid : {                     title : 'student id',                     width : '30%',                     key : true,                     list : true,                     edit : false,                     create : true                 },                 name : {                     title : 'name',                     width : '30%',                     edit : true                 },                 department : {                     title : 'department',                     width : '30%',                     edit : true                 },                 emailid : {                     title : 'email',                     width : '20%',                     edit : true                 }             }         });         //$('#studenttablecontainer').jtable('load');     }); </script>  </head> <body>     <div style="width: 80%; margin-right: 10%; margin-left: 10%; text-align: center;">         <h4>ajax based crud operations using jtable in j2ee</h4>         <div id="studenttablecontainer"></div>     </div>     <form action="controller" method="get">     form contents:     <button type="submit">submit</button>     </form> </body> </html> 

now when click on button results following error:

may 08, 2015 12:07:31 pm org.apache.catalina.core.applicationcontext log info: marking servlet controller unavailable may 08, 2015 12:07:31 pm org.apache.catalina.core.standardwrappervalve invoke severe: allocate exception servlet controller java.lang.classnotfoundexception: com.servlet.controller     @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1720)     @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571)     @ org.apache.catalina.core.defaultinstancemanager.loadclass(defaultinstancemanager.java:506)     @ org.apache.catalina.core.defaultinstancemanager.loadclassmaybeprivileged(defaultinstancemanager.java:488)     @ org.apache.catalina.core.defaultinstancemanager.newinstance(defaultinstancemanager.java:115)     @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1148)     @ org.apache.catalina.core.standardwrapper.allocate(standardwrapper.java:864)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:134)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:122)     @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:504)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:170)     @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:103)     @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:950)     @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:116)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:421)     @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1074)     @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:611)     @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:316)     @ java.util.concurrent.threadpoolexecutor.runworker(unknown source)     @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source)     @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61)     @ java.lang.thread.run(unknown source) 

i'm unable doing wrong.

here project directory structure:

enter image description here

i can't see project set ( @ work proxy strips out diagrams ) guessing have servlet-api.jar in web-inf/lib directory.

if have, remove , clean , rebuild project. servlet container providing instance of jar , think 2 conflicting.


Comments