You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James CE Johnson <jc...@tragus.org> on 2003/05/29 15:00:58 UTC
Having a problem with uberjar
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.
Any suggestions? Is anyone else spewing log4j output from an uberjar'd
application?
Thanks,
J
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Having a problem with uberjar
Posted by Ben Walding <de...@walding.com>.
Sounds like it might be a problem in classworlds (the classloader for
uberjar)
Can you log this in jira against classworlds.
(I'll take a look at it there in the next day or two)
James CE Johnson wrote:
>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.
>
>Any suggestions? Is anyone else spewing log4j output from an uberjar'd
>application?
>
>Thanks,
>J
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org