views:

44

answers:

1

We have a issue where we are trying to merge persistence.xml files from multiple JAR's

Thread.currentThread().getContextClassLoader().getResources(PERSISTENCE_XML)

Does return a list of all persistenc.xml files from all projects, however when we make JAR files of each project, classloader.getResources(PERSISTENCE_XML) no longer returns a list of all persistence.xml files.

Is there anything we can do about this?

+2  A: 

Thread.currentThread().getContextClassLoader()

What value this method depends on the environment/platform/profile your classes are running under (and in some cases, the configuration of your plugin/application). In a standard JRE context, it may return null.

It is likely that the files are just not visible to the ClassLoader. Without information on the environment the files are running under, it is not possible to say exactly what the problem is.

McDowell