Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-84

defining a bean @Serializable will case javaassist exceptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • M1
    • M2
    • Context and Scopes
    • None

    Description

      If a bean implements the Serializable interface we get nasty javassist exceptions:

      org.apache.webbeans.exception.WebBeansException: java.lang.RuntimeException: by java.lang.ClassFormatError: Duplicate interface name in class file org/apache/webbeans/test/component/service/Typed2_$$_javassist_1
      at org.apache.webbeans.proxy.JavassistProxyFactory.createNewProxyInstance(JavassistProxyFactory.java:82)
      at org.apache.webbeans.container.ManagerImpl.getInstance(ManagerImpl.java:353)
      at org.apache.webbeans.test.mock.MockManager.getInstance(MockManager.java:139)
      at org.apache.webbeans.test.unittests.SingletonComponentTest.testTypedComponent(SingletonComponentTest.java:76)
      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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
      at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: java.lang.RuntimeException: by java.lang.ClassFormatError: Duplicate interface name in class file org/apache/webbeans/test/component/service/Typed2_$$_javassist_1
      at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:342)
      at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:312)
      at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:271)
      at org.apache.webbeans.proxy.JavassistProxyFactory.createNewProxyInstance(JavassistProxyFactory.java:77)
      ... 27 more
      Caused by: javassist.CannotCompileException: by java.lang.ClassFormatError: Duplicate interface name in class file org/apache/webbeans/test/component/service/Typed2_$$_javassist_1
      at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:169)
      at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:337)
      ... 30 more
      Caused by: java.lang.ClassFormatError: Duplicate interface name in class file org/apache/webbeans/test/component/service/Typed2_$$_javassist_1
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      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 javassist.util.proxy.FactoryHelper.toClass2(FactoryHelper.java:181)
      at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:163)
      ... 31 more

      Attachments

        Activity

          People

            struberg Mark Struberg
            struberg Mark Struberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: