This content has been marked as final.
Show 4 replies
-
1. Re: Apple Bonjour SDK and JavaFX
843851 Sep 30, 2009 8:16 PM (in response to 843851)No?
The error im getting is:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jdns_sd in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.apple.dnssd.AppleDNSSD.<clinit>(DNSSD.java:567)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.apple.dnssd.DNSSD.<clinit>(DNSSD.java:503)
at InControl.models.BonjourProxy.setup(BonjourProxy.java:61)
at InControl.models.BonjourProxy.<init>(BonjourProxy.java:50)
at InControl.controllers.StartupCommand.execute(StartupCommand.java:27)
at org.puremvc.java.core.controller.Controller.executeCommand(Controller.java:137)
at org.puremvc.java.core.controller.Controller$1.onNotification(Controller.java:168)
at org.puremvc.java.patterns.observer.Observer.notifyObserver(Observer.java:82)
at org.puremvc.java.patterns.observer.Observers.notifyObservers(Observers.java:94)
at org.puremvc.java.core.view.View.notifyObservers(View.java:119)
at org.puremvc.java.patterns.facade.Facade.notifyObservers(Facade.java:382)
at InControl.ApplicationFacade.startup(ApplicationFacade.java:57)
at InControl.InControlJavaApp.startup(InControlJavaApp.java:22)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I have had a look inside the source for Apple's Bonjour in the DNSSD.java class and its falling over at this part:
class AppleDNSSD extends DNSSD
{
static
{
System.loadLibrary( "jdns_sd");
int libInitResult = InitLibrary( 1);
if ( libInitResult != DNSSDException.NO_ERROR)
throw new InternalError( "cannot instantiate DNSSD: " + new AppleDNSSDException( libInitResult).getMessage());
}
...
So it looks like they are using JNI to load a system library, but why this works fine for the JDK and not for JavaFX i dont know...
Im sure its just something to do with the way my project is setup, anyone? -
2. Re: Apple Bonjour SDK and JavaFX
843851 Oct 2, 2009 9:46 AM (in response to 843851)So none know why System.loadLibrary( "jdns_sd"); is falling over on JavaFX? But works in a regular JDK project? -
3. Re: Apple Bonjour SDK and JavaFX
philho Oct 2, 2009 10:29 AM (in response to 843851)I guess you don't have much answer because nobody (?) use Apple Bonjour... :-) Not even sure what it is exactly (agenda synchronization?).
Anyway, that's right, it is probably more a problem of Java than something else.
Try:
On my system, it shows only {color:#8000A0}*C:\Java\javafx-sdk1.2.1\bin\..\lib\desktop*{color} while on a Java program, it shows lots more, including Windows system dirs and such stuff in the PATH.println(System.getProperty("java.library.path").replaceAll(System.getProperty("path.separator"), '\n'));
So perhaps you have to add a {color:#8000A0}*-Djava.library.path=X:/location/of/the/dll*{color} to the command line/start parameters of your JavaFX application.
If you have done that already, not sure what else to advice. -
4. Re: Apple Bonjour SDK and JavaFX
843851 Oct 2, 2009 2:30 PM (in response to philho)Unfortunately I have already tried doing that to no avail.
Apple Bonjour is a Zero-config service for networking, allowing me to see other services on a local network.
For anyone that stumbles accross this thread, I have decided to go with a pure-java alternative JMDNS instead, and this now works.