[SOLVED] UnsatisfiedLinkError: ... initializeLibrary() ???

Feature Requests, Comments, Bugs, and Suggestions on the JIntellitype Java API.

[SOLVED] UnsatisfiedLinkError: ... initializeLibrary() ???

Postby TheWhite » Tue Aug 25, 2009 4:29 pm

Here's the full error... This is using the source code of JIntellitypeTester.java which came with the release. My app is having the same error.

Code: Select all
Exception in thread "main" jintellitype.JIntellitypeException: java.lang.UnsatisfiedLinkError: jintellitype.JIntellitype.initializeLibrary()V
   at jintellitype.JIntellitype.<init>(JIntellitype.java:102)
   at jintellitype.JIntellitype.getInstance(JIntellitype.java:124)
   at jintellitype.JIntellitype.checkInstanceAlreadyRunning(JIntellitype.java:272)
   at JIntellitypeTester.main(JIntellitypeTester.java:81)
Caused by: java.lang.UnsatisfiedLinkError: jintellitype.JIntellitype.initializeLibrary()V
   at jintellitype.JIntellitype.initializeLibrary(Native Method)
   at jintellitype.JIntellitype.<init>(JIntellitype.java:100)
   ... 3 more


fails in this function in JIntellitype.java
Code: Select all
private JIntellitype() {
      // Load JNI library
      try {
         if (getLibraryLocation() != null) {
            System.load(getLibraryLocation());
         } else {
            System.loadLibrary("JIntellitype");
         }
         
         initializeLibrary();     // <--------------------- here!
      } catch (UnsatisfiedLinkError ex) {
         throw new JIntellitypeException(ex);
      } catch (RuntimeException ex) {
         throw new JIntellitypeException(ex);
      }
   }
TheWhite
 
Posts: 7
Joined: Tue Aug 25, 2009 4:14 pm

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby Melloware » Tue Aug 25, 2009 4:42 pm

That usually means it can't find the DLL in the path. Are you sure you have the JIntellitype DLL in the same folder as the executing code?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11060
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby TheWhite » Tue Aug 25, 2009 7:35 pm

Yes, because when it wasnt, System.loadLibrary("JIntellitype"); gave me an error telling me that it couldn't find the lib. I fixed that and got this message.

Whats with the V's at the end of the error? This is a fresh download from the site. I just installed it today -- any chance that the compiled .dll might be broken? The library loads fine using loadLibrary(), but then it fails when its about to initialize and use its content.
TheWhite
 
Posts: 7
Joined: Tue Aug 25, 2009 4:14 pm

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby Melloware » Tue Aug 25, 2009 9:25 pm

TheWhite wrote:Yes, because when it wasnt, System.loadLibrary("JIntellitype"); gave me an error telling me that it couldn't find the lib. I fixed that and got this message.

Whats with the V's at the end of the error? This is a fresh download from the site. I just installed it today -- any chance that the compiled .dll might be broken? The library loads fine using loadLibrary(), but then it fails when its about to initialize and use its content.


A couple of questions....

1. What OS are you using?

2. What JDK are you using? A 32 bit or 64 bit JDK? It does not work with a 64 bit JDK.

I have not compiled the DLL in over two years and I have tested extensively on XP and Vista and have about 10 other projects using this DLL. It has to be something odd or out of sorts with your setup?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11060
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby TheWhite » Tue Aug 25, 2009 10:30 pm

I'm using 64-bit Vista -- the JDK is installed in Program Files (x86), so I'm assuming its 32bit? How would I make sure? I simply downloaded the JDK from the java website. It didn't say anything about architecture.
TheWhite
 
Posts: 7
Joined: Tue Aug 25, 2009 4:14 pm

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby Melloware » Wed Aug 26, 2009 5:56 am

TheWhite wrote:I'm using 64-bit Vista -- the JDK is installed in Program Files (x86), so I'm assuming its 32bit? How would I make sure? I simply downloaded the JDK from the java website. It didn't say anything about architecture.


OK that is the exact setup I run, Windows Vista 64 running a 32 bit JDK no problems. Do me a favor.... Download and try this example?

The DOS command line to execute is inside the command.txt file.

http://melloware.biz/download/warez/jintellitype-example.zip
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11060
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby TheWhite » Wed Aug 26, 2009 8:55 am

It seems to be working:

Code: Select all
RegisterHotKey WINDOWS+A was assigned uniqueID 88
RegisterHotKey ALT+SHIFT+B was assigned uniqueID 89
RegisterHotKey CTRL+SHIFT+C was assigned uniqueID 90
RegisterHotKey PRINT_SCREEN was assigned uniqueID 91
RegisterHotKey F9 was assigned uniqueID 92
Press WINDOWS+A or ALT+SHIFT+B or CTRL+SHIFT+C in another application and you will see the debug output in the textarea.
WM_HOTKEY message received 90
WM_HOTKEY message received 88
WM_HOTKEY message received 89
TheWhite
 
Posts: 7
Joined: Tue Aug 25, 2009 4:14 pm

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby Melloware » Wed Aug 26, 2009 9:25 am

OK now try this latest version with build 1.3.2.

http://melloware.biz/download/warez/jin ... xample.zip

If this works then it means your code has some classpath conflict or it can't find the DLL?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11060
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby TheWhite » Wed Aug 26, 2009 10:17 am

Great. New version worked.

Just curious, what is it that you changed to fix this?
TheWhite
 
Posts: 7
Joined: Tue Aug 25, 2009 4:14 pm

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby Melloware » Wed Aug 26, 2009 10:29 am

Huh only thing I did was remove the Log4J and Common-Logging Dependencies in the latest version. That shouldn't have affected anything but glad you got it all worked out.

So does your own code work now?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11060
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA

Re: UnsatisfiedLinkError: ... initializeLibrary() ???

Postby TheWhite » Wed Aug 26, 2009 12:41 pm

Whatever you did, it fixed it.. lol

And yes, my own code now works perfectly!
TheWhite
 
Posts: 7
Joined: Tue Aug 25, 2009 4:14 pm

Re: [SOLVED] UnsatisfiedLinkError: ... initializeLibrary() ???

Postby Melloware » Wed Aug 26, 2009 12:45 pm

Excellent! I have marked this thread solved.

Let me know if you need anything else or if you want any applications you build put on the front page of JIntellitype.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
http://www.melloware.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
User avatar
Melloware
Site Admin
 
Posts: 11060
Joined: Thu Dec 01, 2005 10:24 pm
Location: Philadelphia, Pennsylvania USA


Return to JIntellitype

Who is online

Users browsing this forum: No registered users and 1 guest

cron