jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • classworlds
  • CLASSWORLDS-6

Uberjar, jndi.properties and log4j.properties

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major 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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Jason van Zyl added a comment - 21/Sep/03 6:49 PM

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.

Show
Jason van Zyl added a comment - 21/Sep/03 6:49 PM 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.
Hide
Permalink
Todd Nine added a comment - 27/Apr/06 11:31 AM

I have also experienced this issue. I'm using the springframework 1.2.7 and the class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean. I use the following properties.

Properties props = new Properties();
props.setProperty(
"java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.setProperty(
"java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interface");
props.setProperty("java.naming.provider.url", "jnp://localhost:1100/");

This will connect, however I recieve the following error on the return from the call from the EJB

java.rmi.UnmarshalException: error unmarshalling arguments

If I write a batch/shell script to include all of the jars and resources in the jar, I can successfully connect. Any idea where this issue may be coming from?

Version 1.1

Show
Todd Nine added a comment - 27/Apr/06 11:31 AM I have also experienced this issue. I'm using the springframework 1.2.7 and the class org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean. I use the following properties. Properties props = new Properties(); props.setProperty( "java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); props.setProperty( "java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interface"); props.setProperty("java.naming.provider.url", "jnp://localhost:1100/"); This will connect, however I recieve the following error on the return from the call from the EJB java.rmi.UnmarshalException: error unmarshalling arguments If I write a batch/shell script to include all of the jars and resources in the jar, I can successfully connect. Any idea where this issue may be coming from? Version 1.1

People

  • Assignee:
    Unassigned
    Reporter:
    James CE Johnsom
Vote (0)
Watch (0)

Dates

  • Created:
    04/Jun/03 2:39 PM
    Updated:
    27/Apr/06 11:31 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.