got error trying to use rhino js embed pluggin

80 views
Skip to first unread message

dan bo

unread,
Feb 16, 2016, 9:49:01 AM2/16/16
to RoboVM
I try to run the pluggin compile "org.mozilla:rhino:1.7.8-SNAPSHOT" to embed javascript into code. works on desktop,android but get the following error on robovm 1.12 ios.
I tried to add the instructed patterns but received a file not found error.

Here is the full stacktrace:

[sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks:
[sts]      clean
[sts]      launchIPhoneSimulator
[sts] -----------------------------------------------------
Configuration on demand is an incubating feature.
:ios:clean
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:jar UP-TO-DATE
:ios:compileJavawarning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning

:ios:processResources UP-TO-DATE
:ios:classes
:ios:jar
:ios:assemble
:ios:compileTestJava UP-TO-DATE
:ios:processTestResources UP-TO-DATE
:ios:testClasses UP-TO-DATE
:ios:test UP-TO-DATE
:ios:check UP-TO-DATE
:ios:build
:ios:launchIPhoneSimulator
Root pattern com.badlogic.gdx.physics.bullet.** matches no classes
2016-02-17 01:42:49.004 IOSLauncher[1391:62265] [debug] IOSApplication: iOS version: 8.4

2016-02-17 01:42:49.005 IOSLauncher[1391:62265] [debug] IOSApplication: Running in 64-bit mode

2016-02-17 01:42:49.008 IOSLauncher[1391:62265] [debug] IOSApplication: scale: 2.0

2016-02-17 01:42:49.014 IOSLauncher[1391:62265] [debug] IOSApplication: Unscaled View: LandscapeRight 667x375

2016-02-17 01:42:49.015 IOSLauncher[1391:62265] [debug] IOSApplication: View: LandscapeRight 1334x750

2016-02-17 01:42:49.016 IOSLauncher[1391:62265] [debug] IOSGraphics: 1334.0x750.0, 2.0

2016-02-17 01:42:49.041 IOSLauncher[1391:62265] [debug] IOSGraphics: Display: ppi=264, density=1.65

2016-02-17 01:42:49.255 IOSLauncher[1391:62265] [debug] IOSApplication: created

PathClassLoader: can't find '/Users/telostia/Library/Developer/CoreSimulator/Devices/E118FCC6-A185-40DE-8205-09C7A3E9945C/data/Containers/Bundle/Application/7C3555C5-754E-4208-8D3B-52A0CBA9F911/IOSLauncher.app/lib/robovm-rt-1.12.0.jar'

PathClassLoader: can't find '/Users/telostia/Library/Developer/CoreSimulator/Devices/E118FCC6-A185-40DE-8205-09C7A3E9945C/data/Containers/Bundle/Application/7C3555C5-754E-4208-8D3B-52A0CBA9F911/IOSLauncher.app/lib/robovm-rt-1.12.0.jar'

PathClassLoader: can't find '/Users/telostia/Library/Developer/CoreSimulator/Devices/E118FCC6-A185-40DE-8205-09C7A3E9945C/data/Containers/Bundle/Application/7C3555C5-754E-4208-8D3B-52A0CBA9F911/IOSLauncher.app/lib/robovm-rt-1.12.0.jar'

PathClassLoader: can't find '/Users/telostia/Library/Developer/CoreSimulator/Devices/E118FCC6-A185-40DE-8205-09C7A3E9945C/data/Containers/Bundle/Application/7C3555C5-754E-4208-8D3B-52A0CBA9F911/IOSLauncher.app/lib/robovm-rt-1.12.0.jar'

PathClassLoader: can't find '/Users/telostia/Library/Developer/CoreSimulator/Devices/E118FCC6-A185-40DE-8205-09C7A3E9945C/data/Containers/Bundle/Application/7C3555C5-754E-4208-8D3B-52A0CBA9F911/IOSLauncher.app/lib/robovm-rt-1.12.0.jar'

PathClassLoader: can't find '/Users/telostia/Library/Developer/CoreSimulator/Devices/E118FCC6-A185-40DE-8205-09C7A3E9945C/data/Containers/Bundle/Application/7C3555C5-754E-4208-8D3B-52A0CBA9F911/IOSLauncher.app/lib/robovm-rt-1.12.0.jar'

2016-02-17 01:42:49.920 IOSLauncher[1391:62265] [debug] IOSApplication: resumed

8786373809311 [    1] WARN java.lang.Class: Class.forName() failed to load 'org.mozilla.javascript.optimizer.Codegen'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>org.mozilla.javascript.optimizer.Codegen</pattern></forceLinkClasses> to your robovm.xml file to link it in.

8786374886086 [    1] WARN java.lang.Class: Class.forName() failed to load 'org.mozilla.javascript.VMBridge_custom'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>org.mozilla.javascript.VMBridge_custom</pattern></forceLinkClasses> to your robovm.xml file to link it in.

8786374938323 [    1] WARN java.lang.Class: Class.forName() failed to load 'org.mozilla.javascript.jdk15.VMBridge_jdk15'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>org.mozilla.javascript.jdk15.VMBridge_jdk15</pattern></forceLinkClasses> to your robovm.xml file to link it in.
8786374982211 [    1] WARN java.lang.Class: Class.forName() failed to load 'org.mozilla.javascript.jdk13.VMBridge_jdk13'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>org.mozilla.javascript.jdk13.VMBridge_jdk13</pattern></forceLinkClasses> to your robovm.xml file to link it in.
8786375022049 [    1] WARN java.lang.Class: Class.forName() failed to load 'org.mozilla.javascript.jdk11.VMBridge_jdk11'. Use the -forcelinkclasses command line option or add <forceLinkClasses><pattern>org.mozilla.javascript.jdk11.VMBridge_jdk11</pattern></forceLinkClasses> to your robovm.xml file to link it in.
java.lang.ExceptionInInitializerError

    at org.mozilla.javascript.Context.enter(Context.java:399)
    at org.mozilla.javascript.Context.enter(Context.java:394)
    at
org.mozilla.javascript.Context.enter(Context.java:373)
    at com.telostia.fit.core.RPG.executeJS(RPG.java:93)
    at com.telostia.fit.object.base.Global.read(Global.java:54)
    at com.telostia.fit.view.TitleView.logic(TitleView.java:25)
    at com.telostia.fit.view.GameViews.render(GameViews.java:129)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics.draw(IOSGraphics.java:321)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.draw(IOSGraphics.java:201)
    at com.badlogic.gdx.backends.iosrobovm.IOSGraphics$1.$cb$drawRect$(IOSGraphics.java)
    at org.robovm.apple.uikit.UIApplication.main(Native Method)
    at org.robovm.apple.uikit.UIApplication.main(UIApplication.java:395)
    at com.telostia.fit.IOSLauncher.main(IOSLauncher.java:22)
Caused by: java.lang.IllegalStateException: Failed to create VMBridge instance

    at org.mozilla.javascript.VMBridge.makeInstance(VMBridge.java:38)
    at org.mozilla.javascript.VMBridge.<clinit>(VMBridge.java:18)
    ... 13 more


BUILD SUCCESSFUL

Total time: 46.002 secs
[sts] -----------------------------------------------------
[sts] Build finished succesfully!
[sts] Time taken: 0 min, 46 sec
[sts] -----------------------------------------------------

dan bo

unread,
Feb 16, 2016, 4:50:04 PM2/16/16
to RoboVM
This problem was fixed by adding the following patterns to the <forceLinkClasses></forceLinkClasses> :

<pattern>org.mozilla.javascript.*</pattern>
    <pattern>org.mozilla.javascript.jdk15.*</pattern>
    <pattern>org.mozilla.javascript.jdk13.*</pattern>
    <pattern>org.mozilla.javascript.jdk11.*</pattern>

Mario Zechner

unread,
Feb 17, 2016, 6:26:47 AM2/17/16
to RoboVM
IIRC Rhino is relying on runtime bytecode generation, which RoboVM can't support. I'd be very surprised if this worked even with the forcelink classes. Let us know how it went for you.
Reply all
Reply to author
Forward
0 new messages