Deploying a Spring app as ear to Glassfish v3 - Ambiguous DeploymentException “Module type not recognised”

StackOverflow https://stackoverflow.com/questions/3954058

문제

I am trying to deploy an .ear to Glassfish v3. The .ear is a "Spring" application made up of two modules:

  1. domain.jar (entities, persistence)
  2. service.jar (business logic with spring bean config).

I'm creating the .ear with Maven ear plugin and the resultant dir structure of the .ear is as follows:

  • /APP-INF/lib/domain.jar;service.jar
  • /META-INF/application.xml

I've copied the Spring dist to /glassfish/lib so it is available to all domains on the app server.

UPDATE:

It turns out that commenting out <includeInApplicationXml>true</includeInApplicationXml> from the ear pom.xml will make it deploy. But then my domain.jar is not deployed.

도움이 되었습니까?

해결책

I don't understand the structure of your EAR. Why are you packaging domain.jar and service.jar (this one contains EJBs right?) as utility JAR under APP-INF/lib? This doesn't look correct to me and I'd expect the following structure instead:

myear
|-- META-INF
|   `-- application.xml
|-- domain.jar
`-- service.jar

Am I missing something about your app?


No, maybe I'm misunderstanding the structure of an ear... I've struggled to find any good articles explaining it - I don't think it helps I'm trying to learn to use Maven too.

The Packaging Applications section of the Java EE tutorials is pretty decent.

I'm quite happy making a multi-module project, but I'm struggling to package it up successfully.

Because I always forget how to use maven-ear-plugin could help... if you really need an EAR.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top