deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gunzenreiner Simon <simon.gunzenrei...@axa-tech.com>
Subject RE: ContextControl for Weld EE
Date Thu, 22 May 2014 11:36:52 GMT
I know - but as I wrote:

contextControl.startContext(ConversationScoped.class) throws an NPE because I did not call
contextControl.startContext(RequestScoped.class), but calling the latter results in the "
IllegalStateException: WELD-001304 More than one context active for scope type  javax.enterprise.context.RequestScoped"
Exception.

I'll try your suggestion though regarding windowsScope later.

Thanks
Simon

-----Original Message-----
From: Gerhard Petracek [mailto:gerhard.petracek@gmail.com] 
Sent: Donnerstag, 22. Mai 2014 13:33
To: users@deltaspike.apache.org
Subject: Re: ContextControl for Weld EE

hi simon,

you can't use #startContexts here.
as you can see in the message, you can't start the request-scope again.
(-> use #startContext instead)

regards,
gerhard

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2014-05-22 13:02 GMT+02:00 Gunzenreiner Simon <
simon.gunzenreiner@axa-tech.com>:

> Hallo Gerhard
>
> The application starts up despite the stack trace, you are right.
>
> - starting the conversation context does not work though in my 
> scenario (timed EJB invocation), I get the following exception after 
> initializing the Conversation like this: 
> contextControl.startContexts()
>
> org.jboss.weld.exceptions.IllegalStateException: WELD-001304 More than 
> one context active for scope type 
> javax.enterprise.context.RequestScoped
> at
> org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java
> :614)
> at
> org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanI
> nstance.java:71)
> at
> org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler
> .java:104)
> at
> org.jboss.weld.proxies.Session$2059085923$Proxy$_$$_WeldClientProxy.ge
> tRootNode(Session$2059085923$Proxy$_$$_WeldClientProxy.java)
>
> - when simply starting the conversationScope with 
> startConversationScope(), I get Caused by: 
> java.lang.NullPointerException
>         at
> org.jboss.weld.context.bound.BoundConversationContextImpl.getRequestAttribute(BoundConversationContextImpl.java:34)
>         at
> org.jboss.weld.context.bound.BoundConversationContextImpl.getRequestAttribute(BoundConversationContextImpl.java:10)
>         at
> org.jboss.weld.context.AbstractConversationContext.associate(AbstractConversationContext.java:108)
>         at
> org.apache.deltaspike.cdise.weld.ContextController.startConversationScope(ContextController.java:122)
>         at
> org.apache.deltaspike.cdise.weld.WeldContextControl.startConversationScope(WeldContextControl.java:149)
>         at
> org.apache.deltaspike.cdise.weld.WeldContextControl.startContext(WeldC
> ontextControl.java:74)
>
> because the request Scope was not initialized via 
> ContextController.starRequestScope(). Doing this would result in the 
> former exception, but should not be necessary anyway, because there is 
> an active requestContext of type EjbRequestContextImpl
>
>
> Regards
> Simon
>
Mime
View raw message