[x3d-public] X3DJSAIL, X3dToJava.xslt and DOM X3DLoaderObject testing: another ClassCastException

John Carlson yottzumm at gmail.com
Mon Apr 30 00:46:40 PDT 2018


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/1ccbae29/attachment-0001.html>


More information about the x3d-public mailing list