Atomikos Forum

class loader issue with maven2 and 3.3.3

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)

....
Jorg Heymans Send private email
Thursday, August 28, 2008
 
 
Testing with 3.3.1 i get the same result.

In fact, in a previous constellation using Atomikos 3.1.x and Hibernate 3.2.5 i had the setup working fine, so I guess the new 3.3.3 release is assuming some other classloader setup that maven does not provide.
Jorg Heymans Send private email
Thursday, August 28, 2008
 
 
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.
Vadim Katz Send private email
Thursday, August 28, 2008
 
 
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 Heymans Send private email
Friday, August 29, 2008
 
 
This is a known bug that will be fixed in release 3.3.4 later this month. Thanks to our partner Skyway for sponsoring the fix...
Guy Pardon Send private email
Monday, September 01, 2008
 
 
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
Guy Pardon Send private email
Monday, September 01, 2008
 
 
Guy, that should work as well yes as long as both are tried when one is returning null.

I'ld be happy to test any snapshot builds if you have them, just let me know.
Jorg Heymans Send private email
Tuesday, September 02, 2008
 
 
OK thanks,

Just look out for our 3.3.4 release (should include the fix).

We don't have snapshots for maintenance releases (like 3.3.x) - only for regular releases (like 3.x) but I appreciate the offer for testing.

Cheers!
Guy Pardon Send private email
Wednesday, September 03, 2008
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics