compass+ssh2集成 hibernategps问题

配置信息
bean.xml

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">





class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

classpath:jdbc.properties



class="org.apache.commons.dbcp.BasicDataSource">
value="${jdbc.driverClassName}" />







class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">




com.wjj.bbsport.domain






org.hibernate.dialect.MySQLDialect

true
update








class="org.springframework.orm.hibernate3.HibernateTransactionManager">




expression="execution(public * com.wjj.bbsport.service.*.*(..))" />
advice-ref="txAdvice" />





















class="org.compass.core.CompassTemplate">







com.wjj.bbsport.domain.ProductInfo
com.wjj.bbsport.domain.ProductStyle
com.wjj.bbsport.domain.ProductType
com.wjj.bbsport.domain.Brand




file://e:/index
]]>
]]>
org.compass.spring.transaction.SpringSyncTransactionFactory

























Hibernate: insert into ProductInfo (baseprice, brandid, buyexplain, clickcount, code, commend, createdate, description, marketprice, model, name, sellcount, sellprice, sexrequest, typeid, visible, weight) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: select producttyp0_.typeid as typeid12_1_, producttyp0_.name as name12_1_, producttyp0_.note as note12_1_, producttyp0_.parentid as parentid12_1_, producttyp0_.visible as visible12_1_, producttyp1_.typeid as typeid12_0_, producttyp1_.name as name12_0_, producttyp1_.note as note12_0_, producttyp1_.parentid as parentid12_0_, producttyp1_.visible as visible12_0_ from ProductType producttyp0_ left outer join ProductType producttyp1_ on producttyp0_.parentid=producttyp1_.typeid where producttyp0_.typeid=?
Hibernate: select brand0_.code as code0_0_, brand0_.logopath as logopath0_0_, brand0_.name as name0_0_, brand0_.visible as visible0_0_ from Brand brand0_ where brand0_.code=?
17:45:11,812 ERROR org.hibernate.AssertionFailure:45 - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in com.wjj.bbsport.domain.ProductInfo entry (don't flush the Session after an exception occurs)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:78)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:187)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at org.compass.spring.transaction.SpringSyncTransaction.doCommit(SpringSyncTransaction.java:140)
at org.compass.core.transaction.AbstractTransaction.commit(AbstractTransaction.java:46)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:131)
at org.compass.core.CompassTemplate.execute(CompassTemplate.java:112)
at org.compass.gps.impl.SingleCompassGps.executeForMirror(SingleCompassGps.java:166)
at org.compass.gps.device.hibernate.lifecycle.HibernateEventListener.onPostInsert(HibernateEventListener.java:99)
at org.hibernate.action.EntityIdentityInsertAction.postInsert(EntityIdentityInsertAction.java:113)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:89)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:563)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:551)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:547)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:697)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:694)
at com.wjj.bbsport.dao.BottomDAOImpl.save(BottomDAOImpl.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at


情况:
我在修改一个产品的时候, compass 拦截了更新方法, 并建了一个index...
但是,问题发生在当我新建一个产品的时候, 就报上面的异常了。 查了二天了。 网上有的说是hibernate版本或其它一系列的问题。。 我一一试了。 但是没有效果。。
现在求大佬们给点解题思路, 谢谢。

因为并非是商业项目所以本人将源码奉上.


操作流程如下:
先输入
http://localhost:8888
登陆一下用户和密码

本人有个test 包下面有个testbuyer 的junit类。 可以运行一下, 就可以往数据库里面插入用户了。
然后输入
http://localhost:8888/control/center/default
点击
产品管理->产品管理 然后录入信息点保存


源码请到

你可能感兴趣的:(compass+ssh2集成,hibernategps问题)