Pessoal,
Estou com um problema, quando eu carrego uma DLL via JNA que não tem dependencias ela funciona direitinho, agora quando eu carrego uma DLL que depende de outras DLL’s lança uma exceção bem esquisita.
Alguém poderia me ajudar
Exception.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'C:/bruno/itau_new/amb/cti.dll': Não foi possível encontrar o módulo especificado.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:163)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:236)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:379)
at com.sun.jna.Native.loadLibrary(Native.java:364)
at com.itautec.thunderbolt.jna.spec.CallingJNA.request(CallingJNA.java:18)
at com.itautec.thunderbolt.properties.impl.StartCommand.execute(StartCommand.java:24)
at com.speed.anywhere.swt.widget.spec.internal.AbstractCommandButton.widgetSelected(AbstractCommandButton.java:22)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at com.speed.anywhere.swt.tray.impl.internal.ShellEventLoop.runEventLoop(ShellEventLoop.java:17)
at com.speed.anywhere.swt.tray.spec.AbstractTray.create(AbstractTray.java:89)
at com.itautec.thunderbolt.Startup.initTray(Startup.java:36)
at com.itautec.thunderbolt.Startup.main(Startup.java:21)
public interface JNAPattern extends Library
{
/**
* @return Returns int
*/
public int ctiinicio();
}
public class CallingJNA
{
public JNAPattern request(String dll)
{
JNAPattern pattern;
try
{
pattern = (JNAPattern) Native.loadLibrary(dll, JNAPattern.class);
return pattern;
}
catch (Exception e)
{
Startup.showUnexpectedError(e);
}
return null;
}
}
protected void execute()
{
System.out.println("Testando");
CallingJNA jna;
JNAPattern pattern;
jna = new CallingJNA();
pattern = jna.request("C:/bruno/teste/amb/cti.dll");
System.out.println(pattern.ctiexec());
}