当前位置: 技术问答>java相关
各位高手小弟现有java疑难问题请教,谢谢。
来源: 互联网 发布时间:2015-03-22
本文导语: 您好: 我是一名jsp初学者,遇到关于javabean在jsp中运行的问题希望,您可以尽快帮我解答,谢谢。 我把它放在tomcatwebappssghWEB_INFclassestest目录下:OPDB.class bean已经编译成功,可是运行总是找不到类OPDB 我的jsp程序...
您好:
我是一名jsp初学者,遇到关于javabean在jsp中运行的问题希望,您可以尽快帮我解答,谢谢。
我把它放在tomcatwebappssghWEB_INFclassestest目录下:OPDB.class
bean已经编译成功,可是运行总是找不到类OPDB
我的jsp程序中usebean代码是:
错误码是:
Error: 500
Location: /hgs/listgood.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSPD:tomcatworklocalhost_8080%2Fhgs_0002flistgood_0002ejsplistgood_jsp_0.java:72: 找不到类 test.OPDB。
test.OPDB lg = null;
^
D:tomcatworklocalhost_8080%2Fhgs_0002flistgood_0002ejsplistgood_jsp_0.java:75: 找不到类 test.OPDB。
lg= (test.OPDB)
^
D:tomcatworklocalhost_8080%2Fhgs_0002flistgood_0002ejsplistgood_jsp_0.java:80: 找不到类 test.OPDB。
lg = (test.OPDB) Beans.instantiate(this.getClass().getClassLoader(), "test.OPDB");
^
3 个错误
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
期待您的解答,谢谢。
我是一名jsp初学者,遇到关于javabean在jsp中运行的问题希望,您可以尽快帮我解答,谢谢。
我把它放在tomcatwebappssghWEB_INFclassestest目录下:OPDB.class
bean已经编译成功,可是运行总是找不到类OPDB
我的jsp程序中usebean代码是:
错误码是:
Error: 500
Location: /hgs/listgood.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSPD:tomcatworklocalhost_8080%2Fhgs_0002flistgood_0002ejsplistgood_jsp_0.java:72: 找不到类 test.OPDB。
test.OPDB lg = null;
^
D:tomcatworklocalhost_8080%2Fhgs_0002flistgood_0002ejsplistgood_jsp_0.java:75: 找不到类 test.OPDB。
lg= (test.OPDB)
^
D:tomcatworklocalhost_8080%2Fhgs_0002flistgood_0002ejsplistgood_jsp_0.java:80: 找不到类 test.OPDB。
lg = (test.OPDB) Beans.instantiate(this.getClass().getClassLoader(), "test.OPDB");
^
3 个错误
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
期待您的解答,谢谢。
|
加public 修饰
|
PATH里的路径设置对了吗
|
看其他BEAN可以用吗?如果也不行,就是TOMCAT配置问题!