[jboss-jira] [JBoss JIRA] (JBAS-9517) @Singleton with @Startup do not deploy (NPE) if CDI is used

Marco Lombardo (JIRA) jira-events at lists.jboss.org
Thu Dec 6 04:06:22 EST 2012


    [ https://issues.jboss.org/browse/JBAS-9517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739854#comment-12739854 ] 

Marco Lombardo commented on JBAS-9517:
--------------------------------------

This problem occurs only if in the same jar are included also JAX-WS web services.
                
> @Singleton with @Startup do not deploy (NPE) if CDI is used
> -----------------------------------------------------------
>
>                 Key: JBAS-9517
>                 URL: https://issues.jboss.org/browse/JBAS-9517
>             Project: Application Server 3  4  5 and 6
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.1.0
>            Reporter: Marco Piraccini
>              Labels: CDI, EJB, singleton, startup, weld
>
> If a bean is annotated with @Singleton and @Startup and CDI is used this NPE is thrown:
> Caused by: java.lang.NullPointerException
> 	at org.jboss.weld.integration.instantiator.Jsr299BeanInstantiator.create(Jsr299BeanInstantiator.java:74) [:6.1.0.Final]
> 	at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:1048) [:1.7.21]
> 	at org.jboss.ejb3.stateless.StatelessContainer.createBeanContext(StatelessContainer.java:123) [:1.7.21]
> 	at org.jboss.ejb3.pool.AbstractPool.createBeanContext(AbstractPool.java:94) [:1.7.21]
> 	at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:81) [:1.7.21]
> 	at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:62) [:1.7.21]
> 	at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:57) [:1.7.21]
> 	at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:54) [:1.7.21]
> 	at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:86) [:1.7.21]
> 	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58) [:1.7.21]
> 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
> 	at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95) [:1.7.21]
> 	at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:223) [:0.0.2]
> 	... 99 more
> This happens in this cases:
> - CDI activated (e.g. beans.xml present in the bean's jar. Removing the beans.xml it deploys). 
> - If the singleton refers to other beans in other jars (injected with @EJB) which in turn use CDI.
> Removing @Startup, the deploy works. 
> This is probably related with WELD-982

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list