[wildfly-dev] Injecting ManagedExecutorService results in NPE

Eduardo Sant´Ana da Silva eduardo.santanadasilva at gmail.com
Wed Mar 23 07:52:12 EDT 2016


Did you saw this message when deploying?

:# Message: Deployment %s contains CDI annotations but no bean archive was
not found. (No beans.xml nor class with bean defining annotations)

2016-03-23 4:24 GMT-03:00 Ingo Weiss <ingo at redhat.com>:

> On 22/03/2016 13:28, Stuart Douglas wrote:
> > Where are you trying to use these?
> >
> > Stuart
> >
> > On Wed, 23 Mar 2016, 00:18 Ingo Weiss <ingo at redhat.com
> > <mailto:ingo at redhat.com>> wrote:
> >
> >     Hi,
> >
> >     I was testing injecting the default ManagedExecutorService on WF10
> and
> >     it returns a NullPointerException if I don't do a lookup.
> >
> >     These result in a NPE:
> >
> >     @Resource
> >     private ManagedExecutorService executorService;
> >
> >     @Resource(lookup = "java:jboss/ee/concurrency/executor/default")
> >     private ManagedExecutorService executorService;
> >
> >     But this works:
> >
> >     private ManagedExecutorService executorService =
> >
>  InitialContext.doLookup("java:jboss/ee/concurrency/executor/default");
> >
> >     I didn't change any configurations on WF so far. Ideas?
> >
> >     Cheers
> >     --
> >     Ingo Weiss
> >
> >     _______________________________________________
> >     wildfly-dev mailing list
> >     wildfly-dev at lists.jboss.org <mailto:wildfly-dev at lists.jboss.org>
> >     https://lists.jboss.org/mailman/listinfo/wildfly-dev
> >
>
> Hi,
>
> Disregard this. The issue is that I forgot to add beans.xml to activate
> CDI.
>
> Cheers
> --
> Ingo Weiss
>
>
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
>



-- 
___________________________
Eduardo Sant'Ana da Silva - Ph.D.
Researcher / IT Consultant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/wildfly-dev/attachments/20160323/86e5be4e/attachment.html 


More information about the wildfly-dev mailing list