Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

debugging jnilib from XCode



Hi
I have some problem with debugging my jnilib.
here is my story

1. I created jnilib application from Project New template
and I was able to debug jnilib in that project
so it's possible to debug jnilib from XCode in principle
good news :-)

2. I created my application that uses my jnilib library
and here I have a problem
I created executable that looks very similar to executable from template above:

path: /usr/bin/java
launch arguments: -cp WebKit.jar org.dm.webkit.WebKitJava
choose working directory : Product directory: /Users/dima/Projects/JavaProjects/1.4/WebKitSample/build
so when I try to run that executable
I got the error:

java.lang.UnsatisfiedLinkError: /Users/dima/Projects/JavaProjects/1.4/WebKitSample/build/ libwebkitsample.jnilib:
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at org.dm.webkit.WebKitJava.<clinit>(WebKitJava.java:13)
Exception in thread "main" java.lang.UnsatisfiedLinkError: createNSView
at org.dm.webkit.WebKitJava.createNSView(Native Method)
at apple.awt.CToolkit.createCanvas(CToolkit.java:368)
at java.awt.Canvas.addNotify(Canvas.java:74)
at org.dm.webkit.DMWebKitView.addNotify(DMWebKitView.java:42)
at java.awt.Container.addNotify(Container.java:2049)
at java.awt.Window.addNotify(Window.java:418)
at java.awt.Frame.addNotify(Frame.java:482)
at java.awt.Window.show(Window.java:459)
at org.dm.webkit.WebKitJava.main(WebKitJava.java:141)


if I run the following command from the terminal

cd /Users/dima/Projects/JavaProjects/1.4/WebKitSample/build
java -cp WebKit.jar org.dm.webkit.WebKitJava

EVERYTHING IS FINE!

if I remove libwebkitsample.jnilib from the
/Users/dima/Projects/JavaProjects/1.4/WebKitSample/build
folder I got the other error:

java.lang.UnsatisfiedLinkError: no webkitsample in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)
.....

so when I HAVE libwebkitsample.jnilib in the directory
I'm getting different error, that means that java indeed CAN FIND that jnilib
but for some unknown reason fails to load that library (again only from XCode)
it looks like that system fails to load jnilib because it can't find
some dynamic libraries, but I don't use any dynamic libraries
(at least explicitly)
jnilib target is old style target (not native)
it includes the following frameworks:
Cocoa.framework
JavaVM.framework
WebKit.framework
and
libstd++.a static library

(Apple's jnilib template uses only JavaVM.framework
so maybe WebKit.framework tries to load some dynamic libraries and fails)
I played with java.library.path but it didn't help.

thanks

Dmitry Markman
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.