During one of my beautiful test test framework (nn free time I like doing sudoku ...) I had the idea of \u200b\u200bintroducing Hibernate 3 with JPA based application integration in the Struts2 and Spring (if you read other posts of my blog application is struts2tutorial).
The application running on Apache Tomcat, but to test my new idea I needed a transactional application server then I turned to JBoss 4.2.2 GA using the libraries provided including hibernate 3.
However after starting JBOSS and initializing the Spring bean I get an error:
[......]
java.lang.RuntimeException: java.lang.IllegalArgumentException
at javassist.util.proxy.ProxyFactory.setField(ProxyFactory.java:356)
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:339)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:312)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:271)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxyFactory(JavassistLazyInitializer.java:138)
at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.postInstantiate (JavassistProxyFactory.java: 42) at
org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory (Pojo
[.... ..]
Caused by: java.lang.IllegalArgumentException at
sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set (UnsafeStaticObjectFieldAccessorImpl.java: 61) at
java.lang.reflect.Field.set (Field.java : 656) at
javassist.util.proxy.ProxyFactory.setField (ProxyFactory.java: 352)
Problem solved and put the solution in case someone needs using Struts2, JBoss and Hibernate. The problem is not
javassist but Struts2 Struts2 of xwork or better (in my case this lib in the war). In fact it contains
javassist and creates problems with that provided by JBoss.
The ideal solution would be to download the source code of xwork, remove the package javassist and recompile everything with the libraries of JBoss. This will use the one provided by jboss. But for
+ lazy (as I did: D) just open the jar of xwork with any compression tool that supports it and delete the folder javassist.
I hope to be helpful and if I finish the project (unless it annoys me) post a tutorial.
the next!