You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by José Luis Cetina <ma...@gmail.com> on 2012/12/18 18:42:35 UTC

EAR multiple persistence.xml

I have a question i have an ear with an ejb and web module.

In ejb module i have a persistence.xml which i use for only my ejb's and in
my webapp i have another persistence.xml that i use only for persist data
in my webapp.

As you can see i persist data in ejb module and in the webapp thats why i
have 2 persistence.

But i have a problem, when i deploy the ear file in apps folder i always
get an error:

SEVERE: FAIL ... MyEJBBean: Persistence unit not found for
@PersistenceContext(name="entityManager", unitName="kx_webapp").  Available
units [kx_ejb]

I have 2 datasource (kx_webapp and kx_ejb) in my tomee.xml. Apparently my
webapp try to search the jta-data-source somewhere else instead of itself.

EJBModule -- persistence.xml with jta-data-source: kx_ejb
WebAPP    -- persistence.xml with jta-data-source: kx_webapp

What im doing wrong?

Thanks

Re: EAR multiple persistence.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
yep that's the idea

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> Ok, then what you propose is create and ejb module with the content of the
> webapp.
> With this i have to isolate all the ejb's from webapps and create them as
> ejbmodule, am i correct?
>
> Doing this is not a limitation to me.
>
>
>
> 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>
>> basically:
>>
>> ear
>>   |
>>  ejb.jar
>>  ejb2.jar <- ejb of the webmodule + persistence.xml of the webmodule
>>  web.war <- without ejb2 content
>>
>>
>> Side note: next trunk should be better for your need even without
>> respecting this hierarchy
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> > You mean that i have to create a jar (like ejb module, but not being an
>> ejb
>> > module itself, i said this because i have to drop it in ear/lib folder
>> and
>> > not in ear)?
>> >
>> >
>> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >
>> >> basically the idea was:
>> >>
>> >> take all ejb stuff from the webapp and put it in a jar in lib part of
>> >> the ear (even the META-INF/persistence.xml)
>> >>
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >>
>> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> >> > No, i didn't.
>> >> >
>> >> > Do you mean, that i have to move the persistence of my webapp to
>> where??
>> >> >
>> >> > Where i move was the ejb.jar from ear root to ear/lib
>> >> >
>> >> >
>> >> >
>> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >> >
>> >> >> sorry not sure i understood
>> >> >>
>> >> >> did you move the persistence.xml which was in
>> WEB-INF/classes/META-INF
>> >> >> in the ejb.jar too?
>> >> >>
>> >> >> Romain Manni-Bucau
>> >> >> Twitter: @rmannibucau
>> >> >> Blog: http://rmannibucau.wordpress.com/
>> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> >> Github: https://github.com/rmannibucau
>> >> >>
>> >> >>
>> >> >>
>> >> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> >> >> > Yes.
>> >> >> >
>> >> >> > I have 2 persistences 1 in ejb module and the other in the webapp.
>> >> >> >
>> >> >> > My ear look like this:
>> >> >> >
>> >> >> > -ear
>> >> >> >   .....lib
>> >> >> >          .....myejb.jar
>> >> >> >                            ....META-INF/persistence.xml
>> >> >> >
>> >> >> >
>> >> >> >   ..META-INF
>> >> >> >   ..mywebapp.war
>> >> >> >
>> >> >> >
>> >> >> > I move my ejb from ear/ejb.jar to ear/lib folder, then the
>> >> >> persistence.xml
>> >> >> > is inside of the jar itself.
>> >> >> >
>> >> >> >
>> >> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >> >> >
>> >> >> >> did you move the persistence.xml as well?
>> >> >> >>
>> >> >> >> Romain Manni-Bucau
>> >> >> >> Twitter: @rmannibucau
>> >> >> >> Blog: http://rmannibucau.wordpress.com/
>> >> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> >> >> Github: https://github.com/rmannibucau
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> >> >> >> > I moved my ejb module to lib (ear) folder, but i still having
>> issue
>> >> >> with
>> >> >> >> > the persistence unit.
>> >> >> >> >
>> >> >> >> > I just move my ejb jar to lib an in application.xml i add the
>> >> >> following:
>> >> >> >> >
>> >> >> >> >   <module>
>> >> >> >> >     <ejb>lib/myejb.jar</ejb>
>> >> >> >> >   </module>
>> >> >> >> >
>> >> >> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >> >> >> >
>> >> >> >> >> ear
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> >
>> -------------------------------------------------------------------
>> >> >> >> > *SCJA. José Luis Cetina*
>> >> >> >> >
>> -------------------------------------------------------------------
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > -------------------------------------------------------------------
>> >> >> > *SCJA. José Luis Cetina*
>> >> >> > -------------------------------------------------------------------
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > -------------------------------------------------------------------
>> >> > *SCJA. José Luis Cetina*
>> >> > -------------------------------------------------------------------
>> >>
>> >
>> >
>> >
>> > --
>> > -------------------------------------------------------------------
>> > *SCJA. José Luis Cetina*
>> > -------------------------------------------------------------------
>>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by José Luis Cetina <ma...@gmail.com>.
Ok, then what you propose is create and ejb module with the content of the
webapp.
With this i have to isolate all the ejb's from webapps and create them as
ejbmodule, am i correct?

Doing this is not a limitation to me.



2012/12/18 Romain Manni-Bucau <rm...@gmail.com>

> basically:
>
> ear
>   |
>  ejb.jar
>  ejb2.jar <- ejb of the webmodule + persistence.xml of the webmodule
>  web.war <- without ejb2 content
>
>
> Side note: next trunk should be better for your need even without
> respecting this hierarchy
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> > You mean that i have to create a jar (like ejb module, but not being an
> ejb
> > module itself, i said this because i have to drop it in ear/lib folder
> and
> > not in ear)?
> >
> >
> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >
> >> basically the idea was:
> >>
> >> take all ejb stuff from the webapp and put it in a jar in lib part of
> >> the ear (even the META-INF/persistence.xml)
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> >> > No, i didn't.
> >> >
> >> > Do you mean, that i have to move the persistence of my webapp to
> where??
> >> >
> >> > Where i move was the ejb.jar from ear root to ear/lib
> >> >
> >> >
> >> >
> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >> >
> >> >> sorry not sure i understood
> >> >>
> >> >> did you move the persistence.xml which was in
> WEB-INF/classes/META-INF
> >> >> in the ejb.jar too?
> >> >>
> >> >> Romain Manni-Bucau
> >> >> Twitter: @rmannibucau
> >> >> Blog: http://rmannibucau.wordpress.com/
> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> >> Github: https://github.com/rmannibucau
> >> >>
> >> >>
> >> >>
> >> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> >> >> > Yes.
> >> >> >
> >> >> > I have 2 persistences 1 in ejb module and the other in the webapp.
> >> >> >
> >> >> > My ear look like this:
> >> >> >
> >> >> > -ear
> >> >> >   .....lib
> >> >> >          .....myejb.jar
> >> >> >                            ....META-INF/persistence.xml
> >> >> >
> >> >> >
> >> >> >   ..META-INF
> >> >> >   ..mywebapp.war
> >> >> >
> >> >> >
> >> >> > I move my ejb from ear/ejb.jar to ear/lib folder, then the
> >> >> persistence.xml
> >> >> > is inside of the jar itself.
> >> >> >
> >> >> >
> >> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >> >> >
> >> >> >> did you move the persistence.xml as well?
> >> >> >>
> >> >> >> Romain Manni-Bucau
> >> >> >> Twitter: @rmannibucau
> >> >> >> Blog: http://rmannibucau.wordpress.com/
> >> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> >> >> Github: https://github.com/rmannibucau
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> >> >> >> > I moved my ejb module to lib (ear) folder, but i still having
> issue
> >> >> with
> >> >> >> > the persistence unit.
> >> >> >> >
> >> >> >> > I just move my ejb jar to lib an in application.xml i add the
> >> >> following:
> >> >> >> >
> >> >> >> >   <module>
> >> >> >> >     <ejb>lib/myejb.jar</ejb>
> >> >> >> >   </module>
> >> >> >> >
> >> >> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >> >> >> >
> >> >> >> >> ear
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> >
> >> >> >> > --
> >> >> >> >
> -------------------------------------------------------------------
> >> >> >> > *SCJA. José Luis Cetina*
> >> >> >> >
> -------------------------------------------------------------------
> >> >> >>
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > -------------------------------------------------------------------
> >> >> > *SCJA. José Luis Cetina*
> >> >> > -------------------------------------------------------------------
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > -------------------------------------------------------------------
> >> > *SCJA. José Luis Cetina*
> >> > -------------------------------------------------------------------
> >>
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: EAR multiple persistence.xml

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

ear
  |
 ejb.jar
 ejb2.jar <- ejb of the webmodule + persistence.xml of the webmodule
 web.war <- without ejb2 content


Side note: next trunk should be better for your need even without
respecting this hierarchy

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> You mean that i have to create a jar (like ejb module, but not being an ejb
> module itself, i said this because i have to drop it in ear/lib folder and
> not in ear)?
>
>
> 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>
>> basically the idea was:
>>
>> take all ejb stuff from the webapp and put it in a jar in lib part of
>> the ear (even the META-INF/persistence.xml)
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> > No, i didn't.
>> >
>> > Do you mean, that i have to move the persistence of my webapp to where??
>> >
>> > Where i move was the ejb.jar from ear root to ear/lib
>> >
>> >
>> >
>> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >
>> >> sorry not sure i understood
>> >>
>> >> did you move the persistence.xml which was in WEB-INF/classes/META-INF
>> >> in the ejb.jar too?
>> >>
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >>
>> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> >> > Yes.
>> >> >
>> >> > I have 2 persistences 1 in ejb module and the other in the webapp.
>> >> >
>> >> > My ear look like this:
>> >> >
>> >> > -ear
>> >> >   .....lib
>> >> >          .....myejb.jar
>> >> >                            ....META-INF/persistence.xml
>> >> >
>> >> >
>> >> >   ..META-INF
>> >> >   ..mywebapp.war
>> >> >
>> >> >
>> >> > I move my ejb from ear/ejb.jar to ear/lib folder, then the
>> >> persistence.xml
>> >> > is inside of the jar itself.
>> >> >
>> >> >
>> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >> >
>> >> >> did you move the persistence.xml as well?
>> >> >>
>> >> >> Romain Manni-Bucau
>> >> >> Twitter: @rmannibucau
>> >> >> Blog: http://rmannibucau.wordpress.com/
>> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> >> Github: https://github.com/rmannibucau
>> >> >>
>> >> >>
>> >> >>
>> >> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> >> >> > I moved my ejb module to lib (ear) folder, but i still having issue
>> >> with
>> >> >> > the persistence unit.
>> >> >> >
>> >> >> > I just move my ejb jar to lib an in application.xml i add the
>> >> following:
>> >> >> >
>> >> >> >   <module>
>> >> >> >     <ejb>lib/myejb.jar</ejb>
>> >> >> >   </module>
>> >> >> >
>> >> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >> >> >
>> >> >> >> ear
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > -------------------------------------------------------------------
>> >> >> > *SCJA. José Luis Cetina*
>> >> >> > -------------------------------------------------------------------
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > -------------------------------------------------------------------
>> >> > *SCJA. José Luis Cetina*
>> >> > -------------------------------------------------------------------
>> >>
>> >
>> >
>> >
>> > --
>> > -------------------------------------------------------------------
>> > *SCJA. José Luis Cetina*
>> > -------------------------------------------------------------------
>>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by José Luis Cetina <ma...@gmail.com>.
You mean that i have to create a jar (like ejb module, but not being an ejb
module itself, i said this because i have to drop it in ear/lib folder and
not in ear)?


2012/12/18 Romain Manni-Bucau <rm...@gmail.com>

> basically the idea was:
>
> take all ejb stuff from the webapp and put it in a jar in lib part of
> the ear (even the META-INF/persistence.xml)
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> > No, i didn't.
> >
> > Do you mean, that i have to move the persistence of my webapp to where??
> >
> > Where i move was the ejb.jar from ear root to ear/lib
> >
> >
> >
> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >
> >> sorry not sure i understood
> >>
> >> did you move the persistence.xml which was in WEB-INF/classes/META-INF
> >> in the ejb.jar too?
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> >> > Yes.
> >> >
> >> > I have 2 persistences 1 in ejb module and the other in the webapp.
> >> >
> >> > My ear look like this:
> >> >
> >> > -ear
> >> >   .....lib
> >> >          .....myejb.jar
> >> >                            ....META-INF/persistence.xml
> >> >
> >> >
> >> >   ..META-INF
> >> >   ..mywebapp.war
> >> >
> >> >
> >> > I move my ejb from ear/ejb.jar to ear/lib folder, then the
> >> persistence.xml
> >> > is inside of the jar itself.
> >> >
> >> >
> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >> >
> >> >> did you move the persistence.xml as well?
> >> >>
> >> >> Romain Manni-Bucau
> >> >> Twitter: @rmannibucau
> >> >> Blog: http://rmannibucau.wordpress.com/
> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> >> Github: https://github.com/rmannibucau
> >> >>
> >> >>
> >> >>
> >> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> >> >> > I moved my ejb module to lib (ear) folder, but i still having issue
> >> with
> >> >> > the persistence unit.
> >> >> >
> >> >> > I just move my ejb jar to lib an in application.xml i add the
> >> following:
> >> >> >
> >> >> >   <module>
> >> >> >     <ejb>lib/myejb.jar</ejb>
> >> >> >   </module>
> >> >> >
> >> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >> >> >
> >> >> >> ear
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > -------------------------------------------------------------------
> >> >> > *SCJA. José Luis Cetina*
> >> >> > -------------------------------------------------------------------
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > -------------------------------------------------------------------
> >> > *SCJA. José Luis Cetina*
> >> > -------------------------------------------------------------------
> >>
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
basically the idea was:

take all ejb stuff from the webapp and put it in a jar in lib part of
the ear (even the META-INF/persistence.xml)

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> No, i didn't.
>
> Do you mean, that i have to move the persistence of my webapp to where??
>
> Where i move was the ejb.jar from ear root to ear/lib
>
>
>
> 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>
>> sorry not sure i understood
>>
>> did you move the persistence.xml which was in WEB-INF/classes/META-INF
>> in the ejb.jar too?
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> > Yes.
>> >
>> > I have 2 persistences 1 in ejb module and the other in the webapp.
>> >
>> > My ear look like this:
>> >
>> > -ear
>> >   .....lib
>> >          .....myejb.jar
>> >                            ....META-INF/persistence.xml
>> >
>> >
>> >   ..META-INF
>> >   ..mywebapp.war
>> >
>> >
>> > I move my ejb from ear/ejb.jar to ear/lib folder, then the
>> persistence.xml
>> > is inside of the jar itself.
>> >
>> >
>> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >
>> >> did you move the persistence.xml as well?
>> >>
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >>
>> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> >> > I moved my ejb module to lib (ear) folder, but i still having issue
>> with
>> >> > the persistence unit.
>> >> >
>> >> > I just move my ejb jar to lib an in application.xml i add the
>> following:
>> >> >
>> >> >   <module>
>> >> >     <ejb>lib/myejb.jar</ejb>
>> >> >   </module>
>> >> >
>> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >> >
>> >> >> ear
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > -------------------------------------------------------------------
>> >> > *SCJA. José Luis Cetina*
>> >> > -------------------------------------------------------------------
>> >>
>> >
>> >
>> >
>> > --
>> > -------------------------------------------------------------------
>> > *SCJA. José Luis Cetina*
>> > -------------------------------------------------------------------
>>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by José Luis Cetina <ma...@gmail.com>.
No, i didn't.

Do you mean, that i have to move the persistence of my webapp to where??

Where i move was the ejb.jar from ear root to ear/lib



2012/12/18 Romain Manni-Bucau <rm...@gmail.com>

> sorry not sure i understood
>
> did you move the persistence.xml which was in WEB-INF/classes/META-INF
> in the ejb.jar too?
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> > Yes.
> >
> > I have 2 persistences 1 in ejb module and the other in the webapp.
> >
> > My ear look like this:
> >
> > -ear
> >   .....lib
> >          .....myejb.jar
> >                            ....META-INF/persistence.xml
> >
> >
> >   ..META-INF
> >   ..mywebapp.war
> >
> >
> > I move my ejb from ear/ejb.jar to ear/lib folder, then the
> persistence.xml
> > is inside of the jar itself.
> >
> >
> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >
> >> did you move the persistence.xml as well?
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> >> > I moved my ejb module to lib (ear) folder, but i still having issue
> with
> >> > the persistence unit.
> >> >
> >> > I just move my ejb jar to lib an in application.xml i add the
> following:
> >> >
> >> >   <module>
> >> >     <ejb>lib/myejb.jar</ejb>
> >> >   </module>
> >> >
> >> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >> >
> >> >> ear
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > -------------------------------------------------------------------
> >> > *SCJA. José Luis Cetina*
> >> > -------------------------------------------------------------------
> >>
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
sorry not sure i understood

did you move the persistence.xml which was in WEB-INF/classes/META-INF
in the ejb.jar too?

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> Yes.
>
> I have 2 persistences 1 in ejb module and the other in the webapp.
>
> My ear look like this:
>
> -ear
>   .....lib
>          .....myejb.jar
>                            ....META-INF/persistence.xml
>
>
>   ..META-INF
>   ..mywebapp.war
>
>
> I move my ejb from ear/ejb.jar to ear/lib folder, then the persistence.xml
> is inside of the jar itself.
>
>
> 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>
>> did you move the persistence.xml as well?
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> > I moved my ejb module to lib (ear) folder, but i still having issue with
>> > the persistence unit.
>> >
>> > I just move my ejb jar to lib an in application.xml i add the following:
>> >
>> >   <module>
>> >     <ejb>lib/myejb.jar</ejb>
>> >   </module>
>> >
>> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >
>> >> ear
>> >
>> >
>> >
>> >
>> > --
>> > -------------------------------------------------------------------
>> > *SCJA. José Luis Cetina*
>> > -------------------------------------------------------------------
>>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by José Luis Cetina <ma...@gmail.com>.
Yes.

I have 2 persistences 1 in ejb module and the other in the webapp.

My ear look like this:

-ear
  .....lib
         .....myejb.jar
                           ....META-INF/persistence.xml


  ..META-INF
  ..mywebapp.war


I move my ejb from ear/ejb.jar to ear/lib folder, then the persistence.xml
is inside of the jar itself.


2012/12/18 Romain Manni-Bucau <rm...@gmail.com>

> did you move the persistence.xml as well?
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> > I moved my ejb module to lib (ear) folder, but i still having issue with
> > the persistence unit.
> >
> > I just move my ejb jar to lib an in application.xml i add the following:
> >
> >   <module>
> >     <ejb>lib/myejb.jar</ejb>
> >   </module>
> >
> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >
> >> ear
> >
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
did you move the persistence.xml as well?

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> I moved my ejb module to lib (ear) folder, but i still having issue with
> the persistence unit.
>
> I just move my ejb jar to lib an in application.xml i add the following:
>
>   <module>
>     <ejb>lib/myejb.jar</ejb>
>   </module>
>
> 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>
>> ear
>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by José Luis Cetina <ma...@gmail.com>.
I moved my ejb module to lib (ear) folder, but i still having issue with
the persistence unit.

I just move my ejb jar to lib an in application.xml i add the following:

  <module>
    <ejb>lib/myejb.jar</ejb>
  </module>

2012/12/18 Romain Manni-Bucau <rm...@gmail.com>

> ear




-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well hacking on it,

hoping to push a snapshot with the "fix" for tomorrow (that's said i
fear a bit this is the kind of update which will take some days
because it can easily break TCKs)

about your need: why not moving all ejbmodules in lib part of the ear?

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> Ok, uff since i try to reuse my business logic using EJB modules and web
> apps in ear files this has become a headache.
>
> I tried to use ejb module + webapp separately and i have to replicate the
> ejb.jar in lib, but then you told me that this was not good.
>
> Then i try with ear but then now we have this issue.
>
> What solution can be usable in tomee for share my ejbs into all my webapps?
>
>
> Any advice?
>
>
> 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>
>> hmm,
>>
>> think currently we only support ejb in ejbmodule and not in webapp for
>> ears,
>>
>> hacked a bit locally on the persistence.xml stuff but then we have
>> issues with ejbs
>>
>> will try to see if i can go further
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> > Here you can download the JEE sample:
>> >
>> > http://www.mediafire.com/?ui9x3a8v8f8mbep
>> >
>> >
>> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>> >
>> >> Do you have a shareable sample?
>> >>
>> >> wonder if we manage the ejb part or the webapp for ear
>> >>
>> >> if you share a sample i could have a look quickly
>> >>
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >>
>> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> >> > I have a question i have an ear with an ejb and web module.
>> >> >
>> >> > In ejb module i have a persistence.xml which i use for only my ejb's
>> and
>> >> in
>> >> > my webapp i have another persistence.xml that i use only for persist
>> data
>> >> > in my webapp.
>> >> >
>> >> > As you can see i persist data in ejb module and in the webapp thats
>> why i
>> >> > have 2 persistence.
>> >> >
>> >> > But i have a problem, when i deploy the ear file in apps folder i
>> always
>> >> > get an error:
>> >> >
>> >> > SEVERE: FAIL ... MyEJBBean: Persistence unit not found for
>> >> > @PersistenceContext(name="entityManager", unitName="kx_webapp").
>> >>  Available
>> >> > units [kx_ejb]
>> >> >
>> >> > I have 2 datasource (kx_webapp and kx_ejb) in my tomee.xml.
>> Apparently my
>> >> > webapp try to search the jta-data-source somewhere else instead of
>> >> itself.
>> >> >
>> >> > EJBModule -- persistence.xml with jta-data-source: kx_ejb
>> >> > WebAPP    -- persistence.xml with jta-data-source: kx_webapp
>> >> >
>> >> > What im doing wrong?
>> >> >
>> >> > Thanks
>> >>
>> >
>> >
>> >
>> > --
>> > -------------------------------------------------------------------
>> > *SCJA. José Luis Cetina*
>> > -------------------------------------------------------------------
>>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by José Luis Cetina <ma...@gmail.com>.
Ok, uff since i try to reuse my business logic using EJB modules and web
apps in ear files this has become a headache.

I tried to use ejb module + webapp separately and i have to replicate the
ejb.jar in lib, but then you told me that this was not good.

Then i try with ear but then now we have this issue.

What solution can be usable in tomee for share my ejbs into all my webapps?


Any advice?


2012/12/18 Romain Manni-Bucau <rm...@gmail.com>

> hmm,
>
> think currently we only support ejb in ejbmodule and not in webapp for
> ears,
>
> hacked a bit locally on the persistence.xml stuff but then we have
> issues with ejbs
>
> will try to see if i can go further
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> > Here you can download the JEE sample:
> >
> > http://www.mediafire.com/?ui9x3a8v8f8mbep
> >
> >
> > 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
> >
> >> Do you have a shareable sample?
> >>
> >> wonder if we manage the ejb part or the webapp for ear
> >>
> >> if you share a sample i could have a look quickly
> >>
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> >> > I have a question i have an ear with an ejb and web module.
> >> >
> >> > In ejb module i have a persistence.xml which i use for only my ejb's
> and
> >> in
> >> > my webapp i have another persistence.xml that i use only for persist
> data
> >> > in my webapp.
> >> >
> >> > As you can see i persist data in ejb module and in the webapp thats
> why i
> >> > have 2 persistence.
> >> >
> >> > But i have a problem, when i deploy the ear file in apps folder i
> always
> >> > get an error:
> >> >
> >> > SEVERE: FAIL ... MyEJBBean: Persistence unit not found for
> >> > @PersistenceContext(name="entityManager", unitName="kx_webapp").
> >>  Available
> >> > units [kx_ejb]
> >> >
> >> > I have 2 datasource (kx_webapp and kx_ejb) in my tomee.xml.
> Apparently my
> >> > webapp try to search the jta-data-source somewhere else instead of
> >> itself.
> >> >
> >> > EJBModule -- persistence.xml with jta-data-source: kx_ejb
> >> > WebAPP    -- persistence.xml with jta-data-source: kx_webapp
> >> >
> >> > What im doing wrong?
> >> >
> >> > Thanks
> >>
> >
> >
> >
> > --
> > -------------------------------------------------------------------
> > *SCJA. José Luis Cetina*
> > -------------------------------------------------------------------
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: EAR multiple persistence.xml

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

think currently we only support ejb in ejbmodule and not in webapp for ears,

hacked a bit locally on the persistence.xml stuff but then we have
issues with ejbs

will try to see if i can go further

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> Here you can download the JEE sample:
>
> http://www.mediafire.com/?ui9x3a8v8f8mbep
>
>
> 2012/12/18 Romain Manni-Bucau <rm...@gmail.com>
>
>> Do you have a shareable sample?
>>
>> wonder if we manage the ejb part or the webapp for ear
>>
>> if you share a sample i could have a look quickly
>>
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
>> > I have a question i have an ear with an ejb and web module.
>> >
>> > In ejb module i have a persistence.xml which i use for only my ejb's and
>> in
>> > my webapp i have another persistence.xml that i use only for persist data
>> > in my webapp.
>> >
>> > As you can see i persist data in ejb module and in the webapp thats why i
>> > have 2 persistence.
>> >
>> > But i have a problem, when i deploy the ear file in apps folder i always
>> > get an error:
>> >
>> > SEVERE: FAIL ... MyEJBBean: Persistence unit not found for
>> > @PersistenceContext(name="entityManager", unitName="kx_webapp").
>>  Available
>> > units [kx_ejb]
>> >
>> > I have 2 datasource (kx_webapp and kx_ejb) in my tomee.xml. Apparently my
>> > webapp try to search the jta-data-source somewhere else instead of
>> itself.
>> >
>> > EJBModule -- persistence.xml with jta-data-source: kx_ejb
>> > WebAPP    -- persistence.xml with jta-data-source: kx_webapp
>> >
>> > What im doing wrong?
>> >
>> > Thanks
>>
>
>
>
> --
> -------------------------------------------------------------------
> *SCJA. José Luis Cetina*
> -------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by José Luis Cetina <ma...@gmail.com>.
Here you can download the JEE sample:

http://www.mediafire.com/?ui9x3a8v8f8mbep


2012/12/18 Romain Manni-Bucau <rm...@gmail.com>

> Do you have a shareable sample?
>
> wonder if we manage the ejb part or the webapp for ear
>
> if you share a sample i could have a look quickly
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2012/12/18 José Luis Cetina <ma...@gmail.com>:
> > I have a question i have an ear with an ejb and web module.
> >
> > In ejb module i have a persistence.xml which i use for only my ejb's and
> in
> > my webapp i have another persistence.xml that i use only for persist data
> > in my webapp.
> >
> > As you can see i persist data in ejb module and in the webapp thats why i
> > have 2 persistence.
> >
> > But i have a problem, when i deploy the ear file in apps folder i always
> > get an error:
> >
> > SEVERE: FAIL ... MyEJBBean: Persistence unit not found for
> > @PersistenceContext(name="entityManager", unitName="kx_webapp").
>  Available
> > units [kx_ejb]
> >
> > I have 2 datasource (kx_webapp and kx_ejb) in my tomee.xml. Apparently my
> > webapp try to search the jta-data-source somewhere else instead of
> itself.
> >
> > EJBModule -- persistence.xml with jta-data-source: kx_ejb
> > WebAPP    -- persistence.xml with jta-data-source: kx_webapp
> >
> > What im doing wrong?
> >
> > Thanks
>



-- 
-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------

Re: EAR multiple persistence.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Do you have a shareable sample?

wonder if we manage the ejb part or the webapp for ear

if you share a sample i could have a look quickly

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



2012/12/18 José Luis Cetina <ma...@gmail.com>:
> I have a question i have an ear with an ejb and web module.
>
> In ejb module i have a persistence.xml which i use for only my ejb's and in
> my webapp i have another persistence.xml that i use only for persist data
> in my webapp.
>
> As you can see i persist data in ejb module and in the webapp thats why i
> have 2 persistence.
>
> But i have a problem, when i deploy the ear file in apps folder i always
> get an error:
>
> SEVERE: FAIL ... MyEJBBean: Persistence unit not found for
> @PersistenceContext(name="entityManager", unitName="kx_webapp").  Available
> units [kx_ejb]
>
> I have 2 datasource (kx_webapp and kx_ejb) in my tomee.xml. Apparently my
> webapp try to search the jta-data-source somewhere else instead of itself.
>
> EJBModule -- persistence.xml with jta-data-source: kx_ejb
> WebAPP    -- persistence.xml with jta-data-source: kx_webapp
>
> What im doing wrong?
>
> Thanks