UnsupportedNodeException: request for a node that is not part of the specified profile and components for this thread: viewpoint

I have been stuck in the same problem for some time, and I don’t know why I get the following runtime error when starting my project.

Exception in thread "main" org.web3d.vrml.lang.UnsupportedNodeException: Request for a node that is not part of the specified profile and components for this stream: viewpoint at org.web3d.vrml.renderer.DefaultNodeFactory.createVRMLNode(DefaultNodeFactory.java:730) at org.web3d.vrml.renderer.ogl.OGLMainSceneBuilder.startNode(OGLMainSceneBuilder.java:147) at org.web3d.vrml.renderer.ogl.OGLVRMLSceneBuilder.startNode(OGLVRMLSceneBuilder.java:514) at org.web3d.x3d.jaxp.X3DSAVAdapter.startElement(X3DSAVAdapter.java:830) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1364) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2787) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) at org.web3d.parser.GeneralisedReader.parse(GeneralisedReader.java:261) at org.xj3d.impl.core.loading.DefaultWorldLoader.loadNow(DefaultWorldLoader.java:156) at org.xj3d.impl.core.loading.DefaultWorldLoader.loadNow(DefaultWorldLoader.java:203) at org.web3d.vrml.scripting.browser.X3DCommonBrowser.createX3DFromURL(X3DCommonBrowser.java:264) at org.web3d.vrml.scripting.external.sai.SAIBrowser.createX3DFromURL(SAIBrowser.java:843) at xj3dtest.Xj3DTest.<init>(Xj3DTest.java:50) at xj3dtest.Xj3DTest.main(Xj3DTest.java:56) 

My Java code for this

 package xj3dtest; import java.awt.BorderLayout; import java.awt.Container; import static java.lang.Boolean.TRUE; import javax.swing.JFrame; import org.web3d.x3d.sai.Browser; import org.web3d.x3d.sai.BrowserFactory; import org.web3d.x3d.sai.X3DComponent; import org.web3d.x3d.sai.X3DScene; import java.util.HashMap; public class Xj3DTest extends JFrame { public Xj3DTest(String title) { super(title); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Setup browser parameters HashMap requestedParameters=new HashMap(); requestedParameters.put("Antialiased",TRUE); requestedParameters.put("TextureQuality","medium"); requestedParameters.put("PrimitiveQuality","medium"); requestedParameters.put("Xj3D_InterfaceType","SWING"); requestedParameters.put("Xj3D_NavbarShown",TRUE); requestedParameters.put("Xj3D_NavbarPosition","TOP"); requestedParameters.put("Xj3D_LocationShown",TRUE); requestedParameters.put("Xj3D_LocationPosition","TOP"); requestedParameters.put("Xj3D_LocationReadOnly",TRUE); requestedParameters.put("Xj3D_ShowConsole",TRUE); requestedParameters.put("Xj3D_OpenButtonShown",TRUE); requestedParameters.put("Xj3D_ReloadButtonShown",TRUE); requestedParameters.put("Xj3D_StatusBarShown",TRUE); requestedParameters.put("Xj3D_FPSShown",TRUE); requestedParameters.put("Xj3D_ContentDirectory","CurrentDirectory"); requestedParameters.put("Xj3D_AntialiasingQuality","low"); requestedParameters.put("Xj3D_Culling_Mode", "frustum"); System.setProperty("x3d.sai.factory.class", "org.xj3d.ui.awt.browser.ogl.X3DOGLBrowserFactoryImpl"); X3DComponent x3dComponent = BrowserFactory.createX3DComponent(requestedParameters); Browser browser = x3dComponent.getBrowser(); Container cp = getContentPane(); cp.setLayout(new BorderLayout()); cp.add((javax.swing.JPanel)x3dComponent, BorderLayout.CENTER); X3DScene scene = browser.createX3DFromURL(new String[] {"test.x3d"}); browser.replaceWorld(scene); } public static void main(String[] args) { Xj3DTest frame = new Xj3DTest("Xj3D test"); frame.setSize(640, 480); frame.setLocationRelativeTo(null); frame.setVisible(true); } } 

The X3D files I need to transfer in order for them to display contain the viewpoint and imageTexture url tags that have been tested to cause the problem. When I remove those tags from X3D files, it works, but does not have the desired result, as it seems to have been enlarged and has no texture in the X3D file.

Jars gluegen-rt, gluegen-rt-natives-linux-amd64, gluegen-rt-natives-windows-amd64, gluegen-rt-natives-linux-i586, j3d-core-1.3.1, jhall, joal, joal-natives-linux-amd64, joal-natives-windows-amd64, joal-natives-linux-i586, joal-all, joal-all-natives-linux-amd64, joal-all-natives-windows-amd64, joal-all-natives-linux-i586, xj3d.browser_2.1.0-nps, xj3d.cadfilter_2.1.0_nps, xj3d.2.1-3rdparty-nps, xj3d.2.1-nps, xj3d-core, xj3d-runtime, xj3d-script-base I use is gluegen-rt, gluegen-rt-natives-linux-amd64, gluegen-rt-natives-windows-amd64, gluegen-rt-natives-linux-i586, j3d-core-1.3.1, jhall, joal, joal-natives-linux-amd64, joal-natives-windows-amd64, joal-natives-linux-i586, joal-all, joal-all-natives-linux-amd64, joal-all-natives-windows-amd64, joal-all-natives-linux-i586, xj3d.browser_2.1.0-nps, xj3d.cadfilter_2.1.0_nps, xj3d.2.1-3rdparty-nps, xj3d.2.1-nps, xj3d-core, xj3d-runtime, xj3d-script-base . The way I set the parameters of the virtual machine is to use -Xmx450M -Djava.library.path="C:\Users\matt\Documents\NetBeansProjects\jar" , and I added a library containing all the Jars to the project.

EDIT It still doesn't work.

Edit # 2

The two tags that cause the problem are

<viewpoint centerOfRotation="7 1 0" position='10 0 40' orientation='0 0 0 1'></viewpoint>

<imageTexture url='"http://somewebsite.com/images/test.jpg"></imageTexture> Do not forget that the above website is not the website on which the image is stored, but it follows in the same format.

EDIT No. 3

The code in the X3D file is now <viewpoint centerOfRotation="7 1 0" position='10 0 40' orientation='0 0 0 1'></viewpoint>

<imageTexture url="http://somewebsite.com/images/test.jpg"></imageTexture>

And I still get the viewpoint error, and I don't know how to fix it.

+6
source share
1 answer

For the first tag, the error was clearly a fake single quote in the url attribute.

For the second, you can try to use consistent quotation marks for all your attributes, some parsers can not cope with this.

Globally, you can start there:

  • validate your XML with tools like this validator
  • verify that your X3D is valid for the xsd declared in your XML header. There are several links to validators on this page , but the most efficient way is still using the XML development tool of your choice.
0
source

All Articles