tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From essex2014 <hamidhussain1...@gmail.com>
Subject Re: @Resource not working in tomee 1.7.4
Date Thu, 12 Jan 2017 07:07:00 GMT
I created a web project and packaged it in war file. Since I defined it in ejb-jar.xml I thought
tomee would instantiate it ?

Can u share an example for @Resource with all config files ? 

> On 11 Jan 2017, at 22:57, Romain Manni-Bucau [via TomEE & OpenEJB] <ml-node+s979440n4680876h86@n4.nabble.com>
wrote:
> 
> No 
> 
> You will need to share more cause we have a lot of tests doing that without 
> issues. 
> 
> Is it in a jar? Can it ve excluded from the scanning somehow? How is it 
> instantiated? By tomee? 
> 
> 
> Le 11 janv. 2017 23:31, "essex2014" <[hidden email]> a écrit : 
> 
> > Hi , 
> > 
> > It's an MDB and I have configured it in ejb-jar.xml and also annotated 
> > with @MessageBean 
> > 
> > Is there any other config I need to add to the MDB  to say it is managed 
> > by tomee ? 
> > 
> > > On 11 Jan 2017, at 19:13, Romain Manni-Bucau [via TomEE & OpenEJB] <

> > [hidden email]> wrote: 
> > > 
> > > Hi 
> > > 
> > > is your bean managed by tomee? is it a cdi bean, an ejb? 
> > > 
> > > 
> > > Romain Manni-Bucau 
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog 
> > > <https://blog-rmannibucau.rhcloud.com> | Old Blog 
> > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > rmannibucau> | 
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory 
> > > <https://javaeefactory-rmannibucau.rhcloud.com> 
> > > 
> > > 2017-01-11 13:28 GMT+01:00 essex2014 <[hidden email]>: 
> > > 
> > > > Hi, 
> > > > 
> > > > I am trying to inject datasource into my class using @Resource 
> > annotation. 
> > > > I 
> > > > defined the resource in tomee.xml and added the reference in both 
> > web.xml 
> > > > and resources.xml. In the class when I try to access the data source I

> > get 
> > > > null. The same code works when I try in a servlet. Any idea if I need

> > to 
> > > > add 
> > > > any other config to get this working ? 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > -- 
> > > > View this message in context: http://tomee-openejb.979440. 
> > > > n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866.html 
> > > > Sent from the TomEE Users mailing list archive at Nabble.com. 
> > > > 
> > > 
> > > 
> > > If you reply to this email, your message will be added to the discussion 
> > below: 
> > > http://tomee-openejb.979440.n4.nabble.com/Resource-not-
> > working-in-tomee-1-7-4-tp4680866p4680874.html 
> > > To unsubscribe from @Resource not working in tomee 1.7.4, click here. 
> > > NAML 
> > 
> > 
> > 
> > 
> > -- 
> > View this message in context: http://tomee-openejb.979440. 
> > n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4680875.html 
> > Sent from the TomEE Users mailing list archive at Nabble.com. 
> 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://tomee-openejb.979440.n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4680876.html
> To unsubscribe from @Resource not working in tomee 1.7.4, click here.
> NAML




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4680877.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message