taksan / skype-java-api

Skype API for Java, based on Skype4Java library
128 stars 57 forks source link

Can't load library: D:\Temp\skype-java-api6587049293325832616\skype_x86.dll #12

Closed Oleg862 closed 12 years ago

Oleg862 commented 12 years ago

Hi I am running applet on Windows7 Ultimate 64

Java Plug-in 1.6.0_31 Using JRE version 1.6.0_31-b05 Java HotSpot(TM) Client VM 32

skype-java-api-1.4-SNAPSHOT.jar

28.02.2012 15:14:59 com.supportwizard.gui2.applets.skype.SkypeApplet init INFO: initialization init start Exception in thread "thread applet-com.supportwizard.gui2.applets.skype.SkypeApplet.class-1" java.lang.UnsatisfiedLinkError: Can't load library: D:\Temp\skype-java-api6587049293325832616\skype_x86.dll at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.load0(Unknown Source) at java.lang.System.load(Unknown Source) at com.skype.connector.win32.Win32Connector.initializeImpl(Win32Connector.java:103) at com.skype.connector.Connector.initialize(Connector.java:485) at com.skype.connector.Connector.connect(Connector.java:433) at com.skype.connector.Connector.assureAttached(Connector.java:985) at com.skype.connector.Connector.addConnectorListener(Connector.java:1051) at com.skype.connector.Connector.addConnectorListener(Connector.java:1023) at com.skype.connector.Connector.addConnectorListener(Connector.java:1005) at com.skype.Skype.addCallListener(Skype.java:893) at com.supportwizard.gui2.applets.skype.SkypeApplet.start(SkypeApplet.java:39) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

taksan commented 12 years ago

Hi,

Interesting. It seems to be trying to load the wrong library for a 64bit architecture.

I see that you're trying to use a 32bit jdk to compile it. Could you try a 64bit jdk instead and report whether it works?

Also, if you really want to use the 32bit, list the contents of the temporary directory and check if there's another dll extracted.

Oleg862 commented 12 years ago

Hi, It becomes clear. The temporary directory remains empty. I will test this with 64-bit jdk in couple of hours. I have to use 32-bit jdk on Windows since it works inside java-applet and it should run inside any browser

Oleg862 commented 12 years ago

I tried with 64bit jdk, it works great. However I really need it working with 32-bit jdk

Oleg862 commented 12 years ago

with 32-bit standalone application it works ok, it does not work inside applet. The problem is in ConnectorUtils.105 String classpath = getExtendedClasspath(); returns empty classpath: D:\PROGRA~2\Java\jre6\classes;

Oleg862 commented 12 years ago

I have fixed the problem. Here is a diff of ConnectorUtils.java

98c98 < extractFromJarUsingClassLoader(filename, filename, destinationDirectory);

      extracted = extractFromJarUsingClassLoader(filename, filename, destinationDirectory);

166,168c166 < Class clClass = Class.forName("com.simontuffs.onejar.JarClassLoader"); < Constructor[] constructor = clClass.getConstructors(); < cl = (ClassLoader) constructor[1].newInstance(ClassLoader.getSystemClassLoader());

        cl = ConnectorUtils.class.getClassLoader();