<div dir="auto">There should be a Java attachment to this email.</div><div dir="auto">Please try to run in with the X3DJSAIL jar in the classpath.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <strong class="gmail_sendername" dir="auto">John Carlson</strong> <span dir="auto"><<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>></span><br>Date: Sat, Jun 19, 2021 at 6:49 PM<br>Subject: Re: Testing X3DJSAIL from NetBeans. IMPORTANT!<br>To: Don Brutzman <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>>, X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br></div><br><br>Here are the 2 telling diffs (minus output):<br>
<br>
x3d/stylesheets/java/examples$ diff JsonLoaderTest.x3d <br>
HelloWorldProgramOutputCanonical.xml |less<br>
<br>
At the end of the diff, there is:<br>
<br>
362a369,381<br>
 >       <Anchor USE='siteAnchor'/><br>
 >       <Inline USE='inlineScene'/><br>
 >       <DISEntityTypeMapping/><br>
 >       <GeoMetadata/><br>
 >       <AudioClip/><br>
 >       <ImageCubeMapTexture/><br>
 >       <ImageTexture3D/><br>
 >       <ImageTexture/><br>
 >       <MovieTexture/><br>
 >       <Script/><br>
 >       <PackagedShader/><br>
 >       <ShaderPart/><br>
 >       <ShaderProgram/><br>
<br>
<br>
So there are a lot of elements removed by JsonLoaderTest.java<br>
<br>
x3d/stylesheets/java/examples$ diff -w LoadedJsonConversion.xml <br>
HelloWorldProgramOutputCanonical.xml |less<br>
<br>
<br>
No comparable list of missing elements in LoaderJsonConversion.xml, <br>
which comes after X3DJSONLD loading.<br>
<br>
<br>
Indeed, they appear to be present:<br>
<br>
<br>
426,427c369,370<br>
<             <Anchor USE="siteAnchor"/><br>
<             <Inline USE="inlineScene"/><br>
---<br>
 >       <Anchor USE='siteAnchor'/><br>
 >       <Inline USE='inlineScene'/><br>
437,438c380,381<br>
<             <ShaderPart type="VERTEX"/><br>
<             <ShaderProgram type="VERTEX"/><br>
---<br>
 >       <ShaderPart/><br>
 >       <ShaderProgram/><br>
<br>
<br>
This is the main reason why I think X3DLoaderDOM.java is the issue.   <br>
But it's not detectable by loading the XML with X3DLoaderDOM--only the <br>
DOM created from X3DJSONLD, which seems very confusing.<br>
<br>
AAAAAAAAAAAAAAAAAAAAAAAAAAARGH!<br>
<br>
And there appear to be a lot of errors with LoadSensor in the NetBeans <br>
logs.  That will lead towards a solution for that.<br>
<br>
<br>
Then there's the DIS stuff.  We'll get to that next.<br>
<br>
John<br>
<br>
On 6/19/21 6:23 PM, John Carlson wrote:<br>
> I think the issue here is the unvalidated scene graph.  That's why I <br>
> write out the XML after loading with X3DJSONLD before I send it to <br>
> X3DLoaderDOM.  My problem is, I don't know what to compare the <br>
> intermediate XML with. What I will attempt to do is read in <br>
> HelloWorldProgramOutputCanonical.xml and see if I get the same <br>
> X3DLoaderDOM issues.<br>
><br>
><br>
> John<br>
><br>
><br>
> *** [X3DLoaderDOM error] Incorrectly handled X3DJSAIL object <br>
> construction, current elementObject=LoadSensor (LoadSensor), <br>
> child="Anchor", containerField="", java.lang.ClassCastException: class <br>
> org.web3d.x3d.jsail.Networking.LoadSensor cannot be cast to class <br>
> org.web3d.x3d.sai.Grouping.X3DGroupingNode <br>
> (org.web3d.x3d.jsail.Networking.LoadSensor and <br>
> org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of <br>
> loader 'app')<br>
>     This error can be caused by incorrect parent-child node <br>
> relationships or incorrect containerField values.<br>
>     X3D node typing is strict, check or validate your scene graph!<br>
>     This error can also be caused by X3DLoaderDOM DOM omissions in <br>
> X3DJSAIL. Please report mysterious problems, thank you.<br>
><br>
> *** [X3DLoaderDOM error] Parent-child node relationship not found! <br>
> (parent LoadSensor, child Inline, containerField='') Please report <br>
> this problem to <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
> java.lang.ClassCastException: class <br>
> org.web3d.x3d.jsail.Networking.LoadSensor cannot be cast to class <br>
> org.web3d.x3d.sai.Grouping.X3DGroupingNode <br>
> (org.web3d.x3d.jsail.Networking.LoadSensor and <br>
> org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of <br>
> loader 'app')<br>
>     at <br>
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:1352)<br>
>     at <br>
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)<br>
>     at <br>
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)<br>
>     at <br>
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:490)<br>
>     at <br>
> org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:453)<br>
>     at org.web3d.x3d.tests.JsonLoaderTest.main(JsonLoaderTest.java:23)<br>
><br>
> On 6/19/21 6:14 PM, John Carlson wrote:<br>
>> The important point from all of this, is that JSON input to X3DJSAIL <br>
>> does not produce XML that is compatible with Java the JSON was <br>
>> created from.  Indeed, I don't even know if the non-canonical XML is <br>
>> compatible with the canonical XML. I don't know how to build the <br>
>> HelloWorldProgramOutputCanonical.x3d at this point (oh, there's a <br>
>> .xml version).   Where is an officially generated XML file that I can <br>
>> compare against, and all I have is Java? I'm really getting confused <br>
>> comparing all these different XML files. I would prefer to compare <br>
>> JSON from Java (generated in Don's test) to JSON from Java (in my <br>
>> test), so we can properly test my usage of the X3DLoaderDOM to load <br>
>> my Document that I created from JSON in X3DJSONLD.java<br>
>><br>
>> I created a test in NetBeans, under <br>
>> www_web3d_org/x3d/stylesheets/java/tests/org/web3d/x3d/tests/JsonLoaderTest.java <br>
>> (attached), derived from JsonConversion.java<br>
>><br>
>> I ran the file, it's not a proper JUnit test case.<br>
>><br>
>><br>
>> It produced 2 .x3d files, an .xml file, and no .json file, perhaps <br>
>> because of this output?<br>
>><br>
>> CLASSPATH=/c/x3d-code/<a href="http://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" rel="noreferrer" target="_blank">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</a> <br>
>><br>
>>   invoked from toFileStylesheetConversion(X3dToJson.xslt, <br>
>> examples/JsonLoaderTest.json, normalizeCommentWhitespace, true, , )<br>
>><br>
>>     at <br>
>> org.web3d.x3d.jsail.Core.X3D.toFileStylesheetConversion(X3D.java:1171)<br>
>>     at <br>
>> org.web3d.x3d.jsail.Core.X3D.toFileStylesheetConversion(X3D.java:1024)<br>
>>     at org.web3d.x3d.jsail.Core.X3D.toFileJSON(X3D.java:1835)<br>
>>     at org.web3d.x3d.tests.JsonLoaderTest.main(JsonLoaderTest.java:23)<br>
>><br>
>> (The X3DJSAIL jar file wasn't found--Not going there right now)<br>
>><br>
>> The files are here:<br>
>><br>
>> ./www_web3d_org/x3d/stylesheets/java/tests/org/web3d/x3d/tests/JsonLoaderTest.java <br>
>><br>
>> ./www_web3d_org/x3d/stylesheets/java/examples/JsonLoaderTest.x3d<br>
>> ./www_web3d_org/x3d/stylesheets/java/examples/JsonLoaderTestPrettyPrint.intermediate.x3d <br>
>><br>
>><br>
>> ./www_web3d_org/x3d/stylesheets/java/examples/LoadedJsonConversion.xml<br>
>><br>
>><br>
>> Here is an important diff to project.properties for cross-platform <br>
>> compatibility:<br>
>><br>
>> ndex: java/nbproject/project.properties<br>
>> ===================================================================<br>
>> --- java/nbproject/project.properties   (revision 32247)<br>
>> +++ java/nbproject/project.properties   (working copy)<br>
>> @@ -37,17 +37,17 @@<br>
>>  endorsed.classpath=<br>
>>  excludes=<br>
>>  file.reference.java-src=src<br>
>> -file.reference.apiguardian-api-1.0.0.jar=C:\\apache-ant-1.10.5\\lib\\apiguardian-api-1.0.0.jar <br>
>><br>
>> +file.reference.apiguardian-api-1.0.0.jar=lib/support/apiguardian-api-1.1.0.jar <br>
>><br>
>>  file.reference.jdom.jar=lib/jdom.jar<br>
>> -file.reference.junit-jupiter-api.jar=C:\\apache-ant-1.10.5\\lib\\jupiter\\junit-jupiter-api.jar <br>
>><br>
>> -file.reference.junit-jupiter-engine.jar=C:\\apache-ant-1.10.5\\lib\\jupiter\\junit-jupiter-engine.jar <br>
>><br>
>> -file.reference.junit-platform-commons.jar=C:\\apache-ant-1.10.5\\lib\\junit-platform-commons.jar <br>
>><br>
>> -file.reference.junit-platform-engine.jar=C:\\apache-ant-1.10.5\\lib\\junit-platform-engine.jar <br>
>><br>
>> -file.reference.junit-platform-launcher.jar=C:\\apache-ant-1.10.5\\lib\\junit-platform-launcher.jar <br>
>><br>
>> +file.reference.junit-jupiter-api.jar=lib/support/jupiter/junit-jupiter-api-5.5.0.jar <br>
>><br>
>> +file.reference.junit-jupiter-engine.jar=lib/support/jupiter/junit-jupiter-engine-5.5.0.jar <br>
>><br>
>> +file.reference.junit-platform-commons.jar=lib/support/junit-platform-commons-1.5.0.jar <br>
>><br>
>> +file.reference.junit-platform-engine.jar=lib/support/junit-platform-engine-1.5.0.jar <br>
>><br>
>> +file.reference.junit-platform-launcher.jar=lib/support/junit-platform-launcher-1.5.0.jar <br>
>><br>
>>  file.reference.jaxb-api.jar=lib/support/jaxb/jaxb-api.jar<br>
>>  file.reference.nagasena-rta.jar=lib/nagasena-rta.jar<br>
>>  file.reference.nagasena.jar=lib/nagasena.jar<br>
>> -file.reference.opentest4j-1.1.0.jar=C:\\apache-ant-1.10.5\\lib\\opentest4j-1.1.0.jar <br>
>><br>
>> +file.reference.opentest4j-1.1.0.jar=lib/support/opentest4j-1.1.0.jar<br>
>>  file.reference.exificient-gui-jar-with-dependencies.jar=lib/exificient-gui-jar-with-dependencies.jar <br>
>><br>
>>  file.reference.javax.json-api-1.0.jar=lib/javax.json-api-1.0.jar<br>
>>  file.reference.saxon9he.jar=lib/saxon9he.jar<br>
>><br>
>> There are scads more things to deal with JavaLoaderTest.java, as have <br>
>> been previously reported, but from my diffs, and all the errors <br>
>> thrown, it kind of appears that the X3DLoaderDOM is causing the <br>
>> problem.   But I agree it could be indenting/parent-child issues with <br>
>> X3DJSONLD.  I just haven't got any smoking gun which points to <br>
>> X3DJSONLD in my diffs. Someone more experienced with diffing XML (and <br>
>> has diffing tools like XMLSpy should take over debugging).<br>
>><br>
>> So we can load JSON, roughly, but there are problems writing out <br>
>> JSON.  I haven't figured out if there's an issue with loading the <br>
>> JSON yet, as the XML printed in the middle, <br>
>> "examples/LoadedJsonConversion.xml", has different indenting and <br>
>> quoting.  What I used to verify the JSON was the output JSON, which <br>
>> is currently unavailable due to X3DJSAIL jar not being in the CLASSPATH.<br>
>><br>
>> We have a good test case and code, it's just that my XML diffing <br>
>> tools are crap.<br>
>><br>
>> I will pursue running under debug next.<br>
>><br>
>> John<br>
>><br>
><br>
<br>
</div></div>