2 Replies Latest reply on Dec 20, 2010 1:50 PM by jeff.howard

    Weld 1.1 beta and groovy do not play nicely together

    jeff.howard

      Hi all,


      I've been playing around with Weld 1.1 beta2 and I've run into a pretty big issue.  I have an existing JSF project that uses weld 1.0.1 and contains a number of @Named groovy beans.  When I tried running the application using the weld 1.1 betas (both 1 and 2 do this) weld is not able to instantiate the groovy beans.  If I convert the beans to java then they work just fine.  Any ideas?


      Some details:
      The application starts up normally, no errors.
      Accessing (via EL) a bean property on a groovy bean generates a stack trace that is ultimately caused by this:



      Caused by: java.lang.NullPointerException
           at com.f5.lunaui.component.test.org$jboss$weld$bean-flat-ManagedBean-class_com$f5$lunaui$component$test$TestBean1_$$_WeldClientProxy.$getStaticMetaClass(org$jboss$weld$bean-flat-ManagedBean-class_com$f5$lunaui$component$test$TestBean1_$$_WeldClientProxy.java)
           at com.f5.lunaui.component.test.TestBean1.<init>(TestBean1.groovy:12)
           at com.f5.lunaui.component.test.org$jboss$weld$bean-flat-ManagedBean-class_com$f5$lunaui$component$test$TestBean1_$$_WeldClientProxy.<init>(org$jboss$weld$bean-flat-ManagedBean-class_com$f5$lunaui$component$test$TestBean1_$$_WeldClientProxy.java)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
           at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
           at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
           at java.lang.reflect.Constructor.newInstance(Unknown Source)
           at java.lang.Class.newInstance0(Unknown Source)
           at java.lang.Class.newInstance(Unknown Source)
           at org.jboss.weld.util.reflection.SecureReflections$16.work(SecureReflections.java:396)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInstantiation(SecureReflectionAccess.java:216)
           ... 109 more




      Just to reiterate, this works fine in Weld 1.0.1


      Thanks!
      Jeff Howard