You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Lars Knemeyer <la...@gmail.com> on 2014/04/22 12:47:29 UTC

CDI not working inside EAR with Atmosphere (BeanManager)

Hi,

I am currently migrating my application from javax.websocket API to the
Atmosphere framework.
Sadly this migration is now stuck because CDI is not working inside my
Atmosphere service.
At first I thought it was an Atmosphere-specific problem so I filed an issue
on the Atmosphere issue tracker:
https://github.com/Atmosphere/atmosphere/issues/1559
There the problem is described in detail and a sample project is provided.
Short story: CDI works with Atmosphere only if the application is deployed
as a WAR but not inside an EAR.

There more I dig into this issue myself, the more I believe it might not be
specifically related to Atmosphere but might be a problem with TomEE and
classloading inside EAR. (as I wrote in the github issue, the sample works
fine in WildFly 8.0.0.Final)
I also tested TomEE 1.6.0.1 and today's TomEE 1.6.1-SNAPSHOT, there the
problem also exists.

The Atmosphere code that fails to inject the beans can be found here:
https://github.com/Atmosphere/atmosphere-extensions/blob/master/cdi/modules/src/main/java/org/atmosphere/cdi/CDIObjectFactory.java
bm.getBeans() does not return any results when looking for the beans that
should be injected.

It would be great if anyone could look into this issue. Thanks in advance!

Best regards
Lars





--
View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Lars Knemeyer <la...@gmail.com>.
Got it! I simply looked in the wrong place (the website, where the version is
still 2014-04-18). Thanks again!



--
View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668968.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

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

snapshot should be up to date today (if our nightly worked as expected)

next release will be done once openjpa is released. Seems mains java 8
issues are fixed so hopefully end of next month


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-23 10:49 GMT+02:00 Lars Knemeyer <la...@gmail.com>:
> I'm happy to confirm that the issue is fixed in the latest trunk (built
> locally), at least for me and my sample.
> Romain, thank you very much for the great and quick support! :)
>
> Now I have to ask:
> Is there going to be a new official snaphot build containing the fix in the
> next days? (I don't know the schedule for them)
> And even more importantly: Are there any estimations on when there will be a
> stable release containing the fix?
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668965.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Lars Knemeyer <la...@gmail.com>.
I'm happy to confirm that the issue is fixed in the latest trunk (built
locally), at least for me and my sample.
Romain, thank you very much for the great and quick support! :)

Now I have to ask:
Is there going to be a new official snaphot build containing the fix in the
next days? (I don't know the schedule for them)
And even more importantly: Are there any estimations on when there will be a
stable release containing the fix?



--
View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668965.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm, can be URL related. Did you ask it on atmosphere forum? Our
scanning should be the same on both platforms now


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-22 18:04 GMT+02:00 Lars Knemeyer <la...@gmail.com>:
> Ok, the problem seems to be platform-related.
>
> I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and one
> Windows Server 2008 R2 (all with the latest JDK 7_55) and it failed in all
> three cases (with the described error).
> Then I started the same TomEE server (I used the same prepared zip in all
> cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as Oracle
> JDK and in both cases the sample worked without a problem (as you described
> it).
>
> So it seems to be a Windows-specific problem (I first suspected it's the
> Oracle JDK, but it works with that also on Ubuntu). I just don't know what
> to do with this finding.
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by José Luis Cetina <ma...@gmail.com>.
Issue fixed!!


2014-05-08 18:58 GMT-05:00 José Luis Cetina <ma...@gmail.com>:

> Working with any issue :)
> with apache-tomee-1.6.1-20140508.041112-152-jaxrs.zip
>
> Thanks!!!
>
>
> 2014-05-06 10:02 GMT-05:00 José Luis Cetina <ma...@gmail.com>:
>
> Ok, i will test it today.
>>
>>
>> 2014-04-24 7:28 GMT-05:00 Andy Gumbrecht <ag...@tomitribe.com>:
>>
>> I just updated and tested this on the 1.6.1-SNAPSHOT and it looks good to
>>> go, at least on a Win 8.1 machine.
>>>
>>> https://github.com/maxtorzito/tomee-codi
>>>
>>> I'll try and knock up a test.
>>>
>>> Andy.
>>>
>>>
>>> On 23/04/2014 12:26, Howard W. Smith, Jr. wrote:
>>>
>>>> José,
>>>>
>>>> When you get a chance, can you retest your test case with Romain's fix
>>>> (below), and report your test results ?
>>>>
>>>>
>>> --
>>>   Andy Gumbrecht
>>>
>>>   http://www.tomitribe.com
>>>   agumbrecht@tomitribe.com
>>>   https://twitter.com/AndyGeeDe
>>>
>>>   TomEE treibt Tomitribe! | http://tomee.apache.org
>>>
>>>
>>
>>
>> --
>> -------------------------------------------------------------------
>> *José Luis Cetina*
>> -------------------------------------------------------------------
>>
>
>
>
> --
> -------------------------------------------------------------------
> *José Luis Cetina*
> -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*José Luis Cetina*
-------------------------------------------------------------------

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by José Luis Cetina <ma...@gmail.com>.
Working with any issue :)
with apache-tomee-1.6.1-20140508.041112-152-jaxrs.zip

Thanks!!!


2014-05-06 10:02 GMT-05:00 José Luis Cetina <ma...@gmail.com>:

> Ok, i will test it today.
>
>
> 2014-04-24 7:28 GMT-05:00 Andy Gumbrecht <ag...@tomitribe.com>:
>
> I just updated and tested this on the 1.6.1-SNAPSHOT and it looks good to
>> go, at least on a Win 8.1 machine.
>>
>> https://github.com/maxtorzito/tomee-codi
>>
>> I'll try and knock up a test.
>>
>> Andy.
>>
>>
>> On 23/04/2014 12:26, Howard W. Smith, Jr. wrote:
>>
>>> José,
>>>
>>> When you get a chance, can you retest your test case with Romain's fix
>>> (below), and report your test results ?
>>>
>>>
>> --
>>   Andy Gumbrecht
>>
>>   http://www.tomitribe.com
>>   agumbrecht@tomitribe.com
>>   https://twitter.com/AndyGeeDe
>>
>>   TomEE treibt Tomitribe! | http://tomee.apache.org
>>
>>
>
>
> --
> -------------------------------------------------------------------
> *José Luis Cetina*
> -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*José Luis Cetina*
-------------------------------------------------------------------

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by José Luis Cetina <ma...@gmail.com>.
Ok, i will test it today.


2014-04-24 7:28 GMT-05:00 Andy Gumbrecht <ag...@tomitribe.com>:

> I just updated and tested this on the 1.6.1-SNAPSHOT and it looks good to
> go, at least on a Win 8.1 machine.
>
> https://github.com/maxtorzito/tomee-codi
>
> I'll try and knock up a test.
>
> Andy.
>
>
> On 23/04/2014 12:26, Howard W. Smith, Jr. wrote:
>
>> José,
>>
>> When you get a chance, can you retest your test case with Romain's fix
>> (below), and report your test results ?
>>
>>
> --
>   Andy Gumbrecht
>
>   http://www.tomitribe.com
>   agumbrecht@tomitribe.com
>   https://twitter.com/AndyGeeDe
>
>   TomEE treibt Tomitribe! | http://tomee.apache.org
>
>


-- 
-------------------------------------------------------------------
*José Luis Cetina*
-------------------------------------------------------------------

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Andy Gumbrecht <ag...@tomitribe.com>.
I just updated and tested this on the 1.6.1-SNAPSHOT and it looks good 
to go, at least on a Win 8.1 machine.

https://github.com/maxtorzito/tomee-codi

I'll try and knock up a test.

Andy.

On 23/04/2014 12:26, Howard W. Smith, Jr. wrote:
> José,
>
> When you get a chance, can you retest your test case with Romain's fix
> (below), and report your test results ?
>

-- 
   Andy Gumbrecht

   http://www.tomitribe.com
   agumbrecht@tomitribe.com
   https://twitter.com/AndyGeeDe

   TomEE treibt Tomitribe! | http://tomee.apache.org


Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
José,

When you get a chance, can you retest your test case with Romain's fix
(below), and report your test results ?



On Tue, Apr 22, 2014 at 7:17 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> surely linked to https://issues.apache.org/jira/browse/TOMEE-1183
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-04-22 18:36 GMT+02:00 José Luis Cetina <ma...@gmail.com>:
> > My tomee runs already under C:\tomee, in the related topic, i uploaded a
> > maven project that you can check it, this is a TomEE problem.
> >
> >
> > 2014-04-22 11:28 GMT-05:00 Romain Manni-Bucau <rm...@gmail.com>:
> >
> >> Well first check basic things like spaces etc, can be a hidden bug
> >> until now. Basically try to deploy in c:\tomee. If the issue is still
> >> here we'll try to have a deeper look. But we have a lot of win users
> >> and a really blocking win issue would have popped earlier I guess.
> >>
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >> 2014-04-22 18:25 GMT+02:00 José Luis Cetina <ma...@gmail.com>:
> >> > Hi, my problem was i mean IS with CODI using Windows.
> >> >
> >> > Here is the conversation:
> >> >
> >>
> http://openejb.979440.n4.nabble.com/No-bean-found-for-type-org-apache-myfaces-extensions-cdi-jsf-api-config-JsfModuleConfig-td4666654.html
> >> >
> >> > @Romain, maybe this is realted i hope you can have a windows pc for
> check
> >> > it!!
> >> >
> >> >
> >> >
> >> > 2014-04-22 11:09 GMT-05:00 Howard W. Smith, Jr. <
> smithh032772@gmail.com
> >> >:
> >> >
> >> >> Jose' can advise on this when he gets some time. Jose' is doing EARs
> +
> >> CDI
> >> >> + TomEE for some/many months now.
> >> >>
> >> >> Jose', please advise on this topic at your earliest convenience.
> >> >>
> >> >> I think Jose' had to use BeanManager and had to use the JNDI name
> >> specified
> >> >> in the tomee/catalina log when tomee starts. I could be wrong.
> >> >>
> >> >>
> >> >>
> >> >> On Tue, Apr 22, 2014 at 12:04 PM, Lars Knemeyer <
> >> lars.knemeyer@gmail.com
> >> >> >wrote:
> >> >>
> >> >> > Ok, the problem seems to be platform-related.
> >> >> >
> >> >> > I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and
> >> one
> >> >> > Windows Server 2008 R2 (all with the latest JDK 7_55) and it
> failed in
> >> >> all
> >> >> > three cases (with the described error).
> >> >> > Then I started the same TomEE server (I used the same prepared zip
> in
> >> all
> >> >> > cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as
> >> Oracle
> >> >> > JDK and in both cases the sample worked without a problem (as you
> >> >> described
> >> >> > it).
> >> >> >
> >> >> > So it seems to be a Windows-specific problem (I first suspected
> it's
> >> the
> >> >> > Oracle JDK, but it works with that also on Ubuntu). I just don't
> know
> >> >> what
> >> >> > to do with this finding.
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >> >
> >> >>
> >>
> http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
> >> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >> >> >
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > -------------------------------------------------------------------
> >> > *José Luis Cetina*
> >> > -------------------------------------------------------------------
> >>
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *José Luis Cetina*
> > -------------------------------------------------------------------
>

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
surely linked to https://issues.apache.org/jira/browse/TOMEE-1183


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-22 18:36 GMT+02:00 José Luis Cetina <ma...@gmail.com>:
> My tomee runs already under C:\tomee, in the related topic, i uploaded a
> maven project that you can check it, this is a TomEE problem.
>
>
> 2014-04-22 11:28 GMT-05:00 Romain Manni-Bucau <rm...@gmail.com>:
>
>> Well first check basic things like spaces etc, can be a hidden bug
>> until now. Basically try to deploy in c:\tomee. If the issue is still
>> here we'll try to have a deeper look. But we have a lot of win users
>> and a really blocking win issue would have popped earlier I guess.
>>
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>> 2014-04-22 18:25 GMT+02:00 José Luis Cetina <ma...@gmail.com>:
>> > Hi, my problem was i mean IS with CODI using Windows.
>> >
>> > Here is the conversation:
>> >
>> http://openejb.979440.n4.nabble.com/No-bean-found-for-type-org-apache-myfaces-extensions-cdi-jsf-api-config-JsfModuleConfig-td4666654.html
>> >
>> > @Romain, maybe this is realted i hope you can have a windows pc for check
>> > it!!
>> >
>> >
>> >
>> > 2014-04-22 11:09 GMT-05:00 Howard W. Smith, Jr. <smithh032772@gmail.com
>> >:
>> >
>> >> Jose' can advise on this when he gets some time. Jose' is doing EARs +
>> CDI
>> >> + TomEE for some/many months now.
>> >>
>> >> Jose', please advise on this topic at your earliest convenience.
>> >>
>> >> I think Jose' had to use BeanManager and had to use the JNDI name
>> specified
>> >> in the tomee/catalina log when tomee starts. I could be wrong.
>> >>
>> >>
>> >>
>> >> On Tue, Apr 22, 2014 at 12:04 PM, Lars Knemeyer <
>> lars.knemeyer@gmail.com
>> >> >wrote:
>> >>
>> >> > Ok, the problem seems to be platform-related.
>> >> >
>> >> > I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and
>> one
>> >> > Windows Server 2008 R2 (all with the latest JDK 7_55) and it failed in
>> >> all
>> >> > three cases (with the described error).
>> >> > Then I started the same TomEE server (I used the same prepared zip in
>> all
>> >> > cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as
>> Oracle
>> >> > JDK and in both cases the sample worked without a problem (as you
>> >> described
>> >> > it).
>> >> >
>> >> > So it seems to be a Windows-specific problem (I first suspected it's
>> the
>> >> > Oracle JDK, but it works with that also on Ubuntu). I just don't know
>> >> what
>> >> > to do with this finding.
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> >>
>> http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
>> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>> >> >
>> >>
>> >
>> >
>> >
>> > --
>> > -------------------------------------------------------------------
>> > *José Luis Cetina*
>> > -------------------------------------------------------------------
>>
>
>
>
> --
> -------------------------------------------------------------------
> *José Luis Cetina*
> -------------------------------------------------------------------

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by José Luis Cetina <ma...@gmail.com>.
My tomee runs already under C:\tomee, in the related topic, i uploaded a
maven project that you can check it, this is a TomEE problem.


2014-04-22 11:28 GMT-05:00 Romain Manni-Bucau <rm...@gmail.com>:

> Well first check basic things like spaces etc, can be a hidden bug
> until now. Basically try to deploy in c:\tomee. If the issue is still
> here we'll try to have a deeper look. But we have a lot of win users
> and a really blocking win issue would have popped earlier I guess.
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-04-22 18:25 GMT+02:00 José Luis Cetina <ma...@gmail.com>:
> > Hi, my problem was i mean IS with CODI using Windows.
> >
> > Here is the conversation:
> >
> http://openejb.979440.n4.nabble.com/No-bean-found-for-type-org-apache-myfaces-extensions-cdi-jsf-api-config-JsfModuleConfig-td4666654.html
> >
> > @Romain, maybe this is realted i hope you can have a windows pc for check
> > it!!
> >
> >
> >
> > 2014-04-22 11:09 GMT-05:00 Howard W. Smith, Jr. <smithh032772@gmail.com
> >:
> >
> >> Jose' can advise on this when he gets some time. Jose' is doing EARs +
> CDI
> >> + TomEE for some/many months now.
> >>
> >> Jose', please advise on this topic at your earliest convenience.
> >>
> >> I think Jose' had to use BeanManager and had to use the JNDI name
> specified
> >> in the tomee/catalina log when tomee starts. I could be wrong.
> >>
> >>
> >>
> >> On Tue, Apr 22, 2014 at 12:04 PM, Lars Knemeyer <
> lars.knemeyer@gmail.com
> >> >wrote:
> >>
> >> > Ok, the problem seems to be platform-related.
> >> >
> >> > I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and
> one
> >> > Windows Server 2008 R2 (all with the latest JDK 7_55) and it failed in
> >> all
> >> > three cases (with the described error).
> >> > Then I started the same TomEE server (I used the same prepared zip in
> all
> >> > cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as
> Oracle
> >> > JDK and in both cases the sample worked without a problem (as you
> >> described
> >> > it).
> >> >
> >> > So it seems to be a Windows-specific problem (I first suspected it's
> the
> >> > Oracle JDK, but it works with that also on Ubuntu). I just don't know
> >> what
> >> > to do with this finding.
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >> >
> >>
> http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >> >
> >>
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *José Luis Cetina*
> > -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*José Luis Cetina*
-------------------------------------------------------------------

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Well first check basic things like spaces etc, can be a hidden bug
until now. Basically try to deploy in c:\tomee. If the issue is still
here we'll try to have a deeper look. But we have a lot of win users
and a really blocking win issue would have popped earlier I guess.


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-22 18:25 GMT+02:00 José Luis Cetina <ma...@gmail.com>:
> Hi, my problem was i mean IS with CODI using Windows.
>
> Here is the conversation:
> http://openejb.979440.n4.nabble.com/No-bean-found-for-type-org-apache-myfaces-extensions-cdi-jsf-api-config-JsfModuleConfig-td4666654.html
>
> @Romain, maybe this is realted i hope you can have a windows pc for check
> it!!
>
>
>
> 2014-04-22 11:09 GMT-05:00 Howard W. Smith, Jr. <sm...@gmail.com>:
>
>> Jose' can advise on this when he gets some time. Jose' is doing EARs + CDI
>> + TomEE for some/many months now.
>>
>> Jose', please advise on this topic at your earliest convenience.
>>
>> I think Jose' had to use BeanManager and had to use the JNDI name specified
>> in the tomee/catalina log when tomee starts. I could be wrong.
>>
>>
>>
>> On Tue, Apr 22, 2014 at 12:04 PM, Lars Knemeyer <lars.knemeyer@gmail.com
>> >wrote:
>>
>> > Ok, the problem seems to be platform-related.
>> >
>> > I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and one
>> > Windows Server 2008 R2 (all with the latest JDK 7_55) and it failed in
>> all
>> > three cases (with the described error).
>> > Then I started the same TomEE server (I used the same prepared zip in all
>> > cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as Oracle
>> > JDK and in both cases the sample worked without a problem (as you
>> described
>> > it).
>> >
>> > So it seems to be a Windows-specific problem (I first suspected it's the
>> > Oracle JDK, but it works with that also on Ubuntu). I just don't know
>> what
>> > to do with this finding.
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
>> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>> >
>>
>
>
>
> --
> -------------------------------------------------------------------
> *José Luis Cetina*
> -------------------------------------------------------------------

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by José Luis Cetina <ma...@gmail.com>.
Hi, my problem was i mean IS with CODI using Windows.

Here is the conversation:
http://openejb.979440.n4.nabble.com/No-bean-found-for-type-org-apache-myfaces-extensions-cdi-jsf-api-config-JsfModuleConfig-td4666654.html

@Romain, maybe this is realted i hope you can have a windows pc for check
it!!



2014-04-22 11:09 GMT-05:00 Howard W. Smith, Jr. <sm...@gmail.com>:

> Jose' can advise on this when he gets some time. Jose' is doing EARs + CDI
> + TomEE for some/many months now.
>
> Jose', please advise on this topic at your earliest convenience.
>
> I think Jose' had to use BeanManager and had to use the JNDI name specified
> in the tomee/catalina log when tomee starts. I could be wrong.
>
>
>
> On Tue, Apr 22, 2014 at 12:04 PM, Lars Knemeyer <lars.knemeyer@gmail.com
> >wrote:
>
> > Ok, the problem seems to be platform-related.
> >
> > I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and one
> > Windows Server 2008 R2 (all with the latest JDK 7_55) and it failed in
> all
> > three cases (with the described error).
> > Then I started the same TomEE server (I used the same prepared zip in all
> > cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as Oracle
> > JDK and in both cases the sample worked without a problem (as you
> described
> > it).
> >
> > So it seems to be a Windows-specific problem (I first suspected it's the
> > Oracle JDK, but it works with that also on Ubuntu). I just don't know
> what
> > to do with this finding.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>



-- 
-------------------------------------------------------------------
*José Luis Cetina*
-------------------------------------------------------------------

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Jose' can advise on this when he gets some time. Jose' is doing EARs + CDI
+ TomEE for some/many months now.

Jose', please advise on this topic at your earliest convenience.

I think Jose' had to use BeanManager and had to use the JNDI name specified
in the tomee/catalina log when tomee starts. I could be wrong.



On Tue, Apr 22, 2014 at 12:04 PM, Lars Knemeyer <la...@gmail.com>wrote:

> Ok, the problem seems to be platform-related.
>
> I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and one
> Windows Server 2008 R2 (all with the latest JDK 7_55) and it failed in all
> three cases (with the described error).
> Then I started the same TomEE server (I used the same prepared zip in all
> cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as Oracle
> JDK and in both cases the sample worked without a problem (as you described
> it).
>
> So it seems to be a Windows-specific problem (I first suspected it's the
> Oracle JDK, but it works with that also on Ubuntu). I just don't know what
> to do with this finding.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Lars Knemeyer <la...@gmail.com>.
Ok, the problem seems to be platform-related.

I started the same TomEE 1.6.1 SNAPHOT on two Windows 7 systems and one
Windows Server 2008 R2 (all with the latest JDK 7_55) and it failed in all
three cases (with the described error).
Then I started the same TomEE server (I used the same prepared zip in all
cases) on a (virtual) Ubuntu 13.10 machine with OpenJDK as well as Oracle
JDK and in both cases the sample worked without a problem (as you described
it).

So it seems to be a Windows-specific problem (I first suspected it's the
Oracle JDK, but it works with that also on Ubuntu). I just don't know what
to do with this finding.



--
View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668948.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
checked on ubuntu from a build of your app put in apps/ of tomee trunk
(built locally).


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-22 16:27 GMT+02:00 Lars Knemeyer <la...@gmail.com>:
> That's indeed strange...
>
> Just to make sure: you deployed the
> "atmosphere-chat-cdi-ear-0.0.1-SNAPSHOT.ear" from the zip I linked in my
> second mail to TomEE's "apps" directory?
>
> I did the following:
> 1. Download and unpack TomEE from
> https://tomee.apache.org/download/tomee-1.6.1-snapshot.html
> 2. Create apps-directory and edit tomee.xml
> 3. Change logging to slf4j via log4j and configure TRACE-logging to see the
> error output.
> 4. Copy "atmosphere-chat-cdi-ear-0.0.1-SNAPSHOT.ear" to apps and run
> startup.bat
>
> These steps reproduce the error for me. (on all TomEE 1.6.X versions)
>
> I am running the server on Windows 7 x64, what platform are you using? Can
> that be an issue? There must be some difference...
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668946.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Lars Knemeyer <la...@gmail.com>.
That's indeed strange...

Just to make sure: you deployed the
"atmosphere-chat-cdi-ear-0.0.1-SNAPSHOT.ear" from the zip I linked in my
second mail to TomEE's "apps" directory?

I did the following:
1. Download and unpack TomEE from
https://tomee.apache.org/download/tomee-1.6.1-snapshot.html
2. Create apps-directory and edit tomee.xml
3. Change logging to slf4j via log4j and configure TRACE-logging to see the
error output.
4. Copy "atmosphere-chat-cdi-ear-0.0.1-SNAPSHOT.ear" to apps and run
startup.bat

These steps reproduce the error for me. (on all TomEE 1.6.X versions)

I am running the server on Windows 7 x64, what platform are you using? Can
that be an issue? There must be some difference...



--
View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668946.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Here what I get:

avr. 22, 2014 4:12:56 PM org.atmosphere.cpr.AtmosphereFramework info
Infos: Atmosphere is using async support:
org.atmosphere.container.Tomcat7Servlet30SupportWithWebSocket running
under container: Apache Tomcat (TomEE)/7.0.53 (1.6.1-SNAPSHOT) using
javax.servlet/3.0
...
avr. 22, 2014 4:12:56 PM org.apache.catalina.startup.Catalina start
Infos: Server startup in 700 ms
avr. 22, 2014 4:13:01 PM org.atmosphere.samples.chat.CDIChat onReady
Infos: Browser fd68a834-3869-4bb6-9d73-d9e278080b0a connected.
avr. 22, 2014 4:13:04 PM org.atmosphere.samples.chat.CDIChat onMessage
Infos: romain just send romain
avr. 22, 2014 4:13:09 PM org.atmosphere.samples.chat.CDIChat onMessage
Infos: romain just send message #1
avr. 22, 2014 4:13:12 PM org.atmosphere.samples.chat.CDIChat onMessage
Infos: romain just send another message
avr. 22, 2014 4:13:17 PM org.atmosphere.samples.chat.CDIChat onMessage
Infos: romain just send disconnecting
avr. 22, 2014 4:13:17 PM org.atmosphere.samples.chat.CDIChat onDisconnect
Infos: Browser fd68a834-3869-4bb6-9d73-d9e278080b0a closed the connection


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-22 15:52 GMT+02:00 Lars Knemeyer <la...@gmail.com>:
> I tried it with 1.6.0, 1.6.0.1 and the latest 1.6.1-SNAPSHOT  from
> https://tomee.apache.org/download/tomee-1.6.1-snapshot.html (The last one is
> the trunk, isn't it?).
>
> Unfortunately the relevant logs are only shown if you enable TRACE-Logging
> for "org.atmosphere" (I use slf4j via log4j).
> If you enable TRACE-Logging you should see lots of "TRACE
> [org.atmosphere.cdi.CDIObjectFactory (CDIObjectFactory.java:60)]
> (localhost-startStop-1) - Unable to find XXX. Creating the object directly."
> during deployment.
>
> You can access the running sample via
> http://localhost:8080/atmosphere-chat-cdi/. If you enter a name and press
> enter the field should stay grey because of a NullpointerException inside
> CDIChat.java (line 76), because the decoder was not injected. (see:
> https://github.com/Atmosphere/atmosphere-samples/blob/master/extensions-samples/chat-cdi/src/main/java/org/atmosphere/samples/chat/CDIChat.java#L76)
> Unfortunately this exception is also only logged at TRACE level.
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668943.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Lars Knemeyer <la...@gmail.com>.
I tried it with 1.6.0, 1.6.0.1 and the latest 1.6.1-SNAPSHOT  from
https://tomee.apache.org/download/tomee-1.6.1-snapshot.html (The last one is
the trunk, isn't it?).

Unfortunately the relevant logs are only shown if you enable TRACE-Logging
for "org.atmosphere" (I use slf4j via log4j).
If you enable TRACE-Logging you should see lots of "TRACE
[org.atmosphere.cdi.CDIObjectFactory (CDIObjectFactory.java:60)]
(localhost-startStop-1) - Unable to find XXX. Creating the object directly."
during deployment.

You can access the running sample via
http://localhost:8080/atmosphere-chat-cdi/. If you enter a name and press
enter the field should stay grey because of a NullpointerException inside
CDIChat.java (line 76), because the decoder was not injected. (see:
https://github.com/Atmosphere/atmosphere-samples/blob/master/extensions-samples/chat-cdi/src/main/java/org/atmosphere/samples/chat/CDIChat.java#L76) 
Unfortunately this exception is also only logged at TRACE level.



--
View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668943.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Romain Manni-Bucau <rm...@gmail.com>.
seems ok on trunk, did you try?


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-22 13:48 GMT+02:00 Lars Knemeyer <la...@gmail.com>:
> Hi, thanks for the quick reply!
>
> I created a sample that I attached to the original Atmosphere github issue:
> https://dl.dropboxusercontent.com/u/3063577/atmosphere-cdi-ear.zip
> It is basically just the Atmosphere CDI sample
> (https://github.com/Atmosphere/atmosphere-samples/tree/master/extensions-samples/chat-cdi)
> packaged inside an EAR.
> It can be dropped and tested inside a "fresh" TomEE server (only EAR
> deployment must be enabled in tomee.xml).
>
> Lars
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668941.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

Posted by Lars Knemeyer <la...@gmail.com>.
Hi, thanks for the quick reply!

I created a sample that I attached to the original Atmosphere github issue:
https://dl.dropboxusercontent.com/u/3063577/atmosphere-cdi-ear.zip
It is basically just the Atmosphere CDI sample
(https://github.com/Atmosphere/atmosphere-samples/tree/master/extensions-samples/chat-cdi)
packaged inside an EAR.
It can be dropped and tested inside a "fresh" TomEE server (only EAR
deployment must be enabled in tomee.xml).

Lars



--
View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939p4668941.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: CDI not working inside EAR with Atmosphere (BeanManager)

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

EAR handling of TomEE is different from other servers ATM (AFAIK it is
the choice done in CDI spec but other servers did other choice before
the discussion at spec level). We maybe have a bug but we need a
sample to have a look otherwise, out of the box, I'm tempted to say
the bug is in Atmosphere which relies on other impl behavior (well if
my phrase is ambiguous: to not 'troll' on which has the bug just
provide a sample to let Atmos and TomEE guys analyze the issue).



Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-22 12:47 GMT+02:00 Lars Knemeyer <la...@gmail.com>:
> Hi,
>
> I am currently migrating my application from javax.websocket API to the
> Atmosphere framework.
> Sadly this migration is now stuck because CDI is not working inside my
> Atmosphere service.
> At first I thought it was an Atmosphere-specific problem so I filed an issue
> on the Atmosphere issue tracker:
> https://github.com/Atmosphere/atmosphere/issues/1559
> There the problem is described in detail and a sample project is provided.
> Short story: CDI works with Atmosphere only if the application is deployed
> as a WAR but not inside an EAR.
>
> There more I dig into this issue myself, the more I believe it might not be
> specifically related to Atmosphere but might be a problem with TomEE and
> classloading inside EAR. (as I wrote in the github issue, the sample works
> fine in WildFly 8.0.0.Final)
> I also tested TomEE 1.6.0.1 and today's TomEE 1.6.1-SNAPSHOT, there the
> problem also exists.
>
> The Atmosphere code that fails to inject the beans can be found here:
> https://github.com/Atmosphere/atmosphere-extensions/blob/master/cdi/modules/src/main/java/org/atmosphere/cdi/CDIObjectFactory.java
> bm.getBeans() does not return any results when looking for the beans that
> should be injected.
>
> It would be great if anyone could look into this issue. Thanks in advance!
>
> Best regards
> Lars
>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/CDI-not-working-inside-EAR-with-Atmosphere-BeanManager-tp4668939.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.