[x3d-public] Fatal X3DJSAIL error using JDK 8u202. Will try todownload latestJava binary version.

Joseph D Williams joedwil at earthlink.net
Tue Jul 2 18:10:41 PDT 2019


➢ is provide an understandable use of containerField to X3D programmers

I think the most simple description of the container field lies in the study of the VRML encoding, along with the x3d vrml classic encoding. 
Please notice the style of vrml using curley brackets. 
These {…} are  the container fields. 
A quick look at x3dv classic and x3d xml will quickly show, 
transcoding of vrml appearance Appearance into xml, and, 
xml _not_ using <children> … </children>.

In order to maximize speed of parsing and scene building, a field preannounces its acceptable location in the scenegraph. Looking at the classic syntax and xml syntax, the immediate idea might have been to directly follow the vrml style by directly reencoding the container markup. For the current x3d xml syntax, there is the idea that using all xml tools, like the a complete and sufficiently detailed schema, that there really was never a need for the container field since at any time, the input processor could just look it up if it wanted to check, and really, that is an authortime detail, where nodes can go, so just get it correct in the user code, then trust it. 
Well, there are some special cases in dynamic systems where an important aspects of interactive user programming and scene automation can happen where the tool that produces input to the scene needs to identify the input in realtime explicitly. Some of these examples have been discussed here. 

In order to preserve economy of user coding, the vrml required container brackets became the mostly optional xml containerField. 

No examples here unless you ask, but auspiciously the containerField, like so many other x3d fields has a well-known and usually very necessary default value. This is why, except for very special cases, there is no need for the self-documenting feature of including a value for containterField, except for the very few discussed in this list, and always since the x3d xml encoding was proposed. 
For that reason, it always seems like extra text to actually include the containerField in any listing, except for a couple of special cases, like proxy and collision? There is a good list somewhere. 

So, now do we see at least two ways to document in the markup where in the scenegraph a node of interest is allowed to be added?

I think, in general, you can ignore the question of: 
when do I need to include the concept of actual user code syntax that tells the user code processor whether the current node it is processing is legal for the area of the scenegraph that is a parent structure in the scenegraph it is building? 
It is an important aspect of the self-documenting features of x3d that you don’t have to worry about because the default is usually correct except for special scenegraph configurations which also usually work out ok if you basically understand what you are doing. 

All Best Regards,
Joe



From: John Carlson
Sent: Monday, July 1, 2019 8:26 PM
To: Brutzman, Donald (Don) (CIV)
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] Fatal X3DJSAIL error using JDK 8u202. Will try todownload latestJava binary version.

I’m hoping you can evaluate usage of shaders, programs and children containerFields in java/examples?

I am still having problems analyzing this adequately


John$ grep programs *x3d
HelloWorldProgramOutputTidy.x3d:<ShaderProgram DEF='TestShader2' containerField='programs'/>
HelloWorldProgramOutputTidy_CommandLine.x3d:<ShaderProgram DEF='TestShader2' containerField='programs'/>

There is no use of containerField shaders or containerField programs with ShaderProgram in other files.  Hmmm


Maybe there’s an issue with X3dTidy?

I think I’m confused between ProgramShader and ShaderProgram.

I’m now getting:

$ grep Appearance errs.txt
    Appearance168.addChild(ProtoInstance171)
AttributeError: 'org.web3d.x3d.jsail.Shape.AppearanceObject' object has no attribute 'addChild'
    Appearance168.addChild(ProtoInstance171)
AttributeError: 'org.web3d.x3d.jsail.Shape.AppearanceObject' object has no attribute 'addChild'
    Appearance168.addChild(ProtoInstance171)
AttributeError: 'org.web3d.x3d.jsail.Shape.AppearanceObject' object has no attribute 'addChild'
    Appearance168.addChild(ProtoInstance171)
AttributeError: 'org.web3d.x3d.jsail.Shape.AppearanceObject' object has no attribute 'addChild'
    Appearance163.addChild(ProtoInstance166)
AttributeError: 'org.web3d.x3d.jsail.Shape.AppearanceObject' object has no attribute 'addChild'
    Appearance168.addChild(ProgramShader169)
AttributeError: 'org.web3d.x3d.jsail.Shape.AppearanceObject' object has no attribute 'addChild'
    Appearance168.addChild(ProgramShader169)
AttributeError: 'org.web3d.x3d.jsail.Shape.AppearanceObject' object has no attribute 'addChild'

$ grep '<'ProtoInstance *.x3d|grep shaders
HelloWorldProgramOutput.x3d:        <ProtoInstance DEF='TestShader3' name='ShaderProto' containerField='shaders'/>
HelloWorldProgramOutput_CommandLine.x3d:        <ProtoInstance DEF='TestShader3' name='ShaderProto' containerField='shaders'/>
HelloWorldProgramOutput_CommandLineUnzipped.x3d:        <ProtoInstance DEF='TestShader3' name='ShaderProto' containerField='shaders'/>
HelloWorldProgramOutput_ReloadedDOM.x3d:        <ProtoInstance DEF='TestShader3' name='ShaderProto' containerField='shaders'/>
HelloWorldProgramOutputCanonical.x3d:        <ProtoInstance DEF='TestShader3' containerField='shaders' name='ShaderProto'/>
HelloWorldProgramOutputTidy.x3d:<ProtoInstance DEF='TestShader3' name='ShaderProto' containerField='shaders'/>
HelloWorldProgramOutputTidy_CommandLine.x3d:<ProtoInstance DEF='TestShader3' name='ShaderProto' containerField='shaders'/>

$ grep '<'ProgramShader *.x3d|grep container
HelloWorldProgramOutputTidy.x3d:<ProgramShader containerField='shaders'/>
HelloWorldProgramOutputTidy.x3d:<ProgramShader DEF='TestShader1' containerField='shaders'>
HelloWorldProgramOutputTidy_CommandLine.x3d:<ProgramShader containerField='shaders'/>
HelloWorldProgramOutputTidy_CommandLine.x3d:<ProgramShader DEF='TestShader1' containerField='shaders'>

In these case, my code uses the containerField to choose an appropriate add method, currently addChild overrides addShaders.

                                       if (attr === "containerField") {
                                                method = attrsa.nodeValue.charAt(0).toUpperCase() + attrsa.nodeValue.slice(1);
                                                if (method === "Shaders") {
                                                        addpre = "add";
                                                        method = "Child";
                                                } else {
                                                        addpre = "set";
                                                }
                                        }

My recommendation would be to implement the addShaders method, or stop using containerField? Or provide additional testing in serializers. What I would like most of all, is provide an understandable use of containerField to X3D programmers.

John
Sent from Mail for Windows 10

From: Brutzman, Donald (Don) (CIV)
Sent: Saturday, June 29, 2019 8:05 PM
To: John Carlson
Cc: X3D Graphics public mailing list
Subject: Re: Fatal X3DJSAIL error using JDK 8u202. Will try to download latestJava binary version.

1. I have rebuilt and redeployed X3DJSAIL using JDK 8u212.  No changes in code, all smoke tests pass.  Should be the same as 202 version.  You do not need JDK 8u212 to run the X3DJSAIL .jar since we should remain compatible with any JDK 1.8 version.  Can you please test that the binary .jar works with 202.

Not yet ready to add OpenJDK or Java 12 testing to the build process.  At some point later this year it will likely happen.

2. Next, to your problem.  Inspection reveals that X3DJSAIL has multiple methods for ProtoBody to addChild or addChildren.

[First entry shows return type; when type is void then it is likely a requirement of underlying SAI which cannot be overridden.]

X3DJSAIL Javadoc: ProtoBody
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/ProtoBodyObject.html#method.summary

------
ProtoBodyObject             addChild(X3DNode newValue)
                Utility method to add single child element to contained list of existing children nodes (if any).
ProtoBodyObject             addChildren(ProtoInstanceObject newValue)
                Add single ProtoInstanceObject (with appropriate node type and containerField value) to MFNode array for children field.
void       addChildren(X3DNode newValue)
                Add single node to existing array of children nodes (if any).
void       addChildren(X3DNode[] newValue)
                Add array of children nodes to array of existing nodes (if any).
------

John we can sometimes add a utility method if there is a hole or something missing, but we can't add them for every node in X3D.  Can't overload methods/interfaces with overlapping types in Java.

As before I recommend we get HelloWorld.py working first, since HelloWorld.x3d and HelloWorld.java and HelloWorld.json all work just fine.  There are several "abox" models scattered around so it is not possible for me to replicate your results with confidence.



On 6/28/2019 12:17 AM, John Carlson wrote:
> ===========================================================================================================
> 
> But work on my abox.future.py bug below, pretty please?  With or without wrappers, it doesn’t matter which to me.
> 
> Here is the minimal code which fails.
> 
> import x3dpsail
> 
> (x3dpsail.ProtoBody()
> 
>      .addChild(x3dpsail.Transform()
> 
>          .setIS(x3dpsail.ISObject())
> 
>      )
> 
> )
> 
> addChild takes an X3DNode.
> 
> setIS returns a  TransformObject—an X3DConcreteNode
> 
> Please add to ProtoBodyObject.java an
> 
> addChild(TransformObject)
> 
> and/or
> 
> addChild(X3DConcreteNode)
> 
> You can do it at the same time you are adding addShaders() – see below.
> 
> Alternatively, you can make X3DConcreteNode inherit from X3DNode, I guess.   This seems best.  I’m not sure why it doesn’t already? How about TransformObject extend from X3DNode in the short term?   That’s not in the standard, right?  It looks like it already does.
> 
> This appears to be a Java issue.  What does the same Java do? AHA!
> 
> $ java -cp /c/x3d-code/www.web3d.org/x3d/stylesheets/java/jars/X3DJSAIL.3.3.full.jar";". net/coderextreme/data/abox
> 
> java.lang.NoClassDefFoundError: org/web3d/x3d/sai/Rendering/X3DGeometryNode
> 
>          at java.lang.Class.getDeclaredMethods0(Native Method)
> 
>          at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> 
>          at java.lang.Class.privateGetMethodRecursive(Unknown Source)
> 
>          at java.lang.Class.getMethod0(Unknown Source)
> 
>          at java.lang.Class.getMethod(Unknown Source)
> 
>          at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
> 
>          at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
> 
> Caused by: java.lang.ClassNotFoundException: org.web3d.x3d.sai.Rendering.X3DGeometryNode
> 
>          at java.net.URLClassLoader.findClass(Unknown Source)
> 
>          at java.lang.ClassLoader.loadClass(Unknown Source)
> 
>          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> 
>          at java.lang.ClassLoader.loadClass(Unknown Source)
> 
>          ... 7 more
> 
> Error: A JNI error has occurred, please check your installation and try again
> 
> Exception in thread "main"
> 
> Previous versions of the jar work:
> 
> $ java -cp ../../../../pythonSAI/X3DJSAIL.3.3.full.jar";". net/coderextreme/data/abox
> 
> Warning: toFileStylesheetConversion(X3dToJson.xslt) is overwriting prior file ../data/abox.new.json
> 
> Time to back some changes out? Report bug to Oracle?
> 
> $ java -version
> 
> java version "1.8.0_202"
> 
> Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
> 
> Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
> 
> Thanks,
> 
> I don’t have the current version of Java on my system.  I don’t want to install the lastest JDK 8 under the new Oracle agreement.
> 
> HELP!
> 
> Please try on your own systems.
>

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190702/3b1a8f11/attachment-0001.html>


More information about the x3d-public mailing list