Deploying BatooJPA on JBoss6 fails when BaseAnnotatedClassLocator tries to use JBoss7AnnotatedClassLocator #172

Open
PorkLip opened this Issue Mar 11, 2013 · 0 comments

Projects

None yet

1 participant

@PorkLip
PorkLip commented Mar 11, 2013

If the persistence.xml does not contain a <jar-file> tag the BaseAnnotadedClassLocator will encounter an "vfs" jar URL protocol in the locateClasses method and try to use JBoss7AnnotatedClassLocator. This will fail since JBoss7AnnotatedClassLocator tries to load org.jboss.as.jpa.spi.PersistenceUnitMetadata that not is available in JBoss 6.

It is almost possible to work around this when working with exploded libraries in Eclipse by specifying an relative path
<jar-file>file:../server/default/deploy/{name-of-ear-directory}/lib/{name-of-jpa-jar.jar}<jar-file> in persistence.xml. This will force the usage of the JarAnnotatedClassLocator that according to the logs will locate the annotated classes but at a later stage the JBoss7AnnotatedClassLocator seems to be invoked anyway and you end up with the same missing classes again. Even if this would work the relative path to the JAR file is not an option since it will fail when deployed to a server where exploded libraries isn't used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment