本站首页    管理页面    写新日志    退出


«September 2025»
123456
78910111213
14151617181920
21222324252627
282930


公告
本博客在此声明所有文章均为转摘,只做资料收集使用。并无其他商业用途。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:210
评论数量:205
留言数量:-19
访问次数:920047
建立时间:2007年5月10日




[Hibernate]struts+hibernate项目debug总结
文章收藏,  网上资源,  软件技术,  电脑与网络

李小白 发表于 2007/8/17 10:45:27

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: Erroron 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 elementtype "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文件中的某个列名和数据库中的不同。=======================================================ConnectionManager - unclosed connection, forgot to call close() on your session?原因:没有关闭hibernate的session的transaction。或者没有关闭session=======================================================[WARN] SellCommentDAO - org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [com.xxx.yyy.SellComment#7]原因:父亲对象(one方)设置cascade="save-update" 时,直接删除子对象时,会报错,处理方法:save信息需要级联操作,delete时候也要用相同的原理。SellComment sellComment=new SellComment();sellComment = (SellComment)session.load(SellComment.class,sellCommentId);//获取儿子对象Long sellInfoId=sellComment.getSellInfo().getSellId();//获取父亲idSellInfo sellinfo=(SellInfo)session.load(SellInfo.class,sellInfoId);//获取父亲对象sellInfo.getSellComments().remove(sellComment);//断绝父子关系sellComment.setSellInfo(null);//断绝子父关系session.delete(sellComment);//删除儿子session.flush();


阅读全文(1683) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.031 second(s), page refreshed 144769089 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号