1 Q:
2006-2-27 21:31:59 org.apache.coyote.http11.Http11Protocol init
严重: Error initializing endpoint
java.net.SocketException: Permission denied: listen failed
at java.net.PlainSocketImpl.socketListen(Native Method)
at java.net.PlainSocketImpl.listen(PlainSocketImpl.java:343)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at java.net.ServerSocket.<init>(ServerSocket.java:141)
at
2 Q:
JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV
A: 原因lib中缺少standard.jar和servlet-api.jar两个文件,将两个文件加入用户库中。
3 错误:
java.lang.NullPointerException
原因: 发现 dao 实例、 manage 实例等需要注入的东西没有被注入
解决:这个时候,你应该查看日志文件;默认是应用服务器的 log 文件,比如 Tomcat 就是 [Tomcat 安装目录 ]/logs ;你会发现提示你:
可能是:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sf' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.HibernateException: could not configure from URL: file:src/hibernate.cfg.xml
org.hibernate.HibernateException: could not configure from URL: file:src/hibernate.cfg.xml
……………………….
Caused by: java.io.FileNotFoundException: src\hibernate.cfg.xml
可能是:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: Resource: com/mcc/coupon/model/UserRole.hbm.xml not found
org.hibernate.MappingException: Resource: com/mcc/coupon/model/UserRole.hbm.xml not found
然后你就知道原因是因为配置文件的解析出了错误,这个通过 Web 页面是看不出来的。
更多的是持久化影射文件出的错误;导致了没有被解析;当然你需要的功能就无法使用了。
4 错误:
StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /settlementTypeManage
或者:
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
原因: 同 3
5 错误:
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei
界面错误具体描述:
org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean.CookieTei
9 问题:
今天用Tomcat5.5.12,发现原来很好用的系统不能用了,反复测试发现页面中不能包含 taglib,否则会出现以下提示:
HTTP Status 500 -type Exception report
Message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /index.jsp(1,1) Unable to read TLD "META-INF/tlds/struts-bean.tld" from JAR file "file:*****/WEB-INF/lib/struts.jar":
原因:
更新了工程用的lib文件夹下的jar,发布时也发布了servlet.jar和jsp-api.jar。
解决:
把jsp-api.jar删除就解决这个问题了。
11 错误:javax.servlet.ServletException: Cannot find bean page in any scope
原因 1:检查程序,有可能是jsp中式到的bean在程序中没有运行到,所以不存在。
12 错误:No action instance for path /MenuManage could be created
原因:sturts配置问题,找不到Form对应的bean。检查jsp文件和struts-config.xml文件。
13 错误:org.hibernate.hql.ast.QuerySyntaxException: address is not mapped. [from address]
原因:检查对应bean中数据库名是否和hibernate定义的相同,注意大小写。
14 错误:org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter in class: com.xxx.perrsistence.Test, setter method of property: id
原因:对应bean中set方法数据类型和hibernate配置文件中定义的类型是否一致