[EJB 3.0] - Hibernate: IDENTITY support for DB2 9.7 broken
by Juergen.Zimmermann
I'm having no problems when using DB2 Express-C 9.5.2. However, after upgrading to DB2 Express-C 9.7 Hibernate cannot handle IDENTITY columns. A stacktrace is below.
Hibernate products:
* Hibernate 3.3.1
* Hibernate Common Annotations 3.1.0
* Hibernate Annotations 3.4.0
* Hibernate EntityManager 3.4.0
Stacktrace:
javax.persistence.PersistenceException: org.hibernate.HibernateException: The database returned no natively generated identity value
| at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
| at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
| 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 org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:228)
| at $Proxy60.persist(Unknown Source)
| at de.hska.bestellverwaltung.repository.BestellverwaltungRepositoryImpl.neueBestellung(BestellverwaltungRepositoryImpl.java:177)
| 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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
| at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
| at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
| at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
| at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
| at $Proxy65.neueBestellung(Unknown Source)
| at de.hska.bestellverwaltung.service.BestellverwaltungServiceImpl.createBestellung(BestellverwaltungServiceImpl.java:188)
| 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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
| at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
| at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
| at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
| at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
| at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
| at $Proxy66.createBestellung(Unknown Source)
| at de.hska.test.BestellverwaltungTest.createBestellung(BestellverwaltungTest.java:135)
| 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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
| at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
| at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
| at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
| at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
| at org.springframework.test.context.junit4.statements.RunSpringTestContextBefores.evaluate(RunSpringTestContextBefores.java:74)
| at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
| at org.springframework.test.context.junit4.statements.RunSpringTestContextAfters.evaluate(RunSpringTestContextAfters.java:82)
| at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
| at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:210)
| at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
| at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
| at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
| at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
| at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
| at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
| at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
| at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
| Caused by: org.hibernate.HibernateException: The database returned no natively generated identity value
| at org.hibernate.id.IdentifierGeneratorFactory.getGeneratedIdentity(IdentifierGeneratorFactory.java:90)
| at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:105)
| at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2186)
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2666)
| at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
| 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.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
| at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
| at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
| at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
| at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)
| at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)
| at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)
| at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
| ... 67 more
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239286#4239286
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4239286
16 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Jboss ear deployment - resourcebundle problem
by Nadirowski
Hello, I have a strange problem with ear deployment.
I have a multi-module project. One module is being archived to war, others to jars. The war module has some resource bundles, which are used in the application via standard seam messages component. And now - when i deploy the whole application on jboss 4.2 AS as an exploaded ear achive (just put the folder my-app.ear into jboss deploy folder) everything is working fine. But when I make an normal ear archive via ant task, or even from the command prompt and deploy it, my resource bundle messages are not being resolved and i recive ie. "message_exception_nodata" instead of normal error message (which as i said appears normally when using not archived ear folder).
The main problem is that in the production enviroment i'm going to run this app at two clusters, and the ear goes into jboss farm folder, which as far as i know does work only with ear archives (exploaded directiories are not supported).
I have looked for differences in the archive and the directory, and the only difference is that archive contains manifest file, so the ant build script doesnt mess it up.
I also tried to move the resource bundles from the web module to some other modules - it didnt help, still the same problem occurs.
I tried to modify the manifest file by adding the classpath definition consisting the module with the resources, and it also did not help.
Any suggestions are warmly welcome
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239277#4239277
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4239277
16 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Scoped ClassLoading + commons-collections.jar
by Tarantul
Dear JBoss Users,
I am trying to migrate a war-application (that was already running on Tomcat) to JBoss5.1.0GA. After some revaluation of my web.xml file and some fighting with JBoss-classloading it is finally possible to deploy it. Yippee!
BUT! Now I have a following problem while running the application:
| java.lang.NoSuchMethodError: org.apache.commons.collections.CollectionUtils.isNotEmpty(Ljava/util/Collection;)Z
|
After some "investigation" I've found, that it's because of the jboss-5.1.0.GA/common/lib/commons-collections.jar version is prior to 3.2.
My application is however configured for the isolated classloading by the "jboss-classloading.xml":
| <?xml version="1.0" encoding="UTF-8"?>
|
| <classloading xmlns="urn:jboss:classloading:1.0"
| name="reportal.war"
| domain="MyWar_Domain"
| export-all="NON_EMPTY"
| import-all="false">
| </classloading>
|
Thats why I would expect my application to use a commons-collections-3.2.jar from WEB-INF/lib folder within the application war folder. What obviously is not the case.
Replacing the jboss-5.1.0.GA/common/lib/commons-collections.jar with a newer version solves the problem. It is though not really a preferred option cause of the requirement I have - in an optimal way there should be as less customization on JBoss as possible.
The question now is:
Why isn't the applications own commons-collections.jar loaded?
How do I can achieve it?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239261#4239261
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4239261
16 years, 10 months