You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by essex2014 <ha...@gmail.com> on 2017/01/11 12:28:30 UTC

@Resource not working in tomee 1.7.4

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.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
in debug (mvn tomee:debug) last time and first time i just added the
service in a rest endpoint


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-02-22 9:31 GMT+01:00 essex2014 <ha...@gmail.com>:

> Thanks Roman, will try this. How did you run the project after tomee:run
> ?  Do you use that tomee plugin or just open index.jsp in browser ?
>
> > On 21 Feb 2017, at 09:24, Romain Manni-Bucau [via TomEE & OpenEJB] <
> ml-node+s979440n4681127h67@n4.nabble.com> wrote:
> >
> > use this diff
> > https://gist.github.com/rmannibucau/18e9deb57968e45556a5e422ea2f0642
> >
> > and run mvn package tomee:run
> >
> >
> > 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-02-21 9:31 GMT+01:00 essex2014 <[hidden email]>:
> >
> > > Hi Roman,
> > >
> > > I still can't figure out why annotations not working.
> > >
> > > Works fine in servlet
> > > Works fine using initialcontext lookup
> > >
> > > Will u be able to generate the war file again ?
> > >
> > > > On 20 Feb 2017, at 14:25, Romain Manni-Bucau [via TomEE & OpenEJB] <
> > > [hidden email]> wrote:
> > > >
> > > > 2017-02-20 11:25 GMT+01:00 essex2014 <[hidden email]>:
> > > >
> > > > > Hi Roman/mauro2java2011,
> > > > >
> > > > > I tried both tomee.xml and context.xml and I define in either of
> them.
> > > > >
> > > > > I think the problem is with common annotations version. I am using
> jdk
> > > 1.8
> > > > > which I guess implements 1.2 commons annotations. Any idea if tomee
> > > > > supports this ?
> > > > >
> > > > >
> > > > it does
> > > >
> > > >
> > > > > Also, how can use endorsed dirs with tomee maven plugin ? I noticed
> > > that
> > > > > endorsed jars are not being copied when we execute tomee:run
> > > > >
> > > > >
> > > > yes but this is not that - using tomee 1.7 with java 8 everyday
> there and
> > > > never got that issue
> > > >
> > > >
> > > > > > On 19 Feb 2017, at 09:38, mauro2java2011 [via TomEE & OpenEJB] <
> > > > > [hidden email]> wrote:
> > > > > >
> > > > > > I Re ad from your post:
> > > > > >
> > > > > > "configured the testDS in context.xml "
> > > > > >
> > > > > > The datasourcevis already configurate into tomee.xml
> > > > > >
> > > > > > Remo ve it from context.xml.
> > > > > >
> > > > > > 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-tp4680866p4681123.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-
> > > tp4680866p4681124.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-tp4680866p4681125.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-
> tp4680866p4681126.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-tp4680866p4681127.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-tp4680866p4681130.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
Thanks Roman, will try this. How did you run the project after tomee:run ?  Do you use that tomee plugin or just open index.jsp in browser ?

> On 21 Feb 2017, at 09:24, Romain Manni-Bucau [via TomEE & OpenEJB] <ml...@n4.nabble.com> wrote:
> 
> use this diff 
> https://gist.github.com/rmannibucau/18e9deb57968e45556a5e422ea2f0642
> 
> and run mvn package tomee:run 
> 
> 
> 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-02-21 9:31 GMT+01:00 essex2014 <[hidden email]>: 
> 
> > Hi Roman, 
> > 
> > I still can't figure out why annotations not working. 
> > 
> > Works fine in servlet 
> > Works fine using initialcontext lookup 
> > 
> > Will u be able to generate the war file again ? 
> > 
> > > On 20 Feb 2017, at 14:25, Romain Manni-Bucau [via TomEE & OpenEJB] < 
> > [hidden email]> wrote: 
> > > 
> > > 2017-02-20 11:25 GMT+01:00 essex2014 <[hidden email]>: 
> > > 
> > > > Hi Roman/mauro2java2011, 
> > > > 
> > > > I tried both tomee.xml and context.xml and I define in either of them. 
> > > > 
> > > > I think the problem is with common annotations version. I am using jdk 
> > 1.8 
> > > > which I guess implements 1.2 commons annotations. Any idea if tomee 
> > > > supports this ? 
> > > > 
> > > > 
> > > it does 
> > > 
> > > 
> > > > Also, how can use endorsed dirs with tomee maven plugin ? I noticed 
> > that 
> > > > endorsed jars are not being copied when we execute tomee:run 
> > > > 
> > > > 
> > > yes but this is not that - using tomee 1.7 with java 8 everyday there and 
> > > never got that issue 
> > > 
> > > 
> > > > > On 19 Feb 2017, at 09:38, mauro2java2011 [via TomEE & OpenEJB] < 
> > > > [hidden email]> wrote: 
> > > > > 
> > > > > I Re ad from your post: 
> > > > > 
> > > > > "configured the testDS in context.xml " 
> > > > > 
> > > > > The datasourcevis already configurate into tomee.xml 
> > > > > 
> > > > > Remo ve it from context.xml. 
> > > > > 
> > > > > 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-tp4680866p4681123.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- 
> > tp4680866p4681124.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-tp4680866p4681125.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-tp4680866p4681126.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-tp4680866p4681127.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-tp4680866p4681130.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
use this diff
https://gist.github.com/rmannibucau/18e9deb57968e45556a5e422ea2f0642

and run mvn package tomee:run


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-02-21 9:31 GMT+01:00 essex2014 <ha...@gmail.com>:

> Hi Roman,
>
> I still can't figure out why annotations not working.
>
> Works fine in servlet
> Works fine using initialcontext lookup
>
> Will u be able to generate the war file again ?
>
> > On 20 Feb 2017, at 14:25, Romain Manni-Bucau [via TomEE & OpenEJB] <
> ml-node+s979440n4681125h5@n4.nabble.com> wrote:
> >
> > 2017-02-20 11:25 GMT+01:00 essex2014 <[hidden email]>:
> >
> > > Hi Roman/mauro2java2011,
> > >
> > > I tried both tomee.xml and context.xml and I define in either of them.
> > >
> > > I think the problem is with common annotations version. I am using jdk
> 1.8
> > > which I guess implements 1.2 commons annotations. Any idea if tomee
> > > supports this ?
> > >
> > >
> > it does
> >
> >
> > > Also, how can use endorsed dirs with tomee maven plugin ? I noticed
> that
> > > endorsed jars are not being copied when we execute tomee:run
> > >
> > >
> > yes but this is not that - using tomee 1.7 with java 8 everyday there and
> > never got that issue
> >
> >
> > > > On 19 Feb 2017, at 09:38, mauro2java2011 [via TomEE & OpenEJB] <
> > > [hidden email]> wrote:
> > > >
> > > > I Re ad from your post:
> > > >
> > > > "configured the testDS in context.xml "
> > > >
> > > > The datasourcevis already configurate into tomee.xml
> > > >
> > > > Remo ve it from context.xml.
> > > >
> > > > 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-tp4680866p4681123.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-
> tp4680866p4681124.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-tp4680866p4681125.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-tp4680866p4681126.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
Hi Roman,

I still can't figure out why annotations not working.

Works fine in servlet
Works fine using initialcontext lookup

Will u be able to generate the war file again ?

> On 20 Feb 2017, at 14:25, Romain Manni-Bucau [via TomEE & OpenEJB] <ml...@n4.nabble.com> wrote:
> 
> 2017-02-20 11:25 GMT+01:00 essex2014 <[hidden email]>: 
> 
> > Hi Roman/mauro2java2011, 
> > 
> > I tried both tomee.xml and context.xml and I define in either of them. 
> > 
> > I think the problem is with common annotations version. I am using jdk 1.8 
> > which I guess implements 1.2 commons annotations. Any idea if tomee 
> > supports this ? 
> > 
> > 
> it does 
> 
> 
> > Also, how can use endorsed dirs with tomee maven plugin ? I noticed that 
> > endorsed jars are not being copied when we execute tomee:run 
> > 
> > 
> yes but this is not that - using tomee 1.7 with java 8 everyday there and 
> never got that issue 
> 
> 
> > > On 19 Feb 2017, at 09:38, mauro2java2011 [via TomEE & OpenEJB] < 
> > [hidden email]> wrote: 
> > > 
> > > I Re ad from your post: 
> > > 
> > > "configured the testDS in context.xml " 
> > > 
> > > The datasourcevis already configurate into tomee.xml 
> > > 
> > > Remo ve it from context.xml. 
> > > 
> > > 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-tp4680866p4681123.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-tp4680866p4681124.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-tp4680866p4681125.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-tp4680866p4681126.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2017-02-20 11:25 GMT+01:00 essex2014 <ha...@gmail.com>:

> Hi Roman/mauro2java2011,
>
> I tried both tomee.xml and context.xml and I define in either of them.
>
> I think the problem is with common annotations version. I am using jdk 1.8
> which I guess implements 1.2 commons annotations. Any idea if tomee
> supports this ?
>
>
it does


> Also, how can use endorsed dirs with tomee maven plugin ? I noticed that
> endorsed jars are not being copied when we execute tomee:run
>
>
yes but this is not that - using tomee 1.7 with java 8 everyday there and
never got that issue


> > On 19 Feb 2017, at 09:38, mauro2java2011 [via TomEE & OpenEJB] <
> ml-node+s979440n4681123h43@n4.nabble.com> wrote:
> >
> > I Re ad from your post:
> >
> > "configured the testDS in context.xml "
> >
> > The datasourcevis already configurate into tomee.xml
> >
> > Remo ve it from context.xml.
> >
> > 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-tp4680866p4681123.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-tp4680866p4681124.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
Hi Roman/mauro2java2011,

I tried both tomee.xml and context.xml and I define in either of them.

I think the problem is with common annotations version. I am using jdk 1.8 which I guess implements 1.2 commons annotations. Any idea if tomee supports this ?

Also, how can use endorsed dirs with tomee maven plugin ? I noticed that endorsed jars are not being copied when we execute tomee:run 

> On 19 Feb 2017, at 09:38, mauro2java2011 [via TomEE & OpenEJB] <ml...@n4.nabble.com> wrote:
> 
> I Re ad from your post: 
> 
> "configured the testDS in context.xml " 
> 
> The datasourcevis already configurate into tomee.xml 
> 
> Remo ve it from context.xml. 
> 
> 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-tp4680866p4681123.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-tp4680866p4681124.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by mauro2java2011 <ma...@gmail.com>.
I Re ad from your post:

"configured the testDS in context.xml "

The datasourcevis already configurate into tomee.xml

Remo ve it from context.xml.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4681123.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
plus I think


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-02-17 10:58 GMT+01:00 essex2014 <ha...@gmail.com>:

> Which tomeeClassifier did u use for the tomee plugin ? I have deleted all
> parent pom details and just running Webaap1. I configured the testDS in
> context.xml
>
> > On 16 Feb 2017, at 15:24, Romain Manni-Bucau [via TomEE & OpenEJB] <
> ml-node+s979440n4681106h16@n4.nabble.com> wrote:
> >
> > don't have it anymore (tested in /tmp) but removed the parent and fixed
> the
> > version and finally added tomee-maven-plugin 1.7.4 and that's it
> >
> > can be a side effect of your parent pom maybe
> >
> >
> > 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-02-16 11:58 GMT+01:00 essex2014 <[hidden email]>:
> >
> > > I did exactly same but still the data source is null. I tried with jdk
> 1.6
> > > and 1.8 as well but no success. Can u share the war file for my
> example ?
> > > Just want to compare
> > >
> > > > On 15 Feb 2017, at 14:48, Romain Manni-Bucau [via TomEE & OpenEJB] <
> > > [hidden email]> wrote:
> > > >
> > > > just added tomee-maven-plugin version 1.7.4 to your pom and ran mvn
> > > > tomee:run
> > > >
> > > >
> > > > 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-02-15 11:12 GMT+01:00 essex2014 <[hidden email]>:
> > > >
> > > > > Hi Roman,
> > > > >
> > > > > That's really strange. Can u share me the war file you created ?
> Did u
> > > > > copy it into webapps folder in tomee ? I did not add any other jar
> to
> > > my
> > > > > tomee installation, just the defaults
> > > > >
> > > > > > On 13 Feb 2017, at 13:03, Romain Manni-Bucau [via TomEE &
> OpenEJB] <
> > > > > [hidden email]> wrote:
> > > > > >
> > > > > > tested on 1.7.4 and got
> > > > > >
> > > > > > INFOS - Server startup in 2026 ms
> > > > > > Received:
> > > > > > DataSource injected:
> > > > > > org.apache.openejb.resource.jdbc.managed.local.
> > > > > ManagedDataSource@4f5991f6
> > > > > >
> > > > > >
> > > > > > can it be a naming issue of a dependency of something like that?
> > > > > >
> > > > > >
> > > > > > 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-02-13 12:57 GMT+01:00 essex2014 <[hidden email]>:
> > > > > >
> > > > > > > Hi Roman,
> > > > > > >
> > > > > > > I have defined it in tomee.xml file. The file is committed in
> > > GitHub
> > > > > for
> > > > > > > reference.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > View this message in context: http://tomee-openejb.979440.
> > > > > > > n4.nabble.com/Resource-not-working-in-tomee-1-7-4-
> > > > > tp4680866p4681076.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-tp4680866p4681081.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-
> > > tp4680866p4681097.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-tp4680866p4681102.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-
> tp4680866p4681105.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-tp4680866p4681106.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-tp4680866p4681108.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
Which tomeeClassifier did u use for the tomee plugin ? I have deleted all parent pom details and just running Webaap1. I configured the testDS in context.xml 

> On 16 Feb 2017, at 15:24, Romain Manni-Bucau [via TomEE & OpenEJB] <ml...@n4.nabble.com> wrote:
> 
> don't have it anymore (tested in /tmp) but removed the parent and fixed the 
> version and finally added tomee-maven-plugin 1.7.4 and that's it 
> 
> can be a side effect of your parent pom maybe 
> 
> 
> 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-02-16 11:58 GMT+01:00 essex2014 <[hidden email]>: 
> 
> > I did exactly same but still the data source is null. I tried with jdk 1.6 
> > and 1.8 as well but no success. Can u share the war file for my example ? 
> > Just want to compare 
> > 
> > > On 15 Feb 2017, at 14:48, Romain Manni-Bucau [via TomEE & OpenEJB] < 
> > [hidden email]> wrote: 
> > > 
> > > just added tomee-maven-plugin version 1.7.4 to your pom and ran mvn 
> > > tomee:run 
> > > 
> > > 
> > > 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-02-15 11:12 GMT+01:00 essex2014 <[hidden email]>: 
> > > 
> > > > Hi Roman, 
> > > > 
> > > > That's really strange. Can u share me the war file you created ? Did u 
> > > > copy it into webapps folder in tomee ? I did not add any other jar to 
> > my 
> > > > tomee installation, just the defaults 
> > > > 
> > > > > On 13 Feb 2017, at 13:03, Romain Manni-Bucau [via TomEE & OpenEJB] < 
> > > > [hidden email]> wrote: 
> > > > > 
> > > > > tested on 1.7.4 and got 
> > > > > 
> > > > > INFOS - Server startup in 2026 ms 
> > > > > Received: 
> > > > > DataSource injected: 
> > > > > org.apache.openejb.resource.jdbc.managed.local. 
> > > > ManagedDataSource@4f5991f6 
> > > > > 
> > > > > 
> > > > > can it be a naming issue of a dependency of something like that? 
> > > > > 
> > > > > 
> > > > > 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-02-13 12:57 GMT+01:00 essex2014 <[hidden email]>: 
> > > > > 
> > > > > > Hi Roman, 
> > > > > > 
> > > > > > I have defined it in tomee.xml file. The file is committed in 
> > GitHub 
> > > > for 
> > > > > > reference. 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > -- 
> > > > > > View this message in context: http://tomee-openejb.979440. 
> > > > > > n4.nabble.com/Resource-not-working-in-tomee-1-7-4- 
> > > > tp4680866p4681076.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-tp4680866p4681081.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- 
> > tp4680866p4681097.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-tp4680866p4681102.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-tp4680866p4681105.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-tp4680866p4681106.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-tp4680866p4681108.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
don't have it anymore (tested in /tmp) but removed the parent and fixed the
version and finally added tomee-maven-plugin 1.7.4 and that's it

can be a side effect of your parent pom maybe


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-02-16 11:58 GMT+01:00 essex2014 <ha...@gmail.com>:

> I did exactly same but still the data source is null. I tried with jdk 1.6
> and 1.8 as well but no success. Can u share the war file for my example ?
> Just want to compare
>
> > On 15 Feb 2017, at 14:48, Romain Manni-Bucau [via TomEE & OpenEJB] <
> ml-node+s979440n4681102h92@n4.nabble.com> wrote:
> >
> > just added tomee-maven-plugin version 1.7.4 to your pom and ran mvn
> > tomee:run
> >
> >
> > 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-02-15 11:12 GMT+01:00 essex2014 <[hidden email]>:
> >
> > > Hi Roman,
> > >
> > > That's really strange. Can u share me the war file you created ? Did u
> > > copy it into webapps folder in tomee ? I did not add any other jar to
> my
> > > tomee installation, just the defaults
> > >
> > > > On 13 Feb 2017, at 13:03, Romain Manni-Bucau [via TomEE & OpenEJB] <
> > > [hidden email]> wrote:
> > > >
> > > > tested on 1.7.4 and got
> > > >
> > > > INFOS - Server startup in 2026 ms
> > > > Received:
> > > > DataSource injected:
> > > > org.apache.openejb.resource.jdbc.managed.local.
> > > ManagedDataSource@4f5991f6
> > > >
> > > >
> > > > can it be a naming issue of a dependency of something like that?
> > > >
> > > >
> > > > 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-02-13 12:57 GMT+01:00 essex2014 <[hidden email]>:
> > > >
> > > > > Hi Roman,
> > > > >
> > > > > I have defined it in tomee.xml file. The file is committed in
> GitHub
> > > for
> > > > > reference.
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context: http://tomee-openejb.979440.
> > > > > n4.nabble.com/Resource-not-working-in-tomee-1-7-4-
> > > tp4680866p4681076.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-tp4680866p4681081.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-
> tp4680866p4681097.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-tp4680866p4681102.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-tp4680866p4681105.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
I did exactly same but still the data source is null. I tried with jdk 1.6 and 1.8 as well but no success. Can u share the war file for my example ? Just want to compare

> On 15 Feb 2017, at 14:48, Romain Manni-Bucau [via TomEE & OpenEJB] <ml...@n4.nabble.com> wrote:
> 
> just added tomee-maven-plugin version 1.7.4 to your pom and ran mvn 
> tomee:run 
> 
> 
> 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-02-15 11:12 GMT+01:00 essex2014 <[hidden email]>: 
> 
> > Hi Roman, 
> > 
> > That's really strange. Can u share me the war file you created ? Did u 
> > copy it into webapps folder in tomee ? I did not add any other jar to my 
> > tomee installation, just the defaults 
> > 
> > > On 13 Feb 2017, at 13:03, Romain Manni-Bucau [via TomEE & OpenEJB] < 
> > [hidden email]> wrote: 
> > > 
> > > tested on 1.7.4 and got 
> > > 
> > > INFOS - Server startup in 2026 ms 
> > > Received: 
> > > DataSource injected: 
> > > org.apache.openejb.resource.jdbc.managed.local. 
> > ManagedDataSource@4f5991f6 
> > > 
> > > 
> > > can it be a naming issue of a dependency of something like that? 
> > > 
> > > 
> > > 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-02-13 12:57 GMT+01:00 essex2014 <[hidden email]>: 
> > > 
> > > > Hi Roman, 
> > > > 
> > > > I have defined it in tomee.xml file. The file is committed in GitHub 
> > for 
> > > > reference. 
> > > > 
> > > > 
> > > > 
> > > > -- 
> > > > View this message in context: http://tomee-openejb.979440. 
> > > > n4.nabble.com/Resource-not-working-in-tomee-1-7-4- 
> > tp4680866p4681076.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-tp4680866p4681081.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-tp4680866p4681097.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-tp4680866p4681102.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-tp4680866p4681105.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
just added tomee-maven-plugin version 1.7.4 to your pom and ran mvn
tomee:run


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-02-15 11:12 GMT+01:00 essex2014 <ha...@gmail.com>:

> Hi Roman,
>
> That's really strange. Can u share me the war file you created ? Did u
> copy it into webapps folder in tomee ? I did not add any other jar to my
> tomee installation, just the defaults
>
> > On 13 Feb 2017, at 13:03, Romain Manni-Bucau [via TomEE & OpenEJB] <
> ml-node+s979440n4681081h41@n4.nabble.com> wrote:
> >
> > tested on 1.7.4 and got
> >
> > INFOS - Server startup in 2026 ms
> > Received:
> > DataSource injected:
> > org.apache.openejb.resource.jdbc.managed.local.
> ManagedDataSource@4f5991f6
> >
> >
> > can it be a naming issue of a dependency of something like that?
> >
> >
> > 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-02-13 12:57 GMT+01:00 essex2014 <[hidden email]>:
> >
> > > Hi Roman,
> > >
> > > I have defined it in tomee.xml file. The file is committed in GitHub
> for
> > > reference.
> > >
> > >
> > >
> > > --
> > > View this message in context: http://tomee-openejb.979440.
> > > n4.nabble.com/Resource-not-working-in-tomee-1-7-4-
> tp4680866p4681076.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-tp4680866p4681081.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-tp4680866p4681097.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
Hi Roman,

That's really strange. Can u share me the war file you created ? Did u copy it into webapps folder in tomee ? I did not add any other jar to my tomee installation, just the defaults

> On 13 Feb 2017, at 13:03, Romain Manni-Bucau [via TomEE & OpenEJB] <ml...@n4.nabble.com> wrote:
> 
> tested on 1.7.4 and got 
> 
> INFOS - Server startup in 2026 ms 
> Received: 
> DataSource injected: 
> org.apache.openejb.resource.jdbc.managed.local.ManagedDataSource@4f5991f6 
> 
> 
> can it be a naming issue of a dependency of something like that? 
> 
> 
> 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-02-13 12:57 GMT+01:00 essex2014 <[hidden email]>: 
> 
> > Hi Roman, 
> > 
> > I have defined it in tomee.xml file. The file is committed in GitHub for 
> > reference. 
> > 
> > 
> > 
> > -- 
> > View this message in context: http://tomee-openejb.979440. 
> > n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4681076.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-tp4680866p4681081.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-tp4680866p4681097.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
tested on 1.7.4 and got

INFOS - Server startup in 2026 ms
Received:
DataSource injected:
org.apache.openejb.resource.jdbc.managed.local.ManagedDataSource@4f5991f6


can it be a naming issue of a dependency of something like that?


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-02-13 12:57 GMT+01:00 essex2014 <ha...@gmail.com>:

> Hi Roman,
>
> I have defined it in tomee.xml file. The file is committed in GitHub for
> reference.
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4681076.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
Hi Roman,

I have defined it in tomee.xml file. The file is committed in GitHub for
reference. 



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4681076.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
if you have
https://github.com/apache/tomee/blob/master/examples/moviefun-rest/src/main/tomee/tomee.xml

@Resource(name="HSQLDB Database") DataSource ds;

will work

or even

@Resource DataSource ds; if you defined a single datasource in the server.


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-12 8:07 GMT+01:00 essex2014 <ha...@gmail.com>:

> 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.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
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...@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.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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" <ha...@gmail.com> 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] <
> ml-node+s979440n4680874h24@n4.nabble.com> 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.

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
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] <ml...@n4.nabble.com> 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.

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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 <ha...@gmail.com>:

> 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.
>

Re: @Resource not working in tomee 1.7.4

Posted by Romain Manni-Bucau <rm...@gmail.com>.
did you define testDS anywhere?




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-02-12 21:52 GMT+01:00 essex2014 <ha...@gmail.com>:

> hi,
>
> sorry for late reply. I have uploaded my sample project on github at
> https://github.com/essex2014/WebApp1. also included tomee.xml config file.
> Can you pls see what is wrong with this ?
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4681058.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: @Resource not working in tomee 1.7.4

Posted by essex2014 <ha...@gmail.com>.
hi,

sorry for late reply. I have uploaded my sample project on github at
https://github.com/essex2014/WebApp1. also included tomee.xml config file.
Can you pls see what is wrong with this ?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Resource-not-working-in-tomee-1-7-4-tp4680866p4681058.html
Sent from the TomEE Users mailing list archive at Nabble.com.