[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [x3d-public] NullPointerException when loading scene with script node



George Anastassakis wrote:
Thanx to all for so many replies in such little time. Indeed, after correcting eventIn and ecmascript I was able to load the x3d file (I guess I must read the x3d spec a bit more thoroughly).

Still, I can't load the vrml version of the file using the code I posted in my previous message, which is not a big deal but it would be good to know why. The file would, in that case, be:

#VRML V2.0 utf8
DEF s Shape {
appearance Appearance { }
geometry Box { }
}
DEF sc Script {
eventIn SFTime test
url "javascript: function test(value) { }"
}

A NullPointerException is generated by line 299 of ScriptContentLoader.java:

ScriptEngine engine = (ScriptEngine)engineMap.get(mime_type);

Any ideas? Just a reminder that Xj3D Browser can indeed load the above file without any errors.

Your using SAI code which is scripting code for X3D. We do not support loading VRML files with SAI. They have somewhat different event models. We shouldn't be crashing on it, but we won't load the file either. Basically it should return a failure to you. An X3D browser is allowed to do this, but we have not implemented it.

You can use the EAI if you want to load VRML files with Xj3D.
--
Alan Hudson

President Yumetech, Inc.                               www.yumetech.com
President Web3D Consortium                             www.web3d.org
206 340 8900
-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html