Please refer to my previous discussion "DeploymentException: 'No module with relative path' problem". I have just downloaded Jboss-6.0.0.Final and try to run my ear currently running on JBoss-5.1.0-GA without any problem with "persistence.xml". In my previous discusssion (at http://community.jboss.org/thread/160387), I thought the problem was only peculiar to JBoss-6.0.00CR, but jboss-6.0.0.Final continues to throw the same erorr as the following error shows:

DEPLOYMENTS IN ERROR: Deployment "vfs:///opt/jboss/jboss-6.0.0.Final/server/all/deploy/odmsEAR.ear" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: No module with relative path lib/odmsJPA.jar found in set of modules for vfs:///opt/jboss/jboss-6.0.0.Final/server/all/deploy/odmsEAR.ear [odmsWeb.war, odmsEJB.jar]

I have seen your response on the “other thread”, but since that was about jboss-6.0.0-CR1which has now been superseded by Jboss-6.0.0.Final – albeit the same problem-- , could we use this thread for all further discussions – if you don't mind – but still use the other thread for reference?

This appears to be a bug to me. For some reason, the odmsJPA.jar is being considered a "module" (i.e. a web, EJB or app client module). Can you please create a JIRA https://issues.jboss.org/browse/JBAS and attach a sample application if possible?

No they won't be scanned implicitly. Anything under EAR/lib is plain java libraries unless explicitly specified (like for example as a module via application.xml)

Interesting. I just did a very quick test by just bluntly dumping an EJB JAR in the EAR/lib directory of an app I happened to be working on (JBoss AS 5.1), and see what happened. It seemed the EJBs were being processed here too. It eventually crapped out when it couldn't find the persistence unit referenced by some of the EJBs. (persistence.xml is included in that jar though).

So JBoss AS 5.1 too scans the EJBs in a jar in EAR/lib, but doesn't try to look for the persistence.xml file in that jar's META-INF.