struts+hibernate项目debug总结

struts+hibernate项目debug总结转:

javax.servlet.ServletException: Cannot retrieve mapping for action /companyNewsstruts-config.xml中没有写相关companyNews的action.

============================================

在myeclipse 增加一个jar包时候,先打开项目properties,选择java build path --> libraries -->add external JARs 选择到需要的jar包,加入后,发现,他这个包加载的是绝对路径,而我们的项目需要cvs共享,无法commit到cvs服务器。myeclipse有以下提示信息:2 build path entries are missing.解决办法是,关闭myeclipse,用notepad打开项目目录下的 .classpath, 手动修改成相对路径,并且检查,指定的相对路径中是否真正添加了jar包,启动myeclipse就可以上传新添加的jar包了。

=============================================

在使用junit/StrutsTest时候,报错:java.lang.UnsupportedClassVersionError: junit/framework/TestListener (Unsupported major.minor version 49.0)原因是如果是jdk1.4的话,只能使用junit3.8以下版本,如果是使用jdk1.5的话,必须使用junit4.0以上版本。

==========================================================

Cannot find ActionMappings or ActionformBeans collection原因是:web.xml文件中没有配置struts-config.xml的相关信息。

============================================================

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application缺少jstl的相关jar和web.xml配置jstl.jar<taglib>  <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>  <taglib-location>/WEB-INF/fmt.tld</taglib-location></taglib><taglib>  <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>  <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location></taglib><taglib>  <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>  <taglib-location>/WEB-INF/c.tld</taglib-location></taglib><taglib>  <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>  <taglib-location>/WEB-INF/c-rt.tld</taglib-location></taglib><taglib>  <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>  <taglib-location>/WEB-INF/sql.tld</taglib-location></taglib><taglib>  <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>  <taglib-location>/WEB-INF/sql-rt.tld</taglib-location></taglib><taglib>  <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>  <taglib-location>/WEB-INF/x.tld</taglib-location></taglib><taglib>  <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>  <taglib-location>/WEB-INF/x-rt.tld</taglib-location></taglib>==========================================================Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLVstandard.jar没有放在lib里面===========================================================创建oracle表的时候,使用了,role和comment关键字,建议不要将这两个关键字作为表名和字段名。建议用toad或plsql developer创建表,这样软件会提示关键字。=============================================================[ERROR] XMLHelper - Error parsing XML: XML InputStream(18) Attribute name "column" associated with an element type "key" must be followed by the ' = ' character.[ERROR] Configuration - Could not configure datastore from input stream <org.dom4j.DocumentException: Error on line 18 of document : Attribute name "column" associated with an element type "key" must be followed by the ' = ' character. Nested exception: Attribute name "column" associated with an element type "key" must be followed by the ' = ' character.>org.dom4j.DocumentException: Error on line 18 of document : Attribute name "column" associated with an element type "key" must be followed by the ' = ' character. Nested exception: Attribute name "column" associated with an element type "key" must be followed by the ' = ' character.xml 语法错误,key语法中应该类似这样的写法 <key column="id">

=============================================================hibernate3,对象中一对多的one方,必须写private Set pays=new HashSet();,否则包错java.lang.NullPointerException ,而hibernate2中private Set pays;却不报错;=============================================================[DEBUG] AbstractSaveEventListener - generated identifier: 1, using strategy: org.hibernate.id.IncrementGeneratororg.hibernate.PropertyValueException: not-null property references a null or transient value: com.xxx.yyy.companyat org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)<many to one >中的设置应该设置为not-null="false" ,设置为not-null="true"则报以上错误================================================================

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.xxx.yyy.Company在save的同时也需要save其他的表,然后再flush()

=========================================================================

Parse Fatal Error at line 12 column 1struts-config.xml文件被修改,语法错误。检查语法。

========================================

org.hibernate.QueryException: could not resolve property: userid of: com.xxx.yyy.Pay使用到外键userid的时候,必须使用userinfo.userid方法才能得到。

=========================================

javax.naming.NameNotFoundException: Name hibernate_connection_factory is not bound in this Context原因:hibernate的数据库映射.xml文件有配置错误,导致hibernate_connection_factory无法绑定数据库。例如many-to-one设置了以后,仍然在其中设置相冲突的<property>属性。

==========================================

[WARN] RequestProcessor - Unhandled Exception thrown: class java.lang.NullPointerException必须将使用到的对象new起来。

============================================

GROUP BY 表达式的查询必须满足如下:select 子句后的每一项必需出现在group by 子句中,除非该项使用了聚集函数。

===========================================

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: com.xxx.yyy.Company要级联保存,多次session.save()

==============================================

java.lang.IllegalArgumentException: id to load is required for loading原因:session.load(Company.class,payForm.getCompanyId());load()方法第二个参数必须是searlizable,并且必须是和数据库映射类的属性值类型一致,即使强制转换都不行。

=============================================

[INFO] DefaultLoadEventListener - Error performing load command <org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xxx.yyy.Company#0]>org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xxx.yyy.Company#0]表示你现在查询的对象所关联的对象有问题,一般是因为数据的问题(该对象所关联的对象找不到),数据的错误,影响了程序正常执行。

========================================================

eclipse 3.1,myeclipse 4错误Deployment is out of date due to changes in the underlying project contents . You'll need to mannally 'Redeploy' the project to update the deployed archive.原因tomcat 中部署的某个文件的拒绝访问影响了部署。重启后,去除tomcat中部署的文件。重新在eclipse中设置部署。为什么需要重启?因为:google desktop软件正在对我部署的一个300MB大文件进行索引,锁定了这个大文件,我估计google desktop需要对这个文件索引半个小时以上。因此,eclipse无法对过去部署的文件,做先删除后重新部署的工作。

===================================================

ERROR LazyInitializationException:19 - could not initialize proxy - the owning Session was closedorg.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed解决办法。cmpy=(CompanyEdit)ss.load(CompanyEdit.class,companyId1);  Hibernate.initialize(cmpy);//强制初始化cmpy,否则ss.close()后,cmpy将消失.

====================================================

javascript错误行: 56字符: 45错误: 未结束的字符串常量代码: 0是编码的问题!用ANSI编码另存后就好了。

====================================================

[WARN] JDBCExceptionReporter - SQL Error: 904, SQLState: 42000[ERROR] JDBCExceptionReporter - ORA-00904: 无效列名[INFO] DefaultLoadEventListener - Error performing load command <org.hibernate.exception.SQLGrammarException: could not load an entity: [com.xxx.yyy.Sellinfo#1]>org.hibernate.exception.SQLGrammarException: could not load an entity: [com.xxx.yyy.Sellinfo#1]***.hbm.xml文件中的某个列名和数据库中的不同。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值