geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Solving Dependency Issuses
Date Mon, 06 Jul 2009 18:10:00 GMT

On Jul 6, 2009, at 10:28 AM, BenLeino wrote:

> Hi there,
> I am running into real trouble since one week, and I am afraid if  
> someone
> could help me:
> I have several EAR projectes including 1 EJB and one WAR projetc.  
> The EJB
> encapsulates the business logic (entities, EJBs and certain JOBs anf
> functions). The WAR is reponsible for managing user interaction  
> along this
> business case.
> Lets say I have "Items, Sales and Purchase" as three different  
> projects.
> Now I have the problem that a function in "Items" needs information  
> from
> "Sales" and Pruchase". And one function in Sales needs information  
> from
> "Items" and "Purchase". Now i have a dependency cycle.
> What is the best design pattern for this without loosing the business
> choherence within the EAR packages (this one only for items, this  
> for sales
> egtc.).

> As a solution I made a big "DataModel.jar",which contains all EJB  
> remote
> interfaces and alle entity POJO classes. So all dependency  
> references go
> over that jar, and binding takes place with @EJB and the JNDI name.
> But geronimo can't cope with that. It trries to validate @EJB  
> Annotation
> within the web container at runtime and fails if the EJB istn't  
> there (GBEAN
> Serialization Error). And some EJBs are not "injectable". Always when
> OpenEJB tries to start them i get a Proxy NoClassDeffError.

You don't really explain how much the projects are intertwined.  Lets  
look at the jpa entities first.  If you can separate them into 3  
projects so the entities from each project can go in a different  
database instance without losing any foreign key constraints then your  
organization is plausible.  If you lose foreign key constraints by  
such separation, then IMO you only have one jpa project and should  
combine all the entities in one java project.

If you really can come up with 3 independent jpa modules then I think  
you can solve the problem with a interface jar containing the ejb  
interfaces and interfaces for the jpa entities to implement.  You'd  
need to put this jar in its own classloader and have the javee  
projects depend on it.

If you can't come up with 3 separate jpa modules then I rather doubt  
you'll be able to have 3 separate ejb modules.  You could put the jpa  
stuff in its own jar but each dependency on it  from an ejb module  
will load a separate persistence unit, even within the same ear.   
Would it be at all plausible to have the ejbs + entities deployed as  
one javaee app/geronimo plugin and the web interfaces each deployed as  
a separate javaee app/geronimo plugin depending on the ejb app?  I'm  
not sure how @Ejb annotations work across plugin boundaries... they  
ought to be able to work, but I haven't tried it recently.

david jencks

> Some help is really apriciated.
> Thanks in advance,
> Tim
> -- 
> View this message in context:
> Sent from the Apache Geronimo - Users mailing list archive at  

View raw message