[JBoss JIRA] Created: (HIBERNATE-46) Javassist lazy proxy factoring not thread-safe
by Ortwin Glück (JIRA)
Javassist lazy proxy factoring not thread-safe
----------------------------------------------
Key: HIBERNATE-46
URL: http://jira.jboss.com/jira/browse/HIBERNATE-46
Project: Hibernate
Issue Type: Bug
Environment: JBoss AS 4.0.4 with EJB 3-RC8
Reporter: Ortwin Glück
Assigned To: Steve Ebersole
Multiple threads may simultanously (especially on SMP systems) create proxy classes for the first time. The JavassistLazyInitializer is not completely thread safe. So the first thread will successfully create the dynamic class, while a second thread may fail. We saw this happen a few times at JBoss startup when multiple messages from other systems arrived via JMS (quite normal when you take your PROD system down for some minutes, as work keeps queuing up). So multiple MDB threads were running the same transactions (using the same classes) and thus the probability for this error to occur is close to 100%.
The situation can easily be solved by proper synchronization inside the JavassistLazyInitializer.
Caused by: java.lang.RuntimeException: by java.lang.LinkageError: duplicate clas
s definition: test/BusinessOrganization_$$_javass
ist_272
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:173)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(
JavassistLazyInitializer.java:79)
... 136 more
Caused by: javassist.CannotCompileException: by java.lang.LinkageError: duplicat
e class definition: ch/logobject/mlogistics/om/resource/BusinessOrganization_$$_
javassist_272
at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:125)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:169)
... 137 more
Caused by: java.lang.LinkageError: duplicate class definition: test/BusinessOrganization_$$_javassist_272
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:117)
... 138 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 1 month
[JBoss JIRA] Created: (EJBTHREE-723) persistence.xml at EAR level ignored
by Heiko W. Rupp (JIRA)
persistence.xml at EAR level ignored
------------------------------------
Key: EJBTHREE-723
URL: http://jira.jboss.com/jira/browse/EJBTHREE-723
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC9 - FD
Environment: EJB 3.0 RC9 FD
Reporter: Heiko W. Rupp
EJB 3.0-persistence-fr says in 6.2.2:
An EJB-JAR, WAR, application client jar, or EAR can define a persistence unit.
In 6.2.1 it says : "The persistence.xml file is located in the META-INF direc-
tory of the root of the persistence unit.
So I expect the following to work
foo.ear
META-INF
persistence.xml
application.xml
bar.jar
Where bar.jar has JPA-Entities, but no persistence.xml
But RC9 just silently ignores persistence.xml and thus all Entities in bar.jar
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 1 month