25 messages in net.java.dev.jna.usersRe: [jna-users] JNA - java.awt Depend...
FromSent OnAttachments
Novatchkov HristoFeb 26, 2009 2:14 am 
Timothy WallFeb 26, 2009 5:54 am 
Hristo NovatchkovFeb 27, 2009 4:11 pm 
Timothy WallFeb 27, 2009 7:21 pm 
Hristo NovatchkovFeb 28, 2009 3:03 am 
Timothy WallFeb 28, 2009 4:16 am 
Hristo NovatchkovFeb 28, 2009 4:30 am 
Timothy WallFeb 28, 2009 5:17 am 
Novatchkov HristoMar 4, 2009 3:06 am 
Novatchkov HristoMar 4, 2009 8:13 am 
Timothy WallMar 4, 2009 8:38 am 
Novatchkov HristoMar 5, 2009 12:19 am 
Novatchkov HristoMar 5, 2009 12:59 am 
Timothy WallMar 5, 2009 8:24 am 
Novatchkov HristoMar 10, 2009 7:42 am 
Timothy WallMar 10, 2009 8:21 am 
Novatchkov HristoMar 11, 2009 2:02 am 
Timothy WallMar 11, 2009 5:11 am 
Novatchkov HristoMar 11, 2009 5:56 am 
Timothy WallMar 11, 2009 6:03 am 
Hristo NovatchkovMar 15, 2009 9:05 am 
Timothy WallMar 15, 2009 12:09 pm 
youc...@free.frMar 16, 2009 3:51 am 
Novatchkov HristoMar 16, 2009 4:00 am 
Timothy WallMar 16, 2009 6:17 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] JNA - java.awt DependencyActions...
From:Timothy Wall (twal@dev.java.net)
Date:Feb 28, 2009 5:17:39 am
List:net.java.dev.jna.users

J9 shouldn't be trying to run DeleteNativeLibrary, since it requires Runtime.exec which isn't supported by J9. This error is happening as the shutdown hook is being run, but it may be that J9 is simply re- throwing an earlier exception.

Define a stub for ByteBuffer, and be sure to include any referenced methods (you can look in native/dispatch.c to see which method IDs are loaded for ByteBuffer).

On Feb 28, 2009, at 7:31 AM, Hristo Novatchkov wrote:

Yes, I'd also say that it has to do with the Lotus Expeditor VM, which is based on J9 though. More precisely, it could be also the combination of the VM and the jna jar since right now after trying to include classes like java.awt.Window but also java.nio.Buffer directly in the classpath of the Lotus Expeditor VM the error code looks different:

JNA: Problems loading core IDs: ByteBuffer.array Exception in thread "Thread-5" java.lang.NoClassDefFoundError: com.sun.jna.Native (initialization failure) at java.lang.J9VMInternals.initialize(J9VMInternals.java:127) at com.sun.jna.Native$DeleteNativeLibrary.unload(Native.java:738) at com.sun.jna.Native$DeleteNativeLibrary.run(Native.java:759) Caused by: java.lang.UnsatisfiedLinkError: C:\Users\ico\AppData\Local \Temp\jna66491.tmp (Incompatible JNI version (not 1.1, 1.2 or 1.4)) at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:955) at java.lang.System.load(System.java:443) at com.sun.jna.Native.loadNativeLibraryFromJar(Native.java:609) at com.sun.jna.Native.loadNativeLibrary(Native.java:550) at com.sun.jna.Native.<clinit>(Native.java:87) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(J9VMInternals.java:187) at mobile.coaching.InvokeNative.init(InvokeNative.java:31) at mobile.coaching.UI$4.widgetSelected(UI.java:184) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:475) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java: 1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java: 1382) at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) at org.eclipse.ui.internal.Workbench.runUI(Unknown Source) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source) at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source) at org.eclipse.core.internal.runtime.PlatformActivator $1.run(PlatformActivator.java:78) at org .eclipse .core .runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source) at org .eclipse .core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at java.lang.reflect.AccessibleObject.invokeL(AccessibleObject.java:213) at java.lang.reflect.Method.invoke(Method.java:278) at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Unknown Source) at org.eclipse.core.launcher.Main.run(Unknown Source) at org.eclipse.core.launcher.Main.main(Unknown Source)

This time the initialization of JNA seems to fail. Also the JNI versions are not disliked by Eclipse and the VM. How can I interpret that error code? I'm afraid that the project properties have been completely messed up now.

Timothy Wall schrieb:

This probably has more to do with lotus expeditor than the J9 VM. Make sure the java.awt stub classes are present in whatever classes get downloaded to your client. You may have to explicitly mark the java.awt classes/package as being included in your bundle.

On Feb 28, 2009, at 6:03 AM, Hristo Novatchkov wrote:

My own classes are inside a package called mobile.coaching. Parallel to that I have created a package called jawa.awt, where I place classes (like Window) which can't be found during runtime. This structure wouldn't influence the error output at all. Is this the right way to do it? (I'm using Eclipse 3.2.2 and IBM Lotus Expeditor 6.1.1.)

Timothy Wall schrieb:

What happens when you create a dummy java.awt.Window class? How does your system fail? You should be able to add empty classes for java.awt.Window and java.awt.Component to the rest of your Java classes, and that will avoid the NoClassDefFoundError.

The fact that your VM doesn't support jawt shouldn't matter since the library is loaded dynamically in response to a call to one of the window id retrieval functions.

On Feb 27, 2009, at 7:12 PM, Hristo Novatchkov wrote:

First of all thanks for your reply! Unfortunately I am still facing the same problem with the use of the jclDevice runtime (java.lang.NoClassDefFoundError: java.awt.Window) when including the jna.jar file. The thing is that jclDevice doesn't support java.awt and it's almost impossible to add that package in the classpath (at least for me - I have tried to add single java.awt classes and also the whole rt.jar file). Additionaly I tried your suggestion - building up a simulative jawa.awt package (parallel to my own package), though, that didn't work either. Has somebody experienced similar problems?

Timothy Wall schrieb:

You can always stub out java.awt.Window with your own class. I believe others have used J9 successfully with only minor adjustments.

Patches are welcome to facilitate using JNA in the absence of AWT; currently I believe you'll get an UnsatisfiedLinkError on jawt only if you try to use any of the window ID access functionality.

On Feb 26, 2009, at 5:14 AM, Novatchkov Hristo wrote:

Dear JNA developers,

I am using IBM Lotus Expeditor in order to implement eRCP applications for mobile devices (jclDevice). Right now I want to load a dll file with the help of jna. Unfortunately the VM integrated in IBM Lotus Expeditor is the J9 VM, which doesn’t support java packages like java.awt. Thus, when I try to run the application and add the jna.jar-file into the classpath I get the following error:

java.lang.NoClassDefFoundError: java.awt.Window at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:63) at java.lang.J9VMInternals.initialize(J9VMInternals.java:124) at mobile.coaching.InvokeNative.init(InvokeNative.java:24) at mobile.coaching.UI$4.widgetSelected(UI.java:185) at org .eclipse .swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:475) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java: 1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java: 1382) at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) at org.eclipse.ui.internal.Workbench.runUI(Unknown Source) at org .eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source) at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source) at org.eclipse.core.internal.runtime.PlatformActivator $1.run(PlatformActivator.java:78) at org .eclipse .core .runtime .internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source) at org .eclipse .core .runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at java .lang.reflect.AccessibleObject.invokeL(AccessibleObject.java: 213) at java.lang.reflect.Method.invoke(Method.java:278) at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Unknown Source) at org.eclipse.core.launcher.Main.run(Unknown Source) at org.eclipse.core.launcher.Main.main(Unknown Source) Unhandled event loop exception Reason: java.lang.NoClassDefFoundError: java.awt.Window at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:63) at java.lang.J9VMInternals.initialize(J9VMInternals.java:124) at mobile.coaching.InvokeNative.init(InvokeNative.java:24) at mobile.coaching.UI$4.widgetSelected(UI.java:185) at org .eclipse .swt.widgets.TypedListener.handleEvent(TypedListener.java:89) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:475) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java: 1527) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java: 1382) at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) at org.eclipse.ui.internal.Workbench.runUI(Unknown Source) at org .eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source) at com.ibm.ercp.hworkbench.eWorkbench.run(Unknown Source) at org.eclipse.core.internal.runtime.PlatformActivator $1.run(PlatformActivator.java:78) at org .eclipse .core .runtime .internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source) at org .eclipse .core .runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source) at java .lang.reflect.AccessibleObject.invokeL(AccessibleObject.java: 213) at java.lang.reflect.Method.invoke(Method.java:278) at org.eclipse.core.launcher.Main.invokeFramework(Unknown Source) at org.eclipse.core.launcher.Main.basicRun(Unknown Source) at org.eclipse.core.launcher.Main.run(Unknown Source) at org.eclipse.core.launcher.Main.main(Unknown Source) java.awt.Window

This is most likely due to the import of some java.awt classes in the com.sun.jna.Native class. (https://jna.dev.java.net/source/browse/jna/trunk/jnalib/src/com/sun/jna/Native.java?rev=755&view=markup ) Are those packages really essential for the realization of JNA? Is there a way to deal with such issues?

Thanks in advance, Hristo Novatchkov