-
1. NoSuchMethodError on jbossesb-4.8
galder.zamarreno May 6, 2011 11:12 AM (in response to changgeng)I'm not sure this is a bug. Where is that jboss common jar coming from? The core module does not depend on that any more. As part of the JBoss TS upgrade for CR1 I had to battle with this issue cos jbossjta was bringing an old jboss-logging-spi version which caused this exception. So, you might wanna check whether the old jboss-logging-spi jar is coming from.
-
2. Re: NoSuchMethodError on jbossesb-4.8
an1310 May 6, 2011 5:04 PM (in response to galder.zamarreno)We need jboss-common-core to export the cache manager to JNDI.
I still get the java.lang.NoSuchMethodError even after excluding the old jboss-logging-spi,
{code:xml}
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.2.16.GA</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>jboss-logging-spi</artifactId>
<groupId>org.jboss.logging</groupId>
</exclusion>
</exclusions>
</dependency>
{code}
EDIT: I rewrote the above application to remove the dependency on jboss-common-core, and I still get the same error.
-
3. NoSuchMethodError on jbossesb-4.8
changgeng May 7, 2011 2:03 AM (in response to changgeng)jboss-common.jar is at JBOSS_ESB_HOME/lib directory. The jboss-logging related classes are in this jar file.
Our application need to be run in jboss esb server 4.8.
-
4. NoSuchMethodError on jbossesb-4.8
galder.zamarreno May 9, 2011 8:26 AM (in response to changgeng)If the issue is due to an incompatibility between the jars Infinispan needs and the jars ESB provides, so your only solution is to isolate the deployment that uses Infinispan in order to avoid loading the wrong jboss logging jar.
-
5. Re: NoSuchMethodError on jbossesb-4.8
an1310 May 9, 2011 12:05 PM (in response to galder.zamarreno)I isolated the classloader according to http://community.jboss.org/wiki/ClassLoadingConfiguration
The SAR jboss-service.xml file looks like:
{code:xml}
<server>
<loader-repository>
org.infinispan:archive=infinispan-deployer.sar
</loader-repository>
</server>
{code}
Different NoClassDefFound issue.
{code}
Problem starting service net.beaumaris:InfinispanCacheDeployer=InfinispanCacheDeployer
java.lang.NoClassDefFoundError: org/infinispan/lifecycle/AbstractModuleLifecycle
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:690)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:670)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:200)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:527)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.infinispan.util.Util.loadClassStrict(Util.java:101)
at org.infinispan.util.ModuleProperties.resolveModuleLifecycles(ModuleProperties.java:137)
at org.infinispan.factories.AbstractComponentRegistry.<clinit>(AbstractComponentRegistry.java:107)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:257)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:232)
{code}
-
6. NoSuchMethodError on jbossesb-4.8
galder.zamarreno May 9, 2011 1:07 PM (in response to an1310)Hmmm, that could well be a bug in loadClassStrict because it does not deal with NoClassDefFoundError cases. I'll create one.
-
7. Re: NoSuchMethodError on jbossesb-4.8
an1310 May 9, 2011 3:22 PM (in response to galder.zamarreno)I have a workaround for now:
I used the Maven Shade plugin on infinispan-core/pom.xml to shade the org.jboss.logging package. Then I changed the application to use it as a provided dependency.
{code.xml}
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.jboss.logging</pattern>
<shadedPattern>org.shaded.logging</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
{code}
-
8. Re: NoSuchMethodError on jbossesb-4.8
galder.zamarreno May 27, 2011 10:12 AM (in response to an1310)Nice little plugin Erik, I wasn't aware of it though we had discussed jarjar internally. I've added this tip to http://community.jboss.org/docs/DOC-13439
-
9. Re: NoSuchMethodError on jbossesb-4.8
fatbeard Aug 26, 2012 10:57 PM (in response to changgeng)Sorry, to drag up an old thread but i've tried following the instructions you gave in that link Galder. I've downloaded infinispan 5.1.6 source. Edited the pom.xml file in the route of package. Then i ran "mvn package -Dmaven.test.skip.exec=true" to build infinispan-core.
The build ran successfully, but when I look at the resulting jars, they don't seem to have been shaded. I expect to see in the 3rd party libraries org.shaded.logging instead of org.jboss.logging, but i don't see it.
Any ideas?
The following is in the distribution profile of the pom.xml (does it matter that i ran mvn with package rather than distribution?)
config used:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.7.1</version>
<configuration>
<relocations>
<relocation>
<pattern>org.jboss.logging</pattern>
<shadedPattern>org.shaded.logging</shadedPattern>
</relocation>
<relocation>
<pattern>javax.transaction</pattern>
<shadedPattern>javax.shaded.transaction</shadedPattern>
</relocation>
<relocation>
<pattern>org.osgi</pattern>
<shadedPattern>org.shaded.osgi</shadedPattern>
</relocation>
<relocation>
<pattern>org.codehaus</pattern>
<shadedPattern>org.shaded.codehaus</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
-
10. Re: NoSuchMethodError on jbossesb-4.8
an1310 Aug 28, 2012 10:17 AM (in response to fatbeard)Hi Bryan,
Here's the POM I use for building my version of ISPN.
-
pom.xml 9.9 KB
-
-
11. Re: NoSuchMethodError on jbossesb-4.8
fatbeard Aug 28, 2012 11:53 AM (in response to an1310)Appreciated Erik, that seems to have done the job. Testing it out at the minute. I originally had the plugin under PluginManagement rather than in a Plugins element of it's own.
Brian.
-
12. Re: NoSuchMethodError on jbossesb-4.8
galder.zamarreno Aug 30, 2012 5:18 AM (in response to fatbeard)If the plugin is defined in the distribution profile, you need to run: mvn package -Pdistribution
So that the distribution profile kicks in.
-
13. Re: NoSuchMethodError on jbossesb-4.8
fatbeard Aug 30, 2012 10:21 AM (in response to galder.zamarreno)Thanks Galder, I twigged that all right after working through the maven documentation. If I recall correctly the shade plugin generated a nullpointer exception in this pom.xml. However, when i ran it from the infinispan-5.1.6/core/pom.xml in the position outlined by Erik (/project/build/plugins/plugin), it worked fine, when just building core.
Edit: Corrected the xpath used above.