[wildfly-dev] Global module with ejbs

Scott Marlow smarlow at redhat.com
Wed Nov 28 10:53:11 EST 2018


On 11/28/18 4:14 AM, Nikola Malenic wrote:
> But how does the injection work with other stuff from modules, e.g. EntityManager?
> 

The EntityManager injection [1] is also not handled for global modules, 
since global modules do not get processed as deployments.

If you want to include JPA code in your global module, you could use the 
javax.persistence.Persistence API [2] to create the EntityManagerFactory 
from which you can get the EntityManager.

Scott

[1] 
https://github.com/wildfly/wildfly/blob/master/jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/JPAAnnotationProcessor.java#L80

[2] 
https://javaee.github.io/javaee-spec/javadocs/javax/persistence/Persistence.html#createEntityManagerFactory-java.lang.String-java.util.Map-

> -----Original Message-----
> From: David Lloyd [mailto:david.lloyd at redhat.com]
> Sent: Tuesday, November 27, 2018 10:46 PM
> To: nikola.malenic at netsetglobal.rs
> Cc: WildFly Dev <wildfly-dev at lists.jboss.org>
> Subject: Re: [wildfly-dev] Global module with ejbs
> 
> Correct, EJBs are not discovered from modules.  They must be deployed.
> On Tue, Nov 27, 2018 at 12:07 PM Nikola Malenic <nikola.malenic at netsetglobal.rs> wrote:
>>
>> I deployed a global module with remote ejbs defined, but I can't access them from deployed applications.
>>
>>
>>
>> Here is the interface:
>>
>> @Remote
>>
>> public interface ICryptoAPI..
>>
>>
>>
>> and bean definition:
>>
>> @Stateless
>>
>> public class CryptoAPI implements ICryptoAPI ...
>>
>>
>>
>> How can I find jndi name of the ejbs deployed, since default @Ejb cannot find bean? Just to mention, /subsystem=naming:jndi-view() from jboss-cli doesn't print anything about deployed module and there are no errors in wildfly log.
>>
>>
>>
>> Maybe, it is not possible to define injectable ejbs in global modules?
>>
>>
>>
>> _______________________________________________
>> wildfly-dev mailing list
>> wildfly-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/wildfly-dev
> 
> 
> 
> --
> - DML
> 
> 
> _______________________________________________
> wildfly-dev mailing list
> wildfly-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/wildfly-dev
> 


More information about the wildfly-dev mailing list