insipid
insipid

Reputation: 3308

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

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?

Upvotes: 2

Views: 1549

Answers (2)

Chris
Chris

Reputation: 1236

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.

Upvotes: 1

Daniel F. Thornton
Daniel F. Thornton

Reputation: 3685

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?

Upvotes: 0

Related Questions