Atomikos Forum |
|
Hi,
I'm trying to get a standalone integration test to work from maven2, it uses Spring-JPA-Hibernate 3.2.6 and atomikos 3.3.3. The integration test is driven by maven's surefire plugin. The test loops infinitely however and displays below stacktrace over and over, any ideas ? I tried tinkering around with surefires classloading strategies as described here but it does change anything (http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html) Any thoughts ? Jorg java.lang.IllegalArgumentException: interface com.atomikos.datasource.pool.Reapable is not visible from class loader at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581) at com.atomikos.jdbc.AtomikosConnectionProxy.newInstance(Unknown Source) at com.atomikos.jdbc.AtomikosXAPooledConnection.doCreateConnectionProxy(Unknown Source) at com.atomikos.datasource.pool.AbstractXPooledConnection.createConnectionProxy(Unknown Source) at com.atomikos.datasource.pool.ConnectionPool.borrowConnection(Unknown Source) at com.atomikos.jdbc.AbstractDataSourceBean.getConnection(Unknown Source) at com.atomikos.jdbc.AbstractDataSourceBean.getConnection(Unknown Source) at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218) ....
I am running into the class loader issue of Reapable while running atomikos-3.3.2 with spring/hibernate/activemq configuration under jboss. I don't think this is maven specific problem.
I am still trying to figure this one out but adding a jar containing Reapable.class to jboss (in addition to WEB-INF/lib) does not help.
I changed AtomikosConnectionProxy.newInstance (line 194) to use the context classloader instead and that gets rid of the error in my case:
return (Reapable) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), interfaceClasses , proxy); However i do not know how this will behave in other environments. To be on the safe side Atomikos should probably try both mechanisms, first using the current classloader, if fail then the context classloader.
Jorg,
Many thanks for your suggested solution - this is inline with our fix. However, we were thinking the other way around: first the context loader and then the current loader. This would be conform the class loading all over the core. I assume this would work for your case too? Best |