Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1568

ClassFormatError exception thrown when creating bean proxy on IBM J9 VM

    XMLWordPrintable

Details

    Description

      The following exception is thrown during container initialization:

      org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Implicit Bean [javax.enterprise.inject.Instance] with qualifiers [@Default] with class interface javax.enterprise.inject.Instance using classloader java.lang.ClassLoader@3a603a60
      	at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:315)
      	at org.jboss.weld.bean.builtin.AbstractFacadeBean.initializeAfterBeanDiscovery(AbstractFacadeBean.java:60)
      	at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:129)
      	at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$AfterBeanDiscoveryInitializerFactory.doWork(ConcurrentBeanDeployer.java:120)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
      	at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:316)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:151)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:898)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:920)
      	at java.lang.Thread.run(Thread.java:735)
      Caused by: java.lang.RuntimeException: java.lang.ClassFormatError: JVMCFRE068 class name is invalid; class=org/jboss/weldx/enterprise/inject/Instance$Provider$-1193661997$Proxy$_$$_Weld$Proxy$, offset=0
      	at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:101)
      	at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:423)
      	at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:308)
      	... 10 more
      Caused by: java.lang.ClassFormatError: JVMCFRE068 class name is invalid; class=org/jboss/weldx/enterprise/inject/Instance$Provider$-1193661997$Proxy$_$$_Weld$Proxy$, offset=0
      	at java.lang.ClassLoader.defineClassImpl(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:265)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:59)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:39)
      	at java.lang.reflect.Method.invoke(Method.java:612)
      	at org.jboss.weld.util.bytecode.ClassFileUtils.toClass2(ClassFileUtils.java:108)
      	at org.jboss.weld.util.bytecode.ClassFileUtils.toClass(ClassFileUtils.java:97)
      	... 12 more
      

      It happens that the following call in org.jboss.weld.bean.proxy returns a negative hashcode:

      if (bean != null) {
          final BeanIdentifier id = Container.instance(contextId).services().get(ContextualStore.class).putIfAbsent(bean);
          name.append(Math.abs(id.hashCode()));
      }
      

      That leads to with an invalid class name.

      Attachments

        Activity

          People

            Unassigned Unassigned
            astefanu@redhat.com Antonin Stefanutti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: