首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

ConnDB cannot be resolved to a type,jsp中的一个常见的异常。

2014-01-26 
type Exception report message description The server encountered an internal error () that prevented

type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
Only a type can be imported. com.ConnDB resolves to a package

An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type
An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type
An error occurred at line: 39 in the jsp file: /index.jsp
Generated servlet error:
co cannot be resolved


org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
Only a type can be imported. com.ConnDB resolves to a package

An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type

An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type

An error occurred at line: 39 in the jsp file: /index.jsp
Generated servlet error:
co cannot be resolved


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


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



------解决方法--------------------------------------------------------
把index.jsp的内容贴出来吧
------解决方法--------------------------------------------------------
ConnDB cannot be resolved to a type

旧这句啦,检查一下ConnDB,还有对应的包
------解决方法--------------------------------------------------------
Unable to compile class for JSP:
1. jsp代码有问题,查看是否有语法错误。
2. jsp中引用的类是否没有导入。不能解析对象以及方法,造成jsp无法编译。
------解决方法--------------------------------------------------------
Unable to compile class for JSP:

Unable : 不能
compile: 编译
class : 类         

热点排行