CDV ❯ LinkageError with ehcache jta & jetty (maven plugin)
-
Bug
-
Status: Resolved
-
2 Major
-
Resolution: Fixed
-
Build & Test
-
-
interfaces
-
Reporter: hsingh
-
October 21, 2010
-
0
-
Watchers: 2
-
December 03, 2013
-
December 03, 2013
Description
While running all-in-one app, got following Error when jta enabled (w/ btm 2.0.1) cache is created. And NPE when jetty is shutdown.
all-in-one war: URL:https://svn.terracotta.org/repo/internal/qa/trunk/all-in-one You might need to make ehcache-terracotta & terracotta-toolkit-1.1-runtime, non-enterprise else it will complaint for license, etc. To run w/ jetty: mvn clean package tc:run
On 8080, check for JTA sample app.
JTA:
[WARNING] [cargo] java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method
"org.terracotta.modules.ehcache.xa.EhcacheXAStoreClusteredImpl.isValid(Lnet/sf/ehcache/transaction/xa/VersionAwareCommand;Ljavax/transaction
/xa/Xid;)Z" the class loader (instance of org/terracotta/express/ClusteredStateLoader) of the current class, org/terracotta/modules/ehcache
/xa/EhcacheXAStoreClusteredImpl, and the class loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) for interface net/sf/ehcache
/transaction/xa/EhcacheXAStore have different Class objects for the type javax/transaction/xa/Xid used in the signature
[WARNING] [cargo] at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateXAStore(TerracottaClusteredInstanceFactory.java:194)
[WARNING] [cargo] at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.createXAStore(TerracottaClusteredInstanceFactory.java:125)
[WARNING] [cargo] at net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory.createXAStore(StandaloneTerracottaClusteredInstanceFactory.java:60)
[WARNING] [cargo] at net.sf.ehcache.CacheManager.createEhcacheXAStore(CacheManager.java:427)
[WARNING] [cargo] at net.sf.ehcache.Cache.initialise(Cache.java:1038)
[WARNING] [cargo] at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1010)
[WARNING] [cargo] at net.sf.ehcache.CacheManager.addCache(CacheManager.java:938)
[WARNING] [cargo] at net.sf.ehcache.CacheManager.addCache(CacheManager.java:916)
[WARNING] [cargo] at org.terracotta.ehcache.TMLookup.init(TMLookup.java:68)
[WARNING] [cargo] at javax.servlet.GenericServlet.init(GenericServlet.java:241)
[WARNING] [cargo] at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
[WARNING] [cargo] at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
[WARNING] [cargo] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
[WARNING] [cargo] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
[WARNING] [cargo] at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
[WARNING] [cargo] at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
[WARNING] [cargo] at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
[WARNING] [cargo] at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
[WARNING] [cargo] at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
[WARNING] [cargo] at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
[WARNING] [cargo] at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[WARNING] [cargo] at org.mortbay.jetty.Server.handle(Server.java:326)
[WARNING] [cargo] at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
[WARNING] [cargo] at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
[WARNING] [cargo] at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
[WARNING] [cargo] at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
[WARNING] [cargo] at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
[WARNING] [cargo] at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
[WARNING] [cargo] at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
NPE:
[WARNING] [cargo] 2010-10-20 13:18:19.673:INFO::Shutdown hook executing
[WARNING] [cargo] Exception in thread "Thread-17" java.lang.NullPointerException
[WARNING] [cargo] at net.sf.ehcache.Cache.isNodeCoherent(Cache.java:3247)
[WARNING] [cargo] at org.terracotta.modules.ehcache.coherence.CacheShutdownHook.shutdownRegisteredCaches(CacheShutdownHook.java:50)
[WARNING] [cargo] at org.terracotta.modules.ehcache.coherence.CacheShutdownHook.access$000(CacheShutdownHook.java:19)
[WARNING] [cargo] at org.terracotta.modules.ehcache.coherence.CacheShutdownHook$1.run(CacheShutdownHook.java:29)
Comments
Himadri Singh 2010-10-21
Ludovic Orban 2010-10-21
There are two problems:
1) BTM has a dependency on the Geronimo version of jta.jar (org.apache.geronimo.specs:geronimo-jms_1.1_spec) which is an exact copy of jta.jar. That’s for historical reasons, the next BTM version will depend on the official jta.jar.
2) JDK 1.5 and 1.6 come bundled with a *partial* jta.jar. If you look at those JDKs’ javax.transaction and javax.transaction.xa packages you’ll see a few of the official jta.jar interfaces there, like Xid but not TransactionManager.
The only solution that I know of is to have the full jta.jar on jetty’s classpath and nowhere else, ie: exclude the geronimo jta jar from BTM’s deps and make jta-1.1.jar provided.
Fiona OShea 2010-10-27
Is it enough to release note the issue at this point?
Fiona OShea 2011-03-02
Added here http://www.terracotta.org/confluence/display/rel/Release+Notes+Terracotta+3.5.0
This will be live when we release. This is the draft
ilevy 2013-03-22
Removing ‘docs req’d’ since it was release noted.
If jta.jar scope is provided, on runtime it complaints for it
With jta.jar it throws that LinkageError.
Could this be due to mvn jetty plugin?