[x3d-public] Testing X3DJSAIL from NetBeans. IMPORTANT!

John Carlson yottzumm at gmail.com
Sat Jun 19 16:23:05 PDT 2021


I think the issue here is the unvalidated scene graph.  That's why I 
write out the XML after loading with X3DJSONLD before I send it to 
X3DLoaderDOM.  My problem is, I don't know what to compare the 
intermediate XML with. What I will attempt to do is read in 
HelloWorldProgramOutputCanonical.xml and see if I get the same 
X3DLoaderDOM issues.


John


*** [X3DLoaderDOM error] Incorrectly handled X3DJSAIL object 
construction, current elementObject=LoadSensor (LoadSensor), 
child="Anchor", containerField="", java.lang.ClassCastException: class 
org.web3d.x3d.jsail.Networking.LoadSensor cannot be cast to class 
org.web3d.x3d.sai.Grouping.X3DGroupingNode 
(org.web3d.x3d.jsail.Networking.LoadSensor and 
org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of 
loader 'app')
     This error can be caused by incorrect parent-child node 
relationships or incorrect containerField values.
     X3D node typing is strict, check or validate your scene graph!
     This error can also be caused by X3DLoaderDOM DOM omissions in 
X3DJSAIL. Please report mysterious problems, thank you.

*** [X3DLoaderDOM error] Parent-child node relationship not found! 
(parent LoadSensor, child Inline, containerField='') Please report this 
problem to brutzman at nps.edu
java.lang.ClassCastException: class 
org.web3d.x3d.jsail.Networking.LoadSensor cannot be cast to class 
org.web3d.x3d.sai.Grouping.X3DGroupingNode 
(org.web3d.x3d.jsail.Networking.LoadSensor and 
org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of 
loader 'app')
     at 
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:1352)
     at 
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
     at 
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
     at 
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:490)
     at 
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:453)
     at org.web3d.x3d.tests.JsonLoaderTest.main(JsonLoaderTest.java:23)

On 6/19/21 6:14 PM, John Carlson wrote:
> The important point from all of this, is that JSON input to X3DJSAIL 
> does not produce XML that is compatible with Java the JSON was created 
> from.  Indeed, I don't even know if the non-canonical XML is 
> compatible with the canonical XML. I don't know how to build the 
> HelloWorldProgramOutputCanonical.x3d at this point (oh, there's a .xml 
> version).   Where is an officially generated XML file that I can 
> compare against, and all I have is Java? I'm really getting confused 
> comparing all these different XML files. I would prefer to compare 
> JSON from Java (generated in Don's test) to JSON from Java (in my 
> test), so we can properly test my usage of the X3DLoaderDOM to load my 
> Document that I created from JSON in X3DJSONLD.java
>
> I created a test in NetBeans, under 
> www_web3d_org/x3d/stylesheets/java/tests/org/web3d/x3d/tests/JsonLoaderTest.java 
> (attached), derived from JsonConversion.java
>
> I ran the file, it's not a proper JUnit test case.
>
>
> It produced 2 .x3d files, an .xml file, and no .json file, perhaps 
> because of this output?
>
> CLASSPATH=/c/x3d-code/www.web3d.org/x3d/stylesheets/java/classes:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/exificient-gui-jar-with-dependencies.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/jdom.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/javax.json-api-1.0.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/support/jaxb/jaxb-api.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/nagasena.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/nagasena-rta.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/saxon9he.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/X3dC14n.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/support/junit-platform-commons-1.5.0.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/support/opentest4j-1.1.0.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/support/junit-platform-launcher-1.5.0.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/support/jupiter/junit-jupiter-api-5.5.0.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/support/jupiter/junit-jupiter-engine-5.5.0.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/lib/support/apiguardian-api-1.1.0.jar:/c/x3d-code/www.web3d.org/x3d/stylesheets/java/classes/test/classes 
>
>   invoked from toFileStylesheetConversion(X3dToJson.xslt, 
> examples/JsonLoaderTest.json, normalizeCommentWhitespace, true, , )
>
>     at 
> org.web3d.x3d.jsail.Core.X3D.toFileStylesheetConversion(X3D.java:1171)
>     at 
> org.web3d.x3d.jsail.Core.X3D.toFileStylesheetConversion(X3D.java:1024)
>     at org.web3d.x3d.jsail.Core.X3D.toFileJSON(X3D.java:1835)
>     at org.web3d.x3d.tests.JsonLoaderTest.main(JsonLoaderTest.java:23)
>
> (The X3DJSAIL jar file wasn't found--Not going there right now)
>
> The files are here:
>
> ./www_web3d_org/x3d/stylesheets/java/tests/org/web3d/x3d/tests/JsonLoaderTest.java 
>
> ./www_web3d_org/x3d/stylesheets/java/examples/JsonLoaderTest.x3d
> ./www_web3d_org/x3d/stylesheets/java/examples/JsonLoaderTestPrettyPrint.intermediate.x3d 
>
>
> ./www_web3d_org/x3d/stylesheets/java/examples/LoadedJsonConversion.xml
>
>
> Here is an important diff to project.properties for cross-platform 
> compatibility:
>
> ndex: java/nbproject/project.properties
> ===================================================================
> --- java/nbproject/project.properties   (revision 32247)
> +++ java/nbproject/project.properties   (working copy)
> @@ -37,17 +37,17 @@
>  endorsed.classpath=
>  excludes=
>  file.reference.java-src=src
> -file.reference.apiguardian-api-1.0.0.jar=C:\\apache-ant-1.10.5\\lib\\apiguardian-api-1.0.0.jar 
>
> +file.reference.apiguardian-api-1.0.0.jar=lib/support/apiguardian-api-1.1.0.jar 
>
>  file.reference.jdom.jar=lib/jdom.jar
> -file.reference.junit-jupiter-api.jar=C:\\apache-ant-1.10.5\\lib\\jupiter\\junit-jupiter-api.jar 
>
> -file.reference.junit-jupiter-engine.jar=C:\\apache-ant-1.10.5\\lib\\jupiter\\junit-jupiter-engine.jar 
>
> -file.reference.junit-platform-commons.jar=C:\\apache-ant-1.10.5\\lib\\junit-platform-commons.jar 
>
> -file.reference.junit-platform-engine.jar=C:\\apache-ant-1.10.5\\lib\\junit-platform-engine.jar 
>
> -file.reference.junit-platform-launcher.jar=C:\\apache-ant-1.10.5\\lib\\junit-platform-launcher.jar 
>
> +file.reference.junit-jupiter-api.jar=lib/support/jupiter/junit-jupiter-api-5.5.0.jar 
>
> +file.reference.junit-jupiter-engine.jar=lib/support/jupiter/junit-jupiter-engine-5.5.0.jar 
>
> +file.reference.junit-platform-commons.jar=lib/support/junit-platform-commons-1.5.0.jar 
>
> +file.reference.junit-platform-engine.jar=lib/support/junit-platform-engine-1.5.0.jar 
>
> +file.reference.junit-platform-launcher.jar=lib/support/junit-platform-launcher-1.5.0.jar 
>
>  file.reference.jaxb-api.jar=lib/support/jaxb/jaxb-api.jar
>  file.reference.nagasena-rta.jar=lib/nagasena-rta.jar
>  file.reference.nagasena.jar=lib/nagasena.jar
> -file.reference.opentest4j-1.1.0.jar=C:\\apache-ant-1.10.5\\lib\\opentest4j-1.1.0.jar 
>
> +file.reference.opentest4j-1.1.0.jar=lib/support/opentest4j-1.1.0.jar
>  file.reference.exificient-gui-jar-with-dependencies.jar=lib/exificient-gui-jar-with-dependencies.jar 
>
>  file.reference.javax.json-api-1.0.jar=lib/javax.json-api-1.0.jar
>  file.reference.saxon9he.jar=lib/saxon9he.jar
>
> There are scads more things to deal with JavaLoaderTest.java, as have 
> been previously reported, but from my diffs, and all the errors 
> thrown, it kind of appears that the X3DLoaderDOM is causing the 
> problem.   But I agree it could be indenting/parent-child issues with 
> X3DJSONLD.  I just haven't got any smoking gun which points to 
> X3DJSONLD in my diffs.   Someone more experienced with diffing XML 
> (and has diffing tools like XMLSpy should take over debugging).
>
> So we can load JSON, roughly, but there are problems writing out 
> JSON.  I haven't figured out if there's an issue with loading the JSON 
> yet, as the XML printed in the middle, 
> "examples/LoadedJsonConversion.xml", has different indenting and 
> quoting.  What I used to verify the JSON was the output JSON, which is 
> currently unavailable due to X3DJSAIL jar not being in the CLASSPATH.
>
> We have a good test case and code, it's just that my XML diffing tools 
> are crap.
>
> I will pursue running under debug next.
>
> John
>




More information about the x3d-public mailing list