unable to compile jsp没有生成class文件 for jsp

java - HTTP Status 500 - Unable to compile class for JSP: in Eclipse Luna - Stack Overflow
to customize your list.
This site uses cookies to deliver our services and to show you relevant ads and job listings.
By using our site, you acknowledge that you have read and understand our , , and our .
Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.
Join Stack Overflow to learn, share knowledge, and build your career.
or sign in with
I have a Login.jsp page.When I try to run it on server I get the following error:
type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [1] in the generated java file:
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
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:646)
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:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.47 logs.
What causes this error?
1,79952445
I found the solution I changed from Apache 7 to Apache 8 now things are working fine !
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Post as a guest
Post as a guest
Post Your Answer
By clicking &Post Your Answer&, you acknowledge that you have read our updated ,
and , and that your continued use of the website is subject to these policies.
Not the answer you're looking for?
Browse other questions tagged
Stack Overflow works best with JavaScript enabled33601 & org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated
ASF Bugzilla & Bug&33601
- org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.t...
Unclassified
Windows XP
Tomcat Developers Mailing List
08:34 UTC by ren quebral
Attachments
This is ASF Bugzilla: the Apache Software Foundation bug system. In case
of problems with the functioning of ASF Bugzilla, please contact
Please Note: this e-mail address is only for reporting problems
with ASF Bugzilla. Mail about any other subject will be silently转载请注明原文地址:
& & & 在上一篇博文中,我们把自己本机的web项目部署到了云主机的tomcat上。之后通过浏览器访问时,如果出现 &HTTP 500-Unable to compile class for JSP 的错误,应该怎么解决呢?
&&&&& 通常,造成这种错误的原因是你开发时所用的jdk版本以及本地测试时的tomcat版本比云主机上搭建的jdk版本以及tomcat版本低造成的。
&&&&& 解决方法:重新搭建云主机的jdk以及tomcat,版本选择开发时myeclipse所用jdk版本。
&&&& 1:查看开发所用jdk版本。
&&&& 在myeclipse中点击File,Properties,左侧栏选择BuildPath。
&&&& 如上图,JRE System Library[Sun JDK 1.6.0_13]即为我的项目编译时所用的JDK版本。
&&& 2:根据上面得到的JDK版本,下载相应的tar.gz文件,参照博文&&&&&&&&&&&&&&& 搭建JDK。
&&& 3:根据JDK版本选择tomcat:一般选择与JDK版本相应的tomcat。比如这里JDK6,所以我搭建了tomcat6。当然也可以选择tomcat7,8,9。记住,tomcat的版本必须大于等于JDK的版本。
&& 4:重新部署web项目。
阅读(...) 评论()关于jsp中的Unable to compile class for JSP解决
我在一个ajax项目中引用了xml,在写到Document xmlDoc = (Document)new XPPReader().read(new ByteArrayInputStream(xml.getBytes()));
的时候,出现
然后百度了一下,说是要加载pull-parser-2.1.10.jar包,于是我把这个包加到工程中,同时在jsp开头包含进对应的类
&%@page import="org.gjt.xpp.*"%&
然后这错误也就不见了
jsp写完了,开开心心启动程序,一运行,结果又开始出现错误,还是一样的错误,想必刚刚是指标不治本。
查看异常说明,看到这样一句
Unable to compile class for JSP
怎么会不能编译呢,于是又百度,这次是说把工程下的servlet-api.jar和jsp.api.jar删除掉
我找了一下,我的工程只有servlet-api.jar,没有jsp.api.jar,我把servlet-api.jar删掉了,但是一删掉,工程中引用了这个包的类全都报错
显然这个方法行不通,于是我又把这个包添加回来。
上次写到一半,现在忘记具体细节了,只记得是要把servlet-api.jar放到工程的lib下,不能放在工程外面。应该是程序运行的时候,在lib下查找对应的类吧。
没有更多推荐了,JSP错误:Unable to compile class for JSP
项目中的诸如:catalina.jar、jsp-api.jar、servlet-api.jar、javax.servlet.jar、javax.servlet.jsp.jar等包和应用服务器(JBoss/Tomcat等)中的包重复且比其版本低
,应用服务器在启动时会优先加载项目中的包,这样就导致和应用服务器中的其它包不匹配。可把重复的包从项目中删除,或将应用服务器下的这些包拷贝到项目中,重启服务
没有更多推荐了,}

我要回帖

更多关于 springmvc jsp 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信