You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ict <ic...@gmail.com> on 2016/09/30 13:29:06 UTC

CDI Injection

Hi, i'm using vaadin on tomee 1.7.4, and i've have difficulties to @Inject to
@SessionScope into @RequestScope:
Vaadin UI in annotaded with @CDUI, then the injection works, but when
perform an async request that call a component who request an inject of a
sessionScoped bean, occur exception which warns that in requestScope context
was not found the bean in question.
I hope I have been clear.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/CDI-Injection-tp4680265.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: CDI Injection

Posted by ict <ic...@gmail.com>.
Thank you so much!



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/CDI-Injection-tp4680265p4680267.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: CDI Injection

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

this is cause the session scope only exists automatically when there is a
session ie when there is a request.

Since Vaadin uses its own threads you will need to init the session scope
(and probably request scope) yourself - deltaspike cdictrl API can help -
using the Vaadin request/session.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-09-30 15:29 GMT+02:00 ict <ic...@gmail.com>:

> Hi, i'm using vaadin on tomee 1.7.4, and i've have difficulties to @Inject
> to
> @SessionScope into @RequestScope:
> Vaadin UI in annotaded with @CDUI, then the injection works, but when
> perform an async request that call a component who request an inject of a
> sessionScoped bean, occur exception which warns that in requestScope
> context
> was not found the bean in question.
> I hope I have been clear.
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/CDI-Injection-tp4680265.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>