[ 
https://issues.jboss.org/browse/WELD-1081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675431#comment-12675431
 ] 

Sam Corbett commented on WELD-1081:
-----------------------------------

Ideally, not crash.  I'm wary of catching and logging an InternalError, but 
ignoring the problem is no good either.  Both Scala and Groovy are prone to 
this error and applications containing any code written in either risk being 
undeployable. 
                
> Weld crashes when attempting to read malformed class names
> ----------------------------------------------------------
>
>                 Key: WELD-1081
>                 URL: https://issues.jboss.org/browse/WELD-1081
>             Project: Weld
>          Issue Type: Bug
>          Components: Reflection layer
>         Environment: Weld 1.1.6-SNAPSHOT, Groovy 1.8.6
>            Reporter: Sam Corbett
>         Attachments: closure-classname.tar.gz
>
>
> The Groovy compiler generates invalid class names for classes representing a 
> Groovy closure inside an inner class (see 
> [GROOVY-5351|http://jira.codehaus.org/browse/GROOVY-5351]).  This bug causes 
> Weld to crash when calling WeldClassImpl.isAnonymousClass().  While Weld 
> can't help Groovy's behaviour, it shouldn't crash either.
> The classes we have that cause this are:
> {code}
> brooklyn.event.adapter.JmxNotificationAdapter$_NotificationPushHelper_closure1
> brooklyn.entity.basic.MethodEffector$_AnnotationsOnMethod_closure2
> brooklyn.entity.basic.MethodEffector$_AnnotationsOnMethod_closure1
> {code}
> The exception that crashes Weld is:
> {code}
> Caused by: java.lang.InternalError: Malformed class name
>       at java.lang.Class.getSimpleName(Class.java:1133) [:1.6.0_29]
>       at java.lang.Class.isAnonymousClass(Class.java:1188) [:1.6.0_29]
>       at 
> org.jboss.weld.introspector.jlr.WeldClassImpl.isAnonymousClass(WeldClassImpl.java:386)
>       at 
> org.jboss.weld.bootstrap.AbstractBeanDeployer.isTypeManagedBeanOrDecoratorOrInterceptor(AbstractBeanDeployer.java:260)
>       at 
> org.jboss.weld.bootstrap.BeanDeployer.createBeans(BeanDeployer.java:131)
>       at 
> org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:191)
>       at 
> org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336)
>       at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)
>       at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
>       at 
> org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
>       ... 4 more
> {code}
> The attached project demonstrates the problem by having Weld load the 
> following class:
> {code}
> public class ClosureClassNameTest {
>     private static class Inner {
>         def _ = [1, 2, 3].each {}
>     }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
weld-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/weld-issues

Reply via email to