Issue Type: Bug Bug
Affects Versions: 2.1.1.Final
Assignee: Jozef Hartinger
Components: Proxies
Created: 12/Dec/13 1:04 PM
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.

Environment: Java(TM) SE Runtime Environment (build pap3260sr1-20080416_01(SR1))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 AIX ppc-32 jvmap3260-20080415_18762 (JIT enabled, AOT enabled)
J9VM - 20080415_018762_bHdSMr
JIT - r9_20080415_1520
GC - 20080415_AA)
JCL - 20080412_01
Project: Weld
Priority: Critical Critical
Reporter: Antonin Stefanutti
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira