Hi! I tried to package some "infastructure code" (CDI managed beans) in a jar and deployed it in an EAR as a utility JAR. The following exception was thrown:
Caused by: com.ibm.wsspi.injectionengine.InjectionException: Unable to obtain an instance for @Inject java.lang.reflect.Field.nameProperty: java.lang.IllegalAccessError: Class <our injected class>_$$_javassist_12 illegally accessing "package private" member of class <our injected class> at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1123) at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectableObject(InjectionBinding.java:1032) at com.ibm.wsspi.injectionengine.InjectionTarget.inject(InjectionTarget.java:125) at com.ibm.ws.injectionengine.AbstractInjectionEngine.inject(AbstractInjectionEngine.java:1084) at com.ibm.wsspi.injectionengine.InjectionUtil.createInjectedInstance(InjectionUtil.java:174) at com.ibm.ws.websvcs.server.WSServiceInstanceFactory.createServiceInstance(WSServiceInstanceFactory.java:111) at org.apache.axis2.jaxws.server.EndpointController.handleRequest(EndpointController.java:247) ... 31 more Caused by: java.lang.IllegalAccessError: Class<our injected class>_$$_javassist_12 illegally accessing "package private" member of class <our injected class> at <our injected class>_$$_javassist_12.<init>(CachingClasspathPropertyFileManager_$$_javassist_12.java) at java.lang.J9VMInternals.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1600) at org.apache.webbeans.proxy.JavassistProxyFactory.createNormalScopedBeanProxy(JavassistProxyFactory.java:219) at org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:870) at org.apache.webbeans.container.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:777) at org.apache.webbeans.inject.AbstractInjectable.inject(AbstractInjectable.java:137) at org.apache.webbeans.inject.InjectableMethods.doInjection(InjectableMethods.java:136) at org.apache.webbeans.component.ProducerMethodBean.createDefaultInstance(ProducerMethodBean.java:204) at org.apache.webbeans.component.ProducerMethodBean.createInstance(ProducerMethodBean.java:166) at org.apache.webbeans.component.AbstractOwbBean.createNewInstance(AbstractOwbBean.java:216) at org.apache.webbeans.portable.creation.AbstractProducer.produce(AbstractProducer.java:82) at org.apache.webbeans.component.InjectionTargetWrapper.produce(InjectionTargetWrapper.java:142) at org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:174) at org.apache.webbeans.context.DependentContext.getInstance(DependentContext.java:69) at org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:191) at org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:892) at org.apache.webbeans.container.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:770) at com.ibm.ws.webbeans.services.IBMBeanManagerImpl.getInjectableReference(IBMBeanManagerImpl.java:186) at com.ibm.ws.webbeans.services.InjectInjectionObjectFactory.getInjectableReference(InjectInjectionObjectFactory.java:315) at com.ibm.ws.webbeans.services.InjectInjectionObjectFactory.getObjectInstance(InjectInjectionObjectFactory.java:153) at com.ibm.ws.webbeans.services.InjectInjectionBinding.getInjectionObjectInstance(InjectInjectionBinding.java:100) at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1093) ... 37 more Where <our injected class> is a class with constructor with default access level. I tried to change the access level of the constructor and only "public" made it work. When I instead packaged the jar in the WEB-INF/lib folder of the WAR everything was working without changing the access level of the constructor. I looked for problems with Javassist and found the following JIRA https://issues.jboss.org/browse/WELD-737 Is this the problem we see here? Regards Lars-Fredrik -- Med vänlig hälsning / Best regards Lars-Fredrik Smedberg STATEMENT OF CONFIDENTIALITY: The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the address(es) and may contain confidential or privileged information. If you are not the intended recipient, please notify Lars-Fredrik Smedberg immediately at [email protected], and destroy all copies of this message and any attachments.
