[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
19 years, 7 months
[JBoss JIRA] Created: (JBSEAM-334) Examples need changes to run on JBoss 5.x
by Stan Silvert (JIRA)
Examples need changes to run on JBoss 5.x
-----------------------------------------
Key: JBSEAM-334
URL: http://jira.jboss.com/jira/browse/JBSEAM-334
Project: JBoss Seam
Issue Type: Bug
Components: Examples
Affects Versions: 1.0.1
Reporter: Stan Silvert
Fix For: 1.1
The examples need to be updated so that they can deploy and run on JBoss 5.x.
JBoss 5.x ships with the RI JSF 1.2 implementation. To get the examples to run on JBoss 5.x, you need to remove this from web.xml:
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
For JBoss 5.x, the listener for JSF 1.2 is added automatically, so you don't need to put it in web.xml.
Also, there are some third party libraries such as cglib that do not ship with JBoss 5.x. I was able to get the examples to run on JBoss 5.x by adding Seam's thridparty-all.jar to the server/default/lib directory. However, that's probably not the best way to handle the problem.
--
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
19 years, 7 months