Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-03-2008, 01:55 PM
hannehomuth's Avatar
Member
 
Join Date: Jul 2008
Location: Sommerfeld (Brandenburg, Germany)
Posts: 35
hannehomuth is on a distinguished road
[SOLVED] JNI gives Error undefined Symbol, do I miss an Headerfile?
Hello Everyone,
at first thank you for reading this post. I'd like to you use the gnome keyring manager to save/load Passwords out of my own java app. If tried things with dbus, but it seems not to work. Now I wanna to write my own wapper for the method calls to use the keyring manager. I started to write my Java class. It looks like this.
Code:
/** * * @author jhomuth */ public class KeyRingConnector { public native void addPasswordToKeyRingManger(); public native boolean isKeyRingDaemonAvailable(); static { Runtime.getRuntime().load("/usr/lib/libdbus-1.so.3"); Runtime.getRuntime().load("/usr/lib/libglib-2.0.so.0"); Runtime.getRuntime().load("/lib/i686/cmov/libc.so.6"); Runtime.getRuntime().load("/usr/lib/libpcre.so.3"); Runtime.getRuntime().load("/lib/libselinux.so.1"); Runtime.getRuntime().load("/lib/ld-linux.so.2"); Runtime.getRuntime().load("/usr/lib/libgnome-keyring.so"); Runtime.getRuntime().load("/home/jhomuth/projekte/LDAP/src/de/sourcepark/ldap/KeyRingConnector.dll"); } }

Furthermore I wrote the C Class which looks like this

Code:
//File: KeyRingConnector.c #include "de_sourcepark_ldap_KeyRingConnector.h" #include <jni.h> #include <stdio.h> #include <stdlib.h> #include <glib.h> #include <gnome-keyring.h> JNIEXPORT void JNICALL Java_de_sourcepark_ldap_KeyRingConnector_addPasswordToKeyRingManger (JNIEnv *env, jobject obj) { printf("Damm I used JNI"); } JNIEXPORT jboolean JNICALL Java_de_sourcepark_ldap_KeyRingConnector_isKeyRingDaemonAvailable (JNIEnv *env, jobject obj) { #define false 0 #define true (!false) if(gnome_keyring_is_available()) { return true; } else return false; }
But when I wanna run my Programm I get an java.lang.UnsatisfiedLinkError

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: /home/jhomuth/projekte/LDAP/src/de/sourcepark/ldap/KeyRingConnector.dll: /home/jhomuth/projekte/LDAP/src/de/sourcepark/ldap/KeyRingConnector.dll: undefined symbol: gnome_keyring_is_available

I think I'm missing a Headerfile in my C Class or do I have to load another library?

Thx for help
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-03-2008, 02:11 PM
hannehomuth's Avatar
Member
 
Join Date: Jul 2008
Location: Sommerfeld (Brandenburg, Germany)
Posts: 35
hannehomuth is on a distinguished road
I found it by myself. I've had to put the libgnome-keyring into my own dll using

gcc -shared -o KeyRingConnector.dll KeyRingConnector.o /usr/lib/libgnome-keyring.so
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-03-2008, 02:43 PM
Niveditha's Avatar
Senior Member
 
Join Date: May 2008
Posts: 299
Niveditha is on a distinguished road
Send a message via Skype™ to Niveditha
Please mark it as SOLVED..
__________________
To finish sooner, take your own time....
Nivedithaaaa
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
symbol not found error rmartyce New To Java 1 05-23-2008 06:58 AM
Cannot Resolve Symbol error... seral1969 New To Java 4 02-18-2008 01:17 AM
Error: cannot find symbol silvia New To Java 1 08-07-2007 06:39 AM
Error: cannot find symbol cachi AWT / Swing 1 08-06-2007 09:12 PM
Error: cannot resolve symbol, help me mathias Enterprise JavaBeans 1 08-06-2007 03:46 PM


All times are GMT +3. The time now is 02:14 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org