开发者

ClassLoader getResources doesn't find all versions of the file

开发者 https://www.devze.com 2023-01-15 02:53 出处:网络
We have a issue where we are trying to merge persistence.xml files from multiple JAR\'s Thread.currentThread().getContextClassLoader().getResources(PERSISTENCE_XML)

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 o开发者_StackOverflowf each project, classloader.getResources(PERSISTENCE_XML) no longer returns a list of all persistence.xml files.

Is there anything we can do about this?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消