Hi Mark, Mark Derricutt schrieb: > Hey all, I'm noticing when ever I reload some of my bundles in our OSGi > deployment that some of the Sling bundles also get restarted, and then > trigger class loading issues around XAResource. > > We have in one of our other bundles for JTA another copy of > javax.transaction.* which is exported/imported with version 1.0.1. > > We're currently running 2.0.2-incubator of sling. Has anyone seen this > before? I've not seen any mention of it in JIRA thou...
I don't think anyone has seen this before, but I can try to explain, what is going on. The Jackrabbit API has a dependency on the javax.transaction.xa package and imports it. This dependency is wired to the best matching export, which happens to be the 1.0.1 export of your bundle. If you update that bundle, the package needs to be rewired, which is why you encounter the restarts. The problems you encounter afterwards trying to start the repository again, might be related to incorrect wiring, in that the Jackrabbit Embedded Repository bundle still seems to be relating to the old/wrong package version. Have you tried to refresh the packages ? When you install the latest Web Console (1.2.2) you can fresh the single Jackrabbit Embedded Repository bundle in the bundle list. FYI: To limit the impacts of bundle updates, it is often times advisable to separate API from implementation. This is especially the case for API which is widely used as for for example the JCR or the Jackrabbit API. You might want to do the same by creating a pure API bundle containing only your API. Hope this helps. Regards Felix > > Mark > > at > org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:913) > at java.lang.Thread.run(Thread.java:619) > 27.11.2008 13:09:47.112 *ERROR* [Repository Pinger] > org.apache.sling.jcr.jackrabbit.server startRepository: Uncaught > Throwable trying to access Repository, calling stopRepository() > (java.lang.LinkageError: loader constraint violation in interface > itable initialization: when resolving method > "org.apache.jackrabbit.core.XASessionImpl.getXAResource()Ljavax/transaction/xa/XAResource;" > the class loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) of the > current class, org/apache/jackrabbit/core/XASessionImpl, and the class > loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) for > interface org/apache/jackrabbit/api/XASession have different Class > objects for the type javax/transaction/xa/XAResource used in the > signature) java.lang.LinkageError: loader constraint violation in > interface itable initialization: when resolving method > "org.apache.jackrabbit.core.XASessionImpl.getXAResource()Ljavax/transaction/xa/XAResource;" > the class loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) of the > current class, org/apache/jackrabbit/core/XASessionImpl, and the class > loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) for > interface org/apache/jackrabbit/api/XASession have different Class > objects for the type javax/transaction/xa/XAResource used in the > signature > at > org.apache.jackrabbit.core.RepositoryImpl.createSessionInstance(RepositoryImpl.java:1346) > at > org.apache.jackrabbit.core.RepositoryImpl.createSession(RepositoryImpl.java:882) > at > org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1248) > at > org.apache.sling.jcr.base.internal.SessionPool.acquireSession(SessionPool.java:268) > at > org.apache.sling.jcr.base.internal.SessionPoolManager.login(SessionPoolManager.java:99) > at > org.apache.sling.jcr.base.AbstractSlingRepository.login(AbstractSlingRepository.java:240) > at > org.apache.sling.jcr.base.AbstractSlingRepository.loginAdministrative(AbstractSlingRepository.java:206) > at > org.apache.sling.jcr.base.AbstractSlingRepository.pingAndCheck(AbstractSlingRepository.java:501) > at > org.apache.sling.jcr.base.AbstractSlingRepository.startRepository(AbstractSlingRepository.java:804) > at > org.apache.sling.jcr.base.AbstractSlingRepository.run(AbstractSlingRepository.java:913) > at java.lang.Thread.run(Thread.java:619) > 27.11.2008 13:09:49.316 *ERROR* [Repository Pinger] > org.apache.sling.jcr.jackrabbit.server startRepository: Uncaught > Throwable trying to access Repository, calling stopRepository() > (java.lang.LinkageError: loader constraint violation in interface > itable initialization: when resolving method > "org.apache.jackrabbit.core.XASessionImpl.getXAResource()Ljavax/transaction/xa/XAResource;" > the class loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) of the > current class, org/apache/jackrabbit/core/XASessionImpl, and the class > loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) for > interface org/apache/jackrabbit/api/XASession have different Class > objects for the type javax/transaction/xa/XAResource used in the > signature) java.lang.LinkageError: loader constraint violation in > interface itable initialization: when resolving method > "org.apache.jackrabbit.core.XASessionImpl.getXAResource()Ljavax/transaction/xa/XAResource;" > the class loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) of the > current class, org/apache/jackrabbit/core/XASessionImpl, and the class > loader (instance of > org/apache/felix/framework/searchpolicy/ContentClassLoader) for > interface org/apache/jackrabbit/api/XASession have different Class > objects for the type javax/transaction/xa/XAResource used in the > signature > > > > > "It is easier to optimize correct code than to correct optimized code." -- > Bill Harlan >
