开发者

dependencies of jar with no manifest in ear (JBoss deployment)

开发者 https://www.devze.com 2023-01-23 07:49 出处:网络
I have a signed jar bundled in an ear that searches for a configuration file of off the classpath.The configuration file is in the ear\'s manifest and is located at the root of the ear.The signed jar

I have a signed jar bundled in an ear that searches for a configuration file of off the classpath. The configuration file is in the ear's manifest and is located at the root of the ear. The signed jar does not have a manifest and I cannot add one, so how do I add this file to the jar's classpath? I build the ear with ant, and deploy it in JBoss.

EDIT: What is开发者_运维知识库 happening is that when I use the jar from one of my sar services, the file specified in the ear's manifest appears to not be on the classpath. When the jar does it's getresource(), it returns null. Perhaps the problem is that the jar itself is using the wrong classloader? Which classloader should it be using?


Have you tried putting the configuration file itself in a jar and referencing that in the ear manifest? I.e. -

  1. Put the configuration file in a jar
  2. put the jar somewhere in the .ear e.g. /config.jar
  3. Amend the ear manifest located at /META-INF/MANIFEST.MF, add a Class-path entry:

    Class-Path: config.jar

Hope that works.


You might try placing it in META-INF/classes inside the JAR, though if you cannot add a manifest you might not be able to do so. Are you able to add any files to the JAR?

0

精彩评论

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