[x3d-public] Problems generating files using build.xml target test.nashorn

John Carlson yottzumm at gmail.com
Mon Jan 29 14:25:51 PST 2018


Here’s a patch to the X3DJSAIL stylesheet and java/build.xml.   Attached.

John

Sent from Mail for Windows 10

From: Don Brutzman
Sent: Sunday, January 28, 2018 1:14 PM
To: John Carlson
Cc: x3d-public at web3d.org
Subject: Re: Problems generating files using build.xml target test.nashorn

On 1/26/2018 2:13 AM, John Carlson wrote:
> This works instead of a script in build.xml:
> 
>                  <exec executable="jjs">
> 
>                          <arg value="-J-Djava.class.path=jars/X3DJSAIL.3.3.full.jar"/>
> 
>                          <arg value="nashorn/examples/HelloWorldProgramOutput.Nashorn.js"/>
> 
>                  </exec>
> 
> Everything is checked in.

Confirming yes, it is there and apparently working OK.

Shall I add test.nashorn to the smoke tests?

Here is output that I am currently seeing.  Still getting errors regarding nashorn/jvm-npm.js input.readAllBytes and package.json:

========================================================================
ant -f C:\\x3d-code\\www.web3d.org\\x3d\\stylesheets\\java test.nashorn
test.nashorn:
Compile:
Compiling 2 source files to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\classes
Copy:
Copying 1 file to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\nashorn\examples
Copying C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.x3d to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\nashorn\examples\HelloWorldProgramOutput.x3d
Copying 1 file to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\nashorn\examples
Copying C:\x3d-code\www.web3d.org\x3d\stylesheets\java\examples\HelloWorldProgramOutput.json to C:\x3d-code\www.web3d.org\x3d\stylesheets\java\nashorn\examples\HelloWorldProgramOutput.json
Run:
parameter: source file HelloWorldProgramOutput.x3d filesize 20771 bytes
parameter: "-toJS" for conversion to X3DJSONLD JavaScript source
parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutput.Nashorn.js" for result file name root nashorn/examples/HelloWorldProgramOutput.Nashorn
convert to JS JavaScript:
Warning: nashorn/examples/HelloWorldProgramOutput.Nashorn.js does not meet suggested X3D naming conventions. Output serialization allowed to continue, file may be editable...
Warning: toFileJavaScript() is overwriting prior file nashorn/examples/HelloWorldProgramOutput.Nashorn.js
Script DEF=colorTypeConversionScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
Script DEF=MaterialModulatorScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
TypeError: input.readAllBytes is not a function
Error: Cannot read file [C:\x3d-code\www.web3d.org\x3d\stylesheets\java\nashorn\node_modules\xmldom\package.json]:
[Error] TODO problem handling local exception within CommandLine, exiting
org.web3d.x3d.sai.X3DException: ScriptException when processing fileName nashorn\examples\HelloWorldProgramOutput.Nashorn.js.intermediate.js, unable to save result: javax.script.ScriptException: Error: Cannot load JSON file in nashorn/jvm-npm.js at line number 216 at column number 8
	at org.web3d.x3d.jsail.Core.X3DObject.toFileJavaScript(X3DObject.java:1602)
	at org.web3d.x3d.jsail.CommandLine.run(CommandLine.java:557)
	at org.web3d.x3d.jsail.Core.X3DObject.handleArguments(X3DObject.java:2572)
	at HelloWorldProgramOutput.main(HelloWorldProgramOutput.java:400)
parameter: source file HelloWorldProgramOutput.x3d filesize 20771 bytes
parameter: "-toJSON" for conversion to JSON encoding
parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutput.Nashorn.json" for result file name root nashorn/examples/HelloWorldProgramOutput.Nashorn
convert to JSON:
Warning: nashorn/examples/HelloWorldProgramOutput.Nashorn.json does not meet suggested X3D naming conventions. Output serialization allowed to continue, file may be editable...
Warning: toFileStylesheetConversion(X3dToJson.xslt) is overwriting prior file nashorn/examples/HelloWorldProgramOutput.Nashorn.json
Script DEF=colorTypeConversionScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
Script DEF=MaterialModulatorScript contains CDATA source-code text, copied as "#sourceText" using "strings" mode
file conversion successful: HelloWorldProgramOutput.Nashorn.json (39182 bytes)
parameter: source file HelloWorldProgramOutput.x3d filesize 20771 bytes
parameter: "-toX3D" for conversion to X3D encoding
parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutput.Nashorn.x3d" for result file name root nashorn/examples/HelloWorldProgramOutput.Nashorn
convert to X3D:
Warning: nashorn/examples/HelloWorldProgramOutput.Nashorn.x3d does not meet suggested X3D naming conventions. Output serialization allowed to continue, file may be editable...
Warning: toFileX3D() is overwriting prior file nashorn/examples/HelloWorldProgramOutput.Nashorn.x3d
file conversion successful: HelloWorldProgramOutput.Nashorn.x3d (20771 bytes)
===========================================
HelloWorldProgramOutput.Nashorn.x3d
1 file(s) have been successfully validated.
1 file(s) have been successfully validated.
matches HelloWorldProgramOutput.x3d: true
===========================================
script:
nashorn/examples/HelloWorldProgramOutput.Nashorn.js:1 TypeError: Cannot load script from node/X3Dautoclass.js
Result: 102
BUILD SUCCESSFUL (total time: 12 seconds)
========================================================================

p.s. this warning is overzealous, will try to tune that better:
"Warning: nashorn/examples/HelloWorldProgramOutput.Nashorn.js does not meet suggested X3D naming conventions."

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/20180129/c97e00a9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stylesheets.patch
Type: application/octet-stream
Size: 8276 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180129/c97e00a9/attachment-0001.obj>


More information about the x3d-public mailing list