[Hibernate-JIRA] Created: (HBX-967) Hibernate Exception
by lara (JIRA)
Hibernate Exception
-------------------
Key: HBX-967
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-967
Project: Hibernate Tools
Issue Type: Bug
Environment: myeclipse
Reporter: lara
Priority: Critical
hello ;please i need your helps; i have a problem in my application
org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short
at org.hibernate.id.IdentifierGeneratorFactory.createNumber(IdentifierGeneratorFactory.java:124)
at org.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:46)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:91)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
at com.marsa.data.ImmobilisationDAO.save(ImmobilisationDAO.java:31)
at com.marsa.methodes.Ajouter.enregistrer(Ajouter.java:24)
at com.marsamaroc.struts.action.AjoutAction.execute(AjoutAction.java:39)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
10:28:27,500 INFO [STDOUT] kathis id generator generates long, integer, short
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Updated: (HHH-1877) ClassNotFoundException on my entity-name in a join tag
by Roman Pichlík (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877?page=c... ]
Roman Pichlík updated HHH-1877:
-------------------------------
Attachment: testcase-HHH1877.ZIP
jUnit test case for this issue. Test will pass after applying of the patch.
> ClassNotFoundException on my entity-name in a join tag
> ------------------------------------------------------
>
> Key: HHH-1877
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3, Spring 1.2.8, Oracle 9I, Windows XP (localhost)
> Reporter: Christian Mineau
> Attachments: HHH-1877.patch, testcase-HHH1877.ZIP
>
>
> I use the attribute "entity-name" in my class mapping, this is for mapping the same object many times on table(s), and all seem to work normally. I found a problem when I tried to join a table on another class mapping, like:
> <class entity-name="categoryDefault" name="ca.cie.pak.CategoryVO" table="CATEGORY">
> <id name="id" column="CATEGORY_ID" type="java.lang.Integer">
> <generator class="native"/>
> </id>
> <property name="name" column="NAME"/>
>
> <bag name="contents" where="priority = 0">
> <key column="CATEGORY_ID" />
> <one-to-many entity-name="ContentSummary"/>
> </bag>
>
> <join table="LAYOUT_CATEGORY">
> <key foreign-key="CATEGORY_ID" column="CATEGORY_ID" />
> <property name="layoutId" column="LAYOUT_ID"/>
> </join>
> </class>
> I found a ClassNotFoundException: categoryDefault. This exception is thrown when the HbmBinder.bindJoin method is called. I see the code and it tries to instantiate a class from the getEntityName and not by the className.
> Someone can answer me if this is a XML mapping error or a real bug and what I need to do.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Updated: (HHH-1877) ClassNotFoundException on my entity-name in a join tag
by Roman Pichlík (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877?page=c... ]
Roman Pichlík updated HHH-1877:
-------------------------------
Attachment: HHH-1877.patch
Issue patch. Successfully tested on 3.2.4 SP1.
> ClassNotFoundException on my entity-name in a join tag
> ------------------------------------------------------
>
> Key: HHH-1877
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3, Spring 1.2.8, Oracle 9I, Windows XP (localhost)
> Reporter: Christian Mineau
> Attachments: HHH-1877.patch
>
>
> I use the attribute "entity-name" in my class mapping, this is for mapping the same object many times on table(s), and all seem to work normally. I found a problem when I tried to join a table on another class mapping, like:
> <class entity-name="categoryDefault" name="ca.cie.pak.CategoryVO" table="CATEGORY">
> <id name="id" column="CATEGORY_ID" type="java.lang.Integer">
> <generator class="native"/>
> </id>
> <property name="name" column="NAME"/>
>
> <bag name="contents" where="priority = 0">
> <key column="CATEGORY_ID" />
> <one-to-many entity-name="ContentSummary"/>
> </bag>
>
> <join table="LAYOUT_CATEGORY">
> <key foreign-key="CATEGORY_ID" column="CATEGORY_ID" />
> <property name="layoutId" column="LAYOUT_ID"/>
> </join>
> </class>
> I found a ClassNotFoundException: categoryDefault. This exception is thrown when the HbmBinder.bindJoin method is called. I see the code and it tries to instantiate a class from the getEntityName and not by the className.
> Someone can answer me if this is a XML mapping error or a real bug and what I need to do.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Commented: (HHH-1877) ClassNotFoundException on my entity-name in a join tag
by Roman Pichlík (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877?page=c... ]
Roman Pichlík commented on HHH-1877:
------------------------------------
Same issue on the 3.2.4. SP1. I`ve created patch see attachmet.
> ClassNotFoundException on my entity-name in a join tag
> ------------------------------------------------------
>
> Key: HHH-1877
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1877
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3, Spring 1.2.8, Oracle 9I, Windows XP (localhost)
> Reporter: Christian Mineau
>
> I use the attribute "entity-name" in my class mapping, this is for mapping the same object many times on table(s), and all seem to work normally. I found a problem when I tried to join a table on another class mapping, like:
> <class entity-name="categoryDefault" name="ca.cie.pak.CategoryVO" table="CATEGORY">
> <id name="id" column="CATEGORY_ID" type="java.lang.Integer">
> <generator class="native"/>
> </id>
> <property name="name" column="NAME"/>
>
> <bag name="contents" where="priority = 0">
> <key column="CATEGORY_ID" />
> <one-to-many entity-name="ContentSummary"/>
> </bag>
>
> <join table="LAYOUT_CATEGORY">
> <key foreign-key="CATEGORY_ID" column="CATEGORY_ID" />
> <property name="layoutId" column="LAYOUT_ID"/>
> </join>
> </class>
> I found a ClassNotFoundException: categoryDefault. This exception is thrown when the HbmBinder.bindJoin method is called. I see the code and it tries to instantiate a class from the getEntityName and not by the className.
> Someone can answer me if this is a XML mapping error or a real bug and what I need to do.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Created: (ANN-615) Inherited relationships not found in collections of subclasses of the entity containing the relationship
by Michael Newcomb (JIRA)
Inherited relationships not found in collections of subclasses of the entity containing the relationship
--------------------------------------------------------------------------------------------------------
Key: ANN-615
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-615
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Reporter: Michael Newcomb
Consider:
@Entity
public class A
{
@Id
@GeneratedValue
protected int id;
@OneToMany(mappedBy = "a")
protected Collection<C> c;
}
@Entity
public abstract class B
{
@Id
@GeneratedValue
protected int id;
@ManyToOne
protected A a;
}
@Entity
public class C
extends B
{
}
Gives the following errors upon deployment:
Caused by: org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.gd.iewtpt.isi.C.a in com.gd.iewtpt.isi.A.c
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:552)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:517)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:316)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:186)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:246)
... 7 more
I can get around this issue, but it seems there is a bug here...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Created: (HHH-2765) nonthreadsafe exception in a case where I have only the main thread
by Zied Hamdi (JIRA)
nonthreadsafe exception in a case where I have only the main thread
-------------------------------------------------------------------
Key: HHH-2765
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2765
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.3
Environment: JPA
Hibernate 3.2.3.GA
Derby 10.2.2.0
Reporter: Zied Hamdi
Priority: Blocker
Attachments: 20070802-161806 IntoJPA bug report.zip
I think it's because I do a EntityManager.clear() inside a @PreUpdate listener. But it doesn't really seam forbidden to me since em.merge can be executed on unattached objects.
I zipped all the source code, JPAMain.main() is my test case. Even though more classes are implied, I've attempted to make the code as small as possible (for what I'm trying to do).
I'll help you evolve in this bug as I can, it is really blocking to me :-/
There's an explanation of what I'm trying to do at http://forum.hibernate.org/viewtopic.php?p=2361052#2361052
here's the stack trace
Hibernate: update Person set startDate=?, endDate=?, note=?, lastOccurence=? where id=? and revision=?
2007-08-02 15:20:03,171 [main] ERROR org.hibernate.AssertionFailure.<init>(22) - 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: possible nonthreadsafe access to session
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:107)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
at main.JPAMain.save(JPAMain.java:46)
at main.JPAMain.main(JPAMain.java:19)
javax.persistence.RollbackException: Error while commiting the transaction
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
at main.JPAMain.save(JPAMain.java:46)
at main.JPAMain.main(JPAMain.java:19)
Caused by: org.hibernate.AssertionFailure: possible nonthreadsafe access to session
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:107)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
... 2 more
2007-08-02 15:20:03,203 [main] INFO org.hibernate.impl.SessionFactoryImpl.close(769) - closing
2007-08-02 15:20:03,203 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider.close(147) - cleaning up connection pool: jdbc:derby://localhost:1527/sample
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Created: (HHH-2760) Criteria Query shows too few results with ResultTransformer (DISTINCT_ROOT_ENTITY) when using MAX RESULTS and Criteria.list() on Entity with ManyToMany join
by Philip Saville (JIRA)
Criteria Query shows too few results with ResultTransformer (DISTINCT_ROOT_ENTITY) when using MAX RESULTS and Criteria.list() on Entity with ManyToMany join
------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-2760
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2760
Project: Hibernate3
Issue Type: Bug
Environment: Hibernate 3 (Hibernate-Version: 3.2.4.sp1)
MySql 4,.1 MSSQL 2000
Reporter: Philip Saville
When there is a ManyToMany join and using the criteria.list method for retrieving data, not all rows are retrieved when using maxResults (and join is set to EAGER fetch)
Role
id 1 = USER
id 2 = MANAGER
id 3 = ADMIN
User
id 1 = User --> Role.id1
id 2 = Manager --> Role.id1, Role.id2
id 3 = Admin --> Role.id1, Role.id2, Role.id3
criteria = Criteria.forClass(User.class);
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)
criteria.addOrder(Order.asc("id"))
criteria.setMaxResults(2)
List list = criteria.list();
Should see both User and Manager (expect to see all roles for each user).
Now reverse the order on id:
criteria.addOrder(Order.desc("id"))
The resulting list will only show Admin, since the max-results restriction on the fetch is calculated before the eager fetch of collections has rehydrated the entity object.
My test case actually was maxResults = 10, and I had many more users with differing numbers of Roles associated.
Another strange case (probably related):
As an attempted work-around, I tried using criteria.scroll().
The ScrollableResults object was properly transformed to the ROOT_ENTITY, but I'm not sure if I should do the "DISTINCT" part when retrieving from the result set or not, so I actually got duplicate Users in the resulting list.
When using this work around, if you order by User.name (i.e. admin, manager, user), the Admin objects (duplicated) do not have the Roles properly set (each User object had only USER role set - but Admin did show 3 times).
If you reverse the oder so Admin is not the first User in the list, then Admin's roles are populated correctly (all three roles show in each of the 3 Admin objects).
The final hurdle which makes this problem more difficult to fix is the pagination of results. If you are using "setMaxResults", you are probably also using "setFirstResult". So the correct page offset must be found when first de-duping. I think this problem is specific to the DistinctRootEntityResultTransformer but could also be an issue with other transformers. However, the transformer is not responsible for the maxResults result set limitation....
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 5 months