Why the error "the value for the useBean class attribute action.TestBean is invalid " occours when accessing localhost:8080\main.jsp -


i know question has been asked solutions provided in post not of me . have testbean class inside package named action .it have public constructor . web-inf/classes/action has testbean compiled class. have main.jsp file in root folder of webapps in tomcat root folder .i have set class path of "web-inf/classes/action" in class-path variable.

here link referring . the value usebean class attribute ... invalid

here codes testbean.java

/* file: testbean.java */ package action;  public class testbean {    private string message = "no message specified";    public testbean()    {     }        public string getmessage() {       return(message);    }    public void setmessage(string message) {       this.message = message;    } } 

main.jsp

<html> <head> <title>using javabeans in jsp</title> </head> <body> <center> <h2>using javabeans in jsp</h2>  <jsp:usebean id='test' >     <jsp:attribute name="class" trim="true">action.testbean</jsp:attribute> </jsp:usebean>  <jsp:setproperty name="test"                      property="message"                      value="hello jsp..." />  <p>got message....</p>  <jsp:getproperty name="test" property="message" />  </center> </body> </html> 

note :when replace class type in jsp:attribute in main.jsp throws classnotfoundexception

my server running , variables set. when access main.jsp in browser through url localhost:8080/main.jsp gives following

type exception report  message /main.jsp (line: 9, column: 0) value usebean class attribute action.testbean invalid.  description server encountered internal error prevented fulfilling request.  exception  org.apache.jasper.jasperexception: /main.jsp (line: 9, column: 0) value usebean class attribute action.testbean invalid.     org.apache.jasper.compiler.defaulterrorhandler.jsperror(defaulterrorhandler.java:42)     org.apache.jasper.compiler.errordispatcher.dispatch(errordispatcher.java:443)     org.apache.jasper.compiler.errordispatcher.jsperror(errordispatcher.java:149)     org.apache.jasper.compiler.generator$generatevisitor.visit(generator.java:1242)     org.apache.jasper.compiler.node$usebean.accept(node.java:1181)     org.apache.jasper.compiler.node$nodes.visit(node.java:2375)     org.apache.jasper.compiler.node$visitor.visitbody(node.java:2427)     org.apache.jasper.compiler.node$visitor.visit(node.java:2433)     org.apache.jasper.compiler.node$root.accept(node.java:474)     org.apache.jasper.compiler.node$nodes.visit(node.java:2375)     org.apache.jasper.compiler.generator.generate(generator.java:3517)     org.apache.jasper.compiler.compiler.generatejava(compiler.java:250)     org.apache.jasper.compiler.compiler.compile(compiler.java:373)     org.apache.jasper.compiler.compiler.compile(compiler.java:353)     org.apache.jasper.compiler.compiler.compile(compiler.java:340)     org.apache.jasper.jspcompilationcontext.compile(jspcompilationcontext.java:657)     org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:357)     org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:390)     org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334)     javax.servlet.http.httpservlet.service(httpservlet.java:727)     org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) note full stack trace of root cause available in apache tomcat/7.0.52 logs. 

here log file

127.0.0.1 - - [06/apr/2014:07:21:30 +1000] "get / http/1.1" 200 11418 127.0.0.1 - - [06/apr/2014:07:21:32 +1000] "get /tomcat.css http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:21:32 +1000] "get /tomcat.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:21:32 +1000] "get /bg-middle.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:21:32 +1000] "get /bg-button.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:21:32 +1000] "get /bg-upper.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:21:32 +1000] "get /asf-logo.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:21:32 +1000] "get /bg-nav.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:21:33 +1000] "get /manager/html http/1.1" 401 2550 127.0.0.1 - tomcat [06/apr/2014:07:21:42 +1000] "get /manager/html http/1.1" 200 21021 127.0.0.1 - tomcat [06/apr/2014:07:21:42 +1000] "get /manager/images/tomcat.gif http/1.1" 304 - 127.0.0.1 - tomcat [06/apr/2014:07:21:42 +1000] "get /manager/images/asf-logo.gif http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:07:22:41 +1000] "get /hello.jsp http/1.1" 200 138 127.0.0.1 - - [06/apr/2014:07:29:00 +1000] "get /hello.jsp http/1.1" 200 198 127.0.0.1 - - [06/apr/2014:19:29:25 +1000] "get /hello.jsp http/1.1" 200 198 127.0.0.1 - - [06/apr/2014:23:00:50 +1000] "get / http/1.1" 200 11418 127.0.0.1 - - [06/apr/2014:23:00:50 +1000] "get /tomcat.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:00:50 +1000] "get /tomcat.css http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:00:51 +1000] "get /bg-middle.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:00:51 +1000] "get /bg-button.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:00:51 +1000] "get /bg-upper.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:00:51 +1000] "get /asf-logo.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:00:51 +1000] "get /bg-nav.png http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:00:54 +1000] "get /manager/html http/1.1" 401 2550 127.0.0.1 - tomcat [06/apr/2014:23:00:56 +1000] "get /manager/html http/1.1" 200 21021 127.0.0.1 - tomcat [06/apr/2014:23:00:56 +1000] "get /manager/images/asf-logo.gif http/1.1" 304 - 127.0.0.1 - tomcat [06/apr/2014:23:00:56 +1000] "get /manager/images/tomcat.gif http/1.1" 304 - 127.0.0.1 - - [06/apr/2014:23:01:18 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:03:23 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:03:45 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:07:11 +1000] "get /main.jsp http/1.1" 500 2967 127.0.0.1 - - [06/apr/2014:23:09:08 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:10:05 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:10:58 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:12:18 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:12:32 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:12:45 +1000] "get / http/1.1" 200 11418 127.0.0.1 - tomcat [06/apr/2014:23:12:47 +1000] "get /manager/html http/1.1" 200 21021 127.0.0.1 - tomcat [06/apr/2014:23:12:49 +1000] "get /manager/html/list?org.apache.catalina.filters.csrf_nonce=90251ed57e2071f7c450c04b1d8fdee7 http/1.1" 200 21021 127.0.0.1 - - [06/apr/2014:23:13:10 +1000] "get / http/1.1" 200 11418 127.0.0.1 - - [06/apr/2014:23:13:13 +1000] "get /host-manager/html http/1.1" 401 2112 127.0.0.1 - tomcat [06/apr/2014:23:13:17 +1000] "get /host-manager/html http/1.1" 403 2869 127.0.0.1 - tomcat [06/apr/2014:23:13:27 +1000] "get /manager/html http/1.1" 200 21021 127.0.0.1 - - [06/apr/2014:23:13:32 +1000] "get /docs/html-manager-howto.html?org.apache.catalina.filters.csrf_nonce=a6fa451baa505b551747159ee14d3227 http/1.1" 200 48922 127.0.0.1 - - [06/apr/2014:23:13:32 +1000] "get /docs/images/tomcat.gif http/1.1" 200 2066 127.0.0.1 - - [06/apr/2014:23:13:32 +1000] "get /docs/images/asf-logo.gif http/1.1" 200 7279 127.0.0.1 - - [06/apr/2014:23:13:32 +1000] "get /docs/images/void.gif http/1.1" 200 43 127.0.0.1 - tomcat [06/apr/2014:23:13:37 +1000] "get /manager/html/list?org.apache.catalina.filters.csrf_nonce=a6fa451baa505b551747159ee14d3227 http/1.1" 200 21021 127.0.0.1 - tomcat [06/apr/2014:23:13:44 +1000] "post /manager/html/stop?path=/&org.apache.catalina.filters.csrf_nonce=18214a73ac6421e7b3900d8790e50b4b http/1.1" 200 20534 127.0.0.1 - tomcat [06/apr/2014:23:13:45 +1000] "post /manager/html/start?path=/&org.apache.catalina.filters.csrf_nonce=33395ce44598f949ecb8fae64a85d07a http/1.1" 200 21063 127.0.0.1 - - [06/apr/2014:23:17:00 +1000] "get /index.jsp http/1.1" 200 11418 127.0.0.1 - - [06/apr/2014:23:17:08 +1000] "get /hello.jsp http/1.1" 200 199 127.0.0.1 - - [06/apr/2014:23:17:16 +1000] "get /main.jso http/1.1" 404 967 127.0.0.1 - - [06/apr/2014:23:17:19 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:19:40 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:20:03 +1000] "get /main.jsp http/1.1" 500 2949 127.0.0.1 - - [06/apr/2014:23:23:00 +1000] "get /main.jsp http/1.1" 500 2928 127.0.0.1 - - [06/apr/2014:23:26:35 +1000] "get /main.jsp http/1.1" 500 2949 

here link reffered jasperexception: value usebean class attribute invalid

in tomcat log found root cause jasperexception: value usebean class attribute invalid

but link above doesnot seem either wish know meaning of last 4 lines or @ end of log file?what meant "get /main.jsp http/1.1" 500 2949


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -