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

Weld unable to proxy an initialization block

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • None
    • None
    • None

      Weld 2.2.5 unable to proxy an initialization block.
      I have a test class:
      public class testInitializationBlock{

      protected UserTransaction ut;

      {
      try

      { ut = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction"); }

      catch (NamingException e)

      { e.printStackTrace(); }

      }
      .........
      }

      I got the following exception
      Exception = java.lang.IllegalAccessError
      Source = com.xxx.getInjectionObject
      probeid = 408
      Stack Dump = java.lang.IllegalAccessError
      at web.MethodAnnotatedTestBean$Proxy$_$$_WeldSubclass.<clinit>(Unknown Source)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:85)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:541)
      at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:113)
      at org.jboss.weld.injection.ProxyClassConstructorInjectionPointWrapper.newInstance(ProxyClassConstructorInjectionPointWrapper.java:84)
      at org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:87)
      at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:74)
      at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
      at org.jboss.weld.injection.producer.InterceptorApplyingInstantiator.newInstance(InterceptorApplyingInstantiator.java:53)
      at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:116)
      at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:194)
      at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:149)
      at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
      at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:742)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:840)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:855)
      ...
      By the way, this is on IBM JDK.

              Unassigned Unassigned
              emijiang6 Emily Jiang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: