the following architecture of jars/wars doesn't load correctly in JBossAS 7 but it was used to load perfectly in all previous versions...i know about the new loading way so i am explaining the scenario:
- myjar-model.jar : Contains entities and the persistence.xml which defines also a persistence unit inside the META-INF folder.
- myjar-buisness.jar: Contains EJB's and Spring beans that uses the model.There is an annotation with @PersistenceContext(name="mypu") on this EJB's for the entity manager to work. The jboss-deployment-structure.xml has declared dependency in the deployment.mcube-model.jar.
I am copying both of these files first the model and then the buisness in the standalone profile in deployments folder.The first one is loaded successfully.The second one that also uses classes from the previous one can see the classes but not the pu need it for the db operations.The exception follows:
10:33:49,369 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."myjar-buisness.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."mcube-buisness.jar".INSTALL: Failed to process phase INSTALL of deployment "myjar-buisness.jar"
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Component class ***.**.GenericDAOImpl for component MyBean has errors:
Can't find a deployment unit named myjar-persistence at deployment "myjar-buisness.jar"
... 5 more
I would like also to point out that in both jboss-structure-deployment.xml of both projects i haven't put the declaration to any javax.api org.hibernate dependencies, because according to the documentation these are implicit deployments dependecies and when the appserver tries to deploy something if it discovers several specific annotations it will attach the required dependency.
Another more theoritical question that crossed my mind.According to the new versoin of jboss the old hierachical class loaders are gone, solving tones of probles with classloading.But from my perspective the simple solution given by the jboss modules is that instead of doing that automatically and not in a smart way(hierarchical loading) we through the ball to the user's playground.So he is responsible for defining correctly the dependencies between the projects he creates.Eventhough i really like the new jboss does the above point make anysense to anyone else?Currently i am spending alot of time and effort to migrate my previous jboss 6 project to the new appserver and i would expect it to be much m uch more easier...
p.s.: I am using maven 2.2.1 for project management, i.e. dependencies and building.