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:Hristo Novatchkov (hris@univie.ac.at)
Date:Feb 27, 2009 4:11:43 pm
List:net.java.dev.jna.users

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