[jboss-user] [Installation, Configuration & DEPLOYMENT] - help required please : problem with project packaging and pe

wiggy do-not-reply at jboss.com
Thu Dec 27 20:22:55 EST 2007


wonder if some one can help.  Think is simple but cant see the wood from the trees.  Any help greatefully received.

I'm in callisto eclipse /jboss 4.2.2 and I have a test app that i built as an ejb project (all in one) - and built all my entities, stateless session beans, generic EAO (variant of DAO pattern - from "ejb3 in action" book and a persistence unit.

I deploy to server and all is well and i can find the services and call them from external client app.  So far so good.

I then come to refactor my project into manageable project chunks.  I created two utility projects - one for the entities (no persistence unit defined here - just the marked up entity classes), then another utility project with the generic EAO code base.

I then create an EJB project to house the real EAO (extend the generic) for each entity class in the domain model utility project.

I set the java build path to include the two utility projects, and I also set the "project references" to include these also. (i cant set the j2ee depencies for the EJB project - it says "selected model not associated with an enterprise application module").

my top level EJB project has the persistence facet set and my persistence xml is defined here. 


this all compiles without warning. so project dependency relationships set up as follows

eao ejb proj (inc persistence xml defn)
   |                      |
   v                     v
entity util proj     generic eao util project

However : if i try to publish this refactored project eao EJB project to the server I then get an error on the server 

anonymous wrote : 
  | 01:10:43,770 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
  | 
  | --- MBeans waiting for other MBeans ---
  | ObjectName: jboss.j2ee:service=EJB3,module=NeilsAppEAOEJBProject.jar
  |   State: FAILED
  |   Reason: java.lang.NoClassDefFoundError: eao/EAO
  | 
  | --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
  | ObjectName: jboss.j2ee:service=EJB3,module=NeilsAppEAOEJBProject.jar
  |   State: FAILED
  |   Reason: java.lang.NoClassDefFoundError: eao/EAO
  | 

what i think this says is that the class loader for the EJB project cant see the utility projects.  Why is that ?  

if I refactor like this do I have to package all the  projects into an EAR? to get them to work ?

when you run multiple projects like this - where should the persistence unit be defined?  - I have defined it with the EAO instance definitions (concrete classes) that prsist my entities - rather than in the utility projects - is that right ? or does the persistence unit definition live with the entities in the util project (this doesnt seem right).

so can some one help me understand why what works in on big EJB project doesnt work when i refactor into multiple projects.

This is going to be easy (i think) and i shall feel stupid later - but its driving me nuts at present

I am only using eclipse as the build tool at present - i have no ant/maven framework setup (requires more time to read about these) and i'd like to get the basics running from eclipse if i could first.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115829#4115829

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115829



More information about the jboss-user mailing list