tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshan <codevally.mail.l...@gmail.com>
Subject ClassFormatError: Duplicate method name&signature in class file
Date Thu, 01 Mar 2012 23:44:09 GMT
Hi Experts

I am trying to use OpenEJB for the unit testing purposes. Our project having
EJB2/EEJB3 entities/session beans and I am trying to cover a basic
functionality case to cover as a unit testing.

The method which I am going to test is in EJB3 session bean and having some
contacts with EJB2 beans. I used both OpenEJB 4.0.0 beta 2 and 3.1.4
versions, but the result is same. The exception I am getting is 

ERROR - Application could not be deployed:  classpath.ear
org.apache.openejb.OpenEJBException: Creating application failed:
classpath.ear: Error building bean 'CompanyEJB'.  Exception: class
java.lang.ClassFormatError: Duplicate method name&signature in class file
ope
nejb/biz/bsite/direct/entity/Company: Duplicate method name&signature in
class file openejb/biz/bsite/direct/entity/Company
        at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:679)
        at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:450)
        at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:368)
        at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:280)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:125)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:60)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:271)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:250)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
        at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
        at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
        at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
        at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
        at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)
        at
com.whispir.test.WhispirLoginTest.testLogin(WhispirLoginTest.java:30)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
        at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at $Proxy0.invoke(Unknown Source)
        at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
        at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
        at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: org.apache.openejb.OpenEJBException: Error building bean
'CompanyEJB'.  Exception: class java.lang.ClassFormatError: Duplicate method
name&signature in class file openejb/biz/bsite/direct/entity/Comp
any: Duplicate method name&signature in class file
openejb/biz/bsite/direct/entity/Company
        at
org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:64)
        at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:527)
        ... 45 more
Caused by: java.lang.ClassFormatError: Duplicate method name&signature in
class file openejb/biz/bsite/direct/entity/Company
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        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 java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at
org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.load(EnterpriseBeanBuilder.java:397)
        at
org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.loadClass(EnterpriseBeanBuilder.java:377)
        at
org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.build(EnterpriseBeanBuilder.java:241)
        at
org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:52)
        ... 46 more
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 13.133 sec
<<< FAILURE!

Could someone please explain/ give a solution to this erroneous behavior.
Many Thanks.

--
View this message in context: http://openejb.979440.n4.nabble.com/ClassFormatError-Duplicate-method-name-signature-in-class-file-tp4436889p4436889.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Mime
View raw message