Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LiveConnect and XUL Runner on Mac

2 views
Skip to first unread message

Mike Desjardins

unread,
Mar 10, 2010, 7:50:38 PM3/10/10
to dev-te...@lists.mozilla.org
Hello,

I am trying to use LiveConnect to call some Java functions using LiveConnect
on OSX. I've done some googling and it seems a bit ambiguous whether or not
this even works anymore - I understand there was a lot of code cleanup
around Mozilla 2.x and LiveConnect. Complicating things is the fact that
Apple insists on shipping its own version of Java. But I'm hoping that this
should still work.

I've tried the basic recipe from the Mozilla site:

var clazz = java.lang.Class.forName("com.getbuzzbird.myClass",true,loader);
var method = clazz.getMethod("myMethod",[]);
method.invoke(null, []);

and I've even tried just a simple

var fooble = new java.lang.String("Fooble! Fobble! Foible!");

and both result in xulrunner's unceremonious death:

MacBookPro:~/_play/buzzbird> ./bang.sh
### MRJPlugin: getPluginBundle() here. ###
### MRJPlugin: CFBundleGetBundleWithIdentifier() succeeded. ###
### MRJPlugin: CFURLGetFSRef() succeeded. ###
JavaVM: requested Java version (1.5) not available. Using Java at
"/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home" instead.
2010-03-10 19:36:09.258 xulrunner[50855:e603] An uncaught exception was
raised
2010-03-10 19:36:09.396 xulrunner[50855:e603]
java.lang.NoClassDefFoundError: sun/plugin/javascript/webkit/JSObject
at jep.AppletHandlerFactory.callRegisterNatives(Native Method)
at jep.AppletHandlerFactory.initProperties(AppletHandlerFactory.java:254)
2010-03-10 19:36:09.565 xulrunner[50855:e603] *** Terminating app due to
uncaught exception 'JavaNativeException', reason:
'java.lang.NoClassDefFoundError: sun/plugin/javascript/webkit/JSObject'
*** Call stack at first throw:
(
0 CoreFoundation 0x9775c40a __raiseError + 410
1 libobjc.A.dylib 0x93f5c509 objc_exception_throw + 56
2 CoreFoundation 0x977a6a21 -[NSException raise] +
17
3 JavaPluginCocoa 0x0f2568ce registerNatives + 129
4 JavaEmbeddingPlugin 0x0f0a1a65 Java_callRegisterNatives
+ 402
5 ??? 0x1a80b839 0x0 + 444643385
)

Any ideas? If LiveConnect doesn't work, is there another way that I can
call into Java code from XULRunner without LiveConnect?

Thanks,
- Mike

0 new messages