help needed loading a jar file and dll file

Discussion in 'Java' started by Barry, Sep 10, 2004.

  1. Barry

    Barry Guest

    Hello,

    I hope somebody can help me with the following problem.

    My application requires a jar file be loaded dynamically at runtime,
    which I do using a URLClassLoader. However, the classes within the
    jar are dependent on a dll also being loaded. This I cannot do. An
    UnsatisfiedLinkError is reported when classes obtained from the jar
    calls methods found in the aforementioned dll. For example,

    java.lang.UnsatisfiedLinkError: getMSRresults_SEC_PARAMETERS at
    com.science.parser.ParserJNI.getMSResults_SEC_PARAMETERS(Native
    Method) at
    com.science.parser.MSResults.<clinit>(MSResults.java:230) at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at
    java.lang.reflect.Constructor.newInstance(Constructor.java:274) at
    com.micro.search.SearchResults.getResults(SearchResults.java:47)

    I have tried loading the dll file using the System.load and
    System.loadLibrary methods but to no avail. No exception is thrown in
    either case. To add insult to injury, if I add the jar file to the
    classpath everything works (unfortunately, for licensing reasons, I am
    unable to add the jar file to the class path - otherwise I would be
    laughing and this post would be redundant).

    Any help you can give me will be much appreciated. Thank you.
    Barry, Sep 10, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    554
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,688
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,725
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    638
    Arnold Peters
    Jan 5, 2005
  5. Philipp Kraus

    loading dll within a jar

    Philipp Kraus, Oct 3, 2011, in forum: Java
    Replies:
    7
    Views:
    964
    Arne Vajhøj
    Oct 17, 2011
Loading...

Share This Page