Albi ho created WW-4548:
---------------------------

             Summary: Struts2-CDI-plugin is not able to get a reference of 
BeanManager through lookup
                 Key: WW-4548
                 URL: https://issues.apache.org/jira/browse/WW-4548
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - CDI
    Affects Versions: 2.3.24
         Environment: Weblogic 12c 
            Reporter: Albi ho
             Fix For: 2.3.x


Hello,
I'm trying to get CDI (WELD) to work on our Java EE application. We use Struts2 
as front-end framework with Action classes (as controllers). 
We want to be able to use CDI and inject into the Action classes but we have no 
success on integrating the cdi-plugin.

On weblogic server startup I get the following error:

16-Sep-2015-09:52:04  [ACTIVE] ExecuteThread: '0' for queue: 
'weblogic.kernel.Default (self-tuning)' [ERROR] InterceptorBuilder.Actual 
exception
Caught Exception while registering Interceptor class 
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor - interceptor - 
zip:D:/dev/bin/oracle/weblogic/12.1.3.0/user_projects/domains/granite_domain/servers/GraniteServer/tmp/_W
L_user/granite/dajv2g/APP-INF/lib/struts2-core-2.3.24.jar!/struts-default.xml:194:116
        at 
com.opensymphony.xwork2.factory.DefaultInterceptorFactory.buildInterceptor(DefaultInterceptorFactory.java:64)
        at 
com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:209)
        at 
com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
        at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1114)
        at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:932)


Which is caused by:

Caused by: java.lang.NullPointerException
        at 
org.apache.struts2.cdi.CdiObjectFactory.getInjectionTarget(CdiObjectFactory.java:185)
        at 
org.apache.struts2.cdi.CdiObjectFactory.buildBean(CdiObjectFactory.java:158)
        at 
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:178)
        at 
com.opensymphony.xwork2.factory.DefaultInterceptorFactory.buildInterceptor(DefaultInterceptorFactory.java:42)


I checked out the source code and I could see that the beanManager instance 
variable is NULL. This happens because none of the 3 lookups is able to get a 
reference to the BeanManager.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to