[x3d-public] ClassCastException in X3DJSAIL. Probably okay, since it's a test program.

Don Brutzman brutzman at nps.edu
Wed Feb 15 17:31:50 PST 2017


please send .java program, TIA

am guessing that maybe you didn't use setMetadata method on Appearance? two forms are available:

	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Shape/AppearanceObject.html#setMetadata-org.web3d.x3d.sai.Core.X3DMetadataObject-

	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Shape/AppearanceObject.html#setMetadata-org.web3d.x3d.jsail.Core.ProtoInstanceObject-

On 2/15/2017 4:41 PM, yottzumm at gmail.com wrote:
> www.web3d.org/x3d/content/examples/Basic/development/SchemaTest.json

or, more likely from scene head/meta information:

{

     "@name": "description",
     "@content": "Test scene for obscure schema validation cases."

},
{

     "@name": "error",
     "@content": "Test scene that does not render or validate."

},

	http://www.web3d.org/x3d/content/examples/Basic/development/SchemaTestIndex.html

X3D validator finds many things wrong:
	
	https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/x3d/content/examples/Basic/development/SchemaTest.x3d

hmm, can you figure out a way to link a scene url into a json validator url?  for example, something that combines

	http://jsonlint.com/
with
	http://www.web3d.org/x3d/content/examples/Basic/development/SchemaTest.json

if so, i can add such validation-convenience links to each index page in the archives...


> java.lang.ClassCastException: org.web3d.x3d.jsail.Core.MetadataIntegerObject cannot be cast to org.web3d.x3d.sai.Core.X3DNode^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.getValue(MetadataSetObject.java:427)^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.validate(MetadataSetObject.java:1102)^M
>
>         at org.web3d.x3d.jsail.Shape.AppearanceObject.validate(AppearanceObject.java:1630)^M
>
>         at org.web3d.x3d.jsail.Shape.ShapeObject.validate(ShapeObject.java:1153)^M
>
>         at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:522)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:1603)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:725)^M
>
>         at www_web3d_org.x3d.content.examples.Basic.development.SchemaTest.main(SchemaTest.java:262)^M
>
> Exception in thread "main" java.lang.ClassCastException: org.web3d.x3d.jsail.Core.MetadataIntegerObject cannot be cast to org.web3d.x3d.sai.Core.X3DNode^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.getValue(MetadataSetObject.java:427)^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.validate(MetadataSetObject.java:1102)^M
>
>         at org.web3d.x3d.jsail.Shape.AppearanceObject.validate(AppearanceObject.java:1630)^M
>
>         at org.web3d.x3d.jsail.Shape.ShapeObject.validate(ShapeObject.java:1153)^M
>
>         at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:522)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:1603)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:725)^M
>
>         at www_web3d_org.x3d.content.examples.Basic.development.SchemaTest.main(SchemaTest.java:262)^M

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman



More information about the x3d-public mailing list