[x3d-public] X3DJSAIL, X3dToJava.xslt and DOM X3DLoaderObject testing:anotherClassCastException
John Carlson
yottzumm at gmail.com
Mon Apr 30 01:04:45 PDT 2018
Actually, no, that didn’t work. Hmm:
$ export CLASSPATH="lib/javax.json-api-1.0.jar;jars/X3DJSAIL.3.3.full.jar;classes"
$ jjs nashorn/examples/Json.js Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: org.web3d.x3d.jsail.Core.CommentsBlock
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:531)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Context.evaluateSource(Context.java:1438)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Context.load(Context.java:962)
at jdk.scripting.nashorn/jdk.nashorn.internal.objects.Global.load(Global.java:1719)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$1$Json.:program(nashorn/examples/Json.js:1)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.apply(Shell.java:519)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.runScripts(Shell.java:448)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.run(Shell.java:186)
at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:104)
at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:80)
Caused by: java.lang.ClassNotFoundException: org.web3d.x3d.jsail.Core.CommentsBlock
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Context.findClass(Context.java:1180)
at jdk.scripting.nashorn/jdk.nashorn.internal.objects.NativeJava.simpleType(NativeJava.java:546)
at jdk.scripting.nashorn/jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:326)
at jdk.scripting.nashorn/jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:318)
at jdk.scripting.nashorn/jdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:314)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$3$X3Dautoclass.:program(nashorn/node/X3Dautoclass.js:1)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
... 12 more
Tis a puzzle. Will run under ant.
Sent from Mail for Windows 10
From: John Carlson
Sent: Monday, April 30, 2018 3:51 AM
To: Don Brutzman
Cc: x3d-public at web3d.org
Subject: RE: X3DJSAIL, X3dToJava.xslt and DOM X3DLoaderObject testing:anotherClassCastException
Fixed classpath by setting it in the environment.
John
Sent from Mail for Windows 10
From: John Carlson
Sent: Monday, April 30, 2018 3:46 AM
To: Don Brutzman
Cc: x3d-public at web3d.org
Subject: RE: X3DJSAIL, X3dToJava.xslt and DOM X3DLoaderObject testing: anotherClassCastException
No Viewpoint children in X3D output. Could be a problem in X3DJSONLD or X3DLoaderObject, but currently looks like another class cast exception.
Also problem with X3DJSONLD in comments it looks like (now separated from JavaScript serializer, whew!), and handling tabs in scripts. Will work on those two.
Are we ready for me to run the equivalent of Json.js against all of the JSON archives?
Also a problem with generating JSON with classpath not containing jar.
In folder: /c/x3d-code/www.web3d.org/x3d/stylesheets/java
$ javac -cp lib/javax.json-api-1.0.jar src/net/coderextreme/X3DJSONLD.java
$ cp src/net/coderextreme/X3DJSONLD.class classes/net/coderextreme/
$ jjs -cp "jars/X3DJSAIL.3.3.full.jar;classes" nashorn/examples/Json.js
[X3DLoaderObject error] Incorrectly handled object construction, current elementObject=ViewpointGroup (ViewpointGroup), child=Viewpoint, java.lang.ClassCastException: org.web3d.x3d.jsail.Navigation.ViewpointGroupObject cannot be cast to org.web3d.x3d.sai.Grouping.X3DGroupingNode
java.lang.ClassCastException: org.web3d.x3d.jsail.Navigation.ViewpointGroupObject cannot be cast to org.web3d.x3d.sai.Grouping.X3DGroupingNode
at org.web3d.x3d.jsail.X3DLoaderObject.toX3dObjectTree(X3DLoaderObject.java:1062)
at org.web3d.x3d.jsail.X3DLoaderObject.toX3dObjectTree(X3DLoaderObject.java:542)
at org.web3d.x3d.jsail.X3DLoaderObject.toX3dObjectTree(X3DLoaderObject.java:542)
at org.web3d.x3d.jsail.X3DLoaderObject.toX3dObjectTree(X3DLoaderObject.java:430)
at org.web3d.x3d.jsail.X3DLoaderObject.toX3dObjectTree(X3DLoaderObject.java:399)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$372$Json$cu1$restOf.:program(nashorn/examples/Json.js:15)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.apply(Shell.java:519)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.runScripts(Shell.java:448)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.run(Shell.java:186)
at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:104)
at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:80)
[snip of identical error]
Warning: toFileX3D() is overwriting prior file ./examples/Json.x3d
Warning: toFileStylesheetConversion(X3dToJson.xslt) is overwriting prior file ./examples/Json.json
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException: ERROR_CONFIGURATION_X3DJSAIL X3DJSAIL jar archive "" not found in CLASSPATH=
at org.web3d.x3d.jsail.Core.X3DObject.toFileStylesheetConversion(X3DObject.java:1043)
at org.web3d.x3d.jsail.Core.X3DObject.toFileStylesheetConversion(X3DObject.java:863)
at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:1858)
at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$373$Json$cu1$restOf.:program(nashorn/examples/Json.js:17)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.apply(Shell.java:519)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.runScripts(Shell.java:448)
at jdk.scripting.nashorn/jdk.nashorn.tools.Shell.run(Shell.java:186)
at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:104)
at jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main.main(Main.java:80)
$ diff -w nashorn/examples/HelloWorldProgramOutput.Java.x3d nashorn/examples/Json.x3d
18c18
< <meta name='modified' content='7 April 2018'/>
---
> <meta name='modified' content='29 April 2018'/>
32a33,35
> <meta name='translated' content='29 April 2018'/>
> <meta name='generator' content='X3dToJson.xslt, http://www.web3d.org/x3d/stylesheets/X3dToJson.html'/>
> <meta name='reference' content='X3D JSON encoding: http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding'/>
35,38c38
< <ViewpointGroup description='Available viewpoints'>
< <Viewpoint DEF='DefaultView' description='Hello X3DJSAIL'/>
< <Viewpoint DEF='TopDownView' description='top-down view from above' orientation='1 0 0 -1.570796' position='0 100 0'/>
< </ViewpointGroup>
---
> <ViewpointGroup description='Available viewpoints'/>
86,88c86,88
< <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \"Immel did it!\""' -->
< <!-- alternative XML encoding: Text string='"One, Two, Comment" "" "He said, \"Immel did it!\"" ""' -->
< <!-- alternative Java source: .setString(new String [] {"One, Two, Comment", "", "He said, \"Immel did it!\""}) -->
---
> <!-- alternative XML encoding: Text string='"One, Two, Comment" " " "He said, \\"Immel did it!\\""' -->
> <!-- alternative XML encoding: Text string='"One, Two, Comment" " " "He said, \\"Immel did it!\\"" " "' -->
> <!-- alternative Java source: .setString(new String [] {"One, Two, Comment", " ", "He said, " "Immel did it!" " "}) -->
217c217
< enabled = newValue;
---
> \tenabled = newValue;
228,231c228,231
< if (enabled)
< {
< Browser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
< }
---
> \tif (enabled)
> \t{
> \t\tBrowser.print ('diffuseColor=(' + red + ',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
> \t}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180430/e3051a28/attachment-0001.html>
More information about the x3d-public
mailing list