JBossAS7 Deployments
cirix Sep 10, 2011 4:44 AMHi all,
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:
[code]
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 org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
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"
at org.jboss.as.ee.component.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:133)
at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:52)
at org.jboss.as.ee.component.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:129)
at org.jboss.as.ee.component.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:122)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
... 5 more
[/code]
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...
regards
\n\m
p.s.: I am using maven 2.2.1 for project management, i.e. dependencies and building.