Hi John,

It works as you said. I don't know how since it is in separate EJB module 
but it works :)

Just in case if the JPA / DeltaSpike module is in separate Server/JVM then 
how to access the repositories as EJB ?

best regards
Paweł



Od:     "John D. Ament" <[email protected]>
Do:     [email protected]
Data:   2016-08-03 13:01
Temat:  Re: access DeltaSpike Data repository as EJB



Hi Pawel,

Creating them as EJBs shouldn't be required.  They're still CDI beans.  In
the JAR that you expose, make sure the various deltaspike extensions are
activated in your javax.enterprise.inject.spi.Extension file.  Make sure
you have a valid beans.xml to discover all beans.

At a minimum you need the repository extension and bean provider.  You
should then be able to inject them.  Please do post back if this gives you
some trouble, happy to help.

John

On Wed, Aug 3, 2016 at 6:50 AM <[email protected]> wrote:

> Need to move my JPA and DeltaSpike repositories to EJB EAR module to 
allow
> access from two different WARs in the same EAR
>
> What is recommnded approach to access DeltaSpike repository as EJB ?
>
> For adhoc I created PersonService class annotated with @Stateless
>
> @Stateless
> public class PersonService {
>
>         @Inject PersonRepository personRepository;
>
>         public PersonRepository getRepository(){
>                 return personRepository;
>         }
> }
>
> Do you have some other ideas ?
>
> Paweł

Reply via email to