Andy
Andy

Reputation: 315

Where to deploy the EJB-client.jar and the EJB-impl in Wildfly in a clean way?

i'm new in Java EE and i have implemented a simple EJB-Module with a remote Interface, which i want to deploy on Wildfly 10. In the pom.xml of the EJB-Module i have registered this to generate the:

  1. ProcessApplicationEJBs-1.0-client.jar
  2. ProcessApplicationEJBs-1.0.jar

On the Wildfly-Server there are other deployed applications, which should use this ejb. For me it is important, that this applications use the client classes (hide the complete implementation). My questions are:

  1. Where do i have to deploy the ProcessApplicationEJBs-1.0-client.jar? My plan was to register it as a new module in Wildfly. Is that right?
  2. Where do i have to deploy the implementation ProcessApplicationEJBs-1.0.jar. As a module as well or in the normal deployments folder? I don't want that other deployed applications can see the concrete implementation, but the server will need the concrete implementations to provide the EJB's service. Do i have a missunderstanding here? What would be a common way to bring this to work in a clean way?

I would be be very grateful for your help!

Upvotes: 0

Views: 167

Answers (1)

wfink
wfink

Reputation: 357

You can choose to create a new module for WildFly and add a dependency in your application. Or add a maven dependency to your project for the client to include the *-client.jar in the other application to be deployed together.

Benefit of a module is the class loading, if you use Local invocations (call by reference) the second option can fail if you share classes from the -client.jar because of the different classloaders. Benefit of adding it to deployment is that you can change the interface without restarting the server or create a new module.

Upvotes: 1

Related Questions