"Attempted duplicate class definition for name" error in JBoss EAP 5

Solution Unverified - Updated -

Issue

  • The following exception is thrown in the server.log while deploying two .SAR packages:
WARN  [ClassLoaderManager] Unexpected error during load of:com.example.Foo
java.lang.LinkageError: loader (instance of  org/jboss/classloader/spi/base/BaseClassLoader): attempted  duplicate class definition for name: "com/example/Foo"
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:67)
    at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:633)
    at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:592)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:591)
  • Does this affect only the .SARs packaging com.example.Foo class or other deployed application packages as well?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content