Question regarding adding maven dependencies to an ear
ledzepu2 Mar 21, 2013 10:46 AMHello,
I have few MDBs which i need to deploy to my GlassFish Container as an ear. I am able to resolve the maven dependencies using maven shrinkwrap resolver. When i deploy the ear file, i get the following stack trace in my container.
|Exception while loading the app : EJB Container initialization error
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Error in Runtime DD: missing destination JNDI name
at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.updateMDBRuntimeInfo(ActiveJmsResourceAdapter.java:1872)
at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:186)
at com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.java:205)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:121)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:305)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:108)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
I am attaching the code snippet below
@Deployment
protected static Archive<?> createDeployment() {
PomEquippedResolveStage stage = Maven.configureResolver().fromFile("C:/Users/menona/.m2/settings-espn.xml").loadPomFromFile("pom.xml");
File[] mdbLib = stage.resolve("com.espn.sports.common:common-handling-ejb").withTransitivity().asFile();
File[] commonDaoLib = stage.
resolve("com.espn.sports.common:sports-dao").withTransitivity().asFile();
File[] commonPOJOLib = stage.
resolve("com.espn.sports.common:sports-persistence").withTransitivity().asFile();
File[] otherLib = stage.resolve("org.jodd:jodd").withTransitivity().asFile();
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "XoverMDB.ear").addAsModules(mdbLib).addAsLibraries(commonDaoLib).addAsLibraries(commonPOJOLib).addAsLibraries(otherLib).addAsResource("CompetitionEntityBean.xml").addAsResource("ScheduleBean.xml").addAsManifestResource("META-INF/sun-ejb-jar.xml","sun-ejb-jar.xml");;
ear.as(ZipExporter.class).exportTo(new File("d:/ears/xover.ear"),true);
System.out.println(ear.toString(true));
return ear;
}
In the code snippet below, the mdblib contains the mdbs which i need to deploy. The other libraries are dependencies for the mdbs in question. From the stacktrace,it looks like the deployment descriptor is missing. Can u point out if there are any mistakes here ? Also attaching the server.log which has the stacktrace.
-
server.log.zip 8.1 KB