Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-1
-
Component/s: uberjar
-
Labels:None
-
Environment:java version "1.4.1_02"
Linux 2.4.19 (Mandrake 9.0)
Description
This is on an older version of Beta-9 pulled from CVS...
I have an application that is one java file, a log4j.properties and a
jndi.properties. That all gets compiled into a jar file (My.jar). That jar plus a number of dependencies are then uberjar'd into a single massive executable jar.
Now, when I do 'java -jar MyUber.jar' and the code attempts to create a
javax.naming.InitialContext I get a naming exception because it can't find the jndi.properties even though it is in the root of My.jar.
If I do 'java -classpath list:of:jars my.MainClass' then everything works correctly.
So, something in the classloader isn't playing nice with InitialContext and jndi.properties. Similarly, my log4j messages aren't as expected because log4j cannot find log4j.properties either.
Since my initial report to the mailing list, I've discovered that if I 'jar -uvf MyUber.jar *.properties' things will work correctly.
James were you using a leading '/' as I just fixed a couple bugs where resources weren't being found if a leading '/' was being used.