users@javaee-spec.java.net

[javaee-spec users] Re: EJB-modules in EAR

From: Reza Rahman <reza_rahman_at_lycos.com>
Date: Thu, 19 Jan 2017 11:37:06 -0500

Hakan,

What application server are you using? I believe you could simply place the EJBs inside war files in your ear. There's no actual need to have a separate EJB jar module.

The Java EE specification leads should be able to tell us here what the intent of the specification is.

Cheers,
Reza

Disclaimer: I've stopped using ear and EJB jar modules for years now. I just use EJBs in simple war files.

> On Jan 17, 2017, at 11:42 AM, HÃ¥kan Fransson <hnfn68_at_gmail.com> wrote:
>
> Hello!
>
> Just started to follow the community and I dont know if this is the right place to make questions but I take a chance.
>
> My question is why do we still need to define an EJB module in an EAR?
>
> You read everywhere of the classic composition of a Java EE application, to have your business logic in an EJB-module and other stuff in a utility jar. I think this concept is a little bit out of date now.
> Recently I'm starting to restructure a classic JavaEE application, using EJB, CDI, JMS and Servlet API. It's built up of several web applications and also a RMI-interface, backed by EJB and CDI. Now imagine splitting up the backend mud from 30 projects to ~300 in order to take control over the code base. Getting rid of circular dependencies and carving out a start for DDD. I do imagine a future where any of the projects could contain EJB and/or CDI functionality. Refactoring EJB functionality from one project to another make an impact to deployment of EAR. I need to manually control that the application.xml is correctly generated. I just want to structure my application in any way without always check that the EAR is correct.
> Just compare to CDI. I dont have to tell EAR where my CDI-beans are. My point is, EJB has great services I want to use but should not have an impact on an application structure/architecture.
>
> Best Regards, Hakan Fransson