Hi,
The use of plain CDI is intentional in this case. I don't need an EJB.
Interestingly enough I did a test by changing the singleton to a
javax.ejb.Singleton
and using "@EJB" in the servlet. With the EJB packaged with "skinny war"
the injection failed with an NPR when trying to use the EJB:

2017/10/10 09:56:59.273 WARNING
[main][1][org.apache.openejb.config.JndiEncInfoBuilder.buildEjbRefs]
|Unresolved ejb reference
"java:comp/env/com.test.beanmanagerbug.MyServlet/mySingletonInjected" in
bean "test-1.0.0.Comp".  Will attempt resolution again at runtime.
2017/10/10 09:56:59.278 WARNING
[main][1][org.apache.openejb.config.JndiEncInfoBuilder.buildEjbRefs]
|Unresolved ejb reference
"java:comp/env/com.test.beanmanagerbug.MyServlet/mySingletonInjected" in
bean "/opt/tomee/apps/testear-1.0.0/test-1.0.0".  Will attempt resolution
again at runtime.

If I changed to not use skinny wars then the EJB worked fine.

Seems like skinny wars is negatively impacting openejb and openwebbeans

Paul



On 10 October 2017 at 09:30, Helge Waastad <he...@waastad.org> wrote:

> PS,
> are U sure you wanna use javax.inject.Singleton?
>
> Maybe javax.ejb.Singleton?
>
> /hw
>
> ti., 10.10.2017 kl. 08.34 +0200, skrev Paul Carter-Brown:
> > Hi,
> >
> > Loaded on github and created ticket:
> >
> > https://issues.apache.org/jira/browse/TOMEE-2134
> >
> > On 10 October 2017 at 07:56, Romain Manni-Bucau
> > m>
> > wrote:
> >
> > >
> > > Hi Paul,
> > >
> > > Did you check the instance - identity hashcode for instance? I
> > > wonder if it
> > > is not 2 instances triggered on the same event.
> > >
> > > Otherwise Andy is fully right in terms of enabling us to help you.
> > >
> > > Le 10 oct. 2017 01:25, "Andy Gumbrecht" <agumbre...@tomitribe.com>
> > > a
> > > écrit :
> > >
> > > >
> > > > Hi Paul,
> > > >
> > > > In the interest of safety first, and benefit second, please
> > > > create a
> > > > ticket here: https://issues.apache.org/jira/projects/TOMEE
> > > >
> > > > Rather than attaching a ZIP here, please consider creating a
> > > > GitHub
> > > > project and sharing it in the ticket.
> > > >
> > > > Thanks,
> > > >
> > > > Andy.
> > > >
> > > > On 09/10/17 15:00, Paul Carter-Brown wrote:
> > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > Please see attached a test project in which a simple singleton
> > > > > is being
> > > > > initialised twice (post construct is called twice). Deploy the
> > > > > ear to
> > > TomEE
> > > >
> > > > >
> > > > > (i'm using 7.0.3) and look at the logs.
> > > > >
> > > > > I picked up this issue in a large project with an ear
> > > > > containing many
> > > > > wars packaged as "skinny". The injected bean is in one of the
> > > > > shared
> > > > > libraries.
> > > > >
> > > > > If the pom in the ear project is changed to
> > > <skinnyWars>false</skinnyWars>
> > > >
> > > > >
> > > > > and lines 44-48 are removed then the issue goes away and the
> > > > > init is
> > > only
> > > >
> > > > >
> > > > > called once.
> > > > >
> > > > > Any ideas?
> > > > >
> > > > > Paul
> > > > >
> > > > >
> > > > > This email is subject to the disclaimer of Smile Communications
> > > athttp://
> > > >
> > > > >
> > > > > www.smilecoms.com/home/email-disclaimer/
> > > > >
> > > > > /email-disclaimer/>
> > > > >
> > > >
> >
> >
> > --
> >
> > *Paul Carter-Brown*
> >
> > *Group Chief Information Officer*
> >
> > *Smile Communications Pty (Ltd)       *
> > Smile +234 (0) 702 000 1234
> > Mobile +27 (0) 83 4427 179
> > Skype PaulC-B
> > paul.carter-br...@smilecoms.com
> > www.smilecoms.com
> >
>



-- 

*Paul Carter-Brown*

*Group Chief Information Officer*

*Smile Communications Pty (Ltd)       *
Smile +234 (0) 702 000 1234
Mobile +27 (0) 83 4427 179
Skype PaulC-B
paul.carter-br...@smilecoms.com
www.smilecoms.com

-- 


This email is subject to the disclaimer of Smile Communications at 
http://www.smilecoms.com/home/email-disclaimer/ 
<http://www.smilecoms.com/disclaimer>

Reply via email to