I have the following problem:
- I have an applet that loads and shows (actually it used to show, back when it was written as an application, not an applet
) a VRML scene, using a XJ3D VRML Loader. - The VRML files are on the server, in a subdirectory of the directory where the applet is stored.
- I use the following code for obtaining the Scene from the VRML Loader:
VRML97Loader loader = new VRML97Loader(VRML97Loader.LOAD_LIGHT_NODES | VRML97Loader.LOAD_VIEW_GROUPS);
URL url = null;
Scene scene = null;
try { url = new URL("http://[ Tomcat ServerIP ]:8080/project/obj/something.wrl"); }
catch (MalformedURLException badUrl) { System.out.println("Malformed URL for object loading"); }
try {
if (url != null)
scene = loader.load(url);
} catch(Exception e) {
System.out.println(e);
e.printStackTrace();
}
- When I load the applet, I receive the following Exception:
org.ietf.uri.UnsupportedServiceException: http is not supported
org.ietf.uri.UnsupportedServiceException: http is not supported
at org.ietf.uri.URL.getResource(URL.java:475)
at org.web3d.vrml.sav.InputSource.getCharacterStream(InputSource.java:169)
at org.web3d.parser.GeneralisedReader.parse(GeneralisedReader.java:142)
at org.web3d.j3d.loaders.SequentialContentLoader.loadContent(SequentialContentLoader.java:128 )
at org.web3d.j3d.loaders.BaseLoader.load(BaseLoader.java:534)
at org.web3d.j3d.loaders.BaseLoader.load(BaseLoader.java:274)
at FileManager.LoadScene(Proiect_applet.java:312)
Does anybody know why this happens? Does the XJ3D VRML97Loader not support loading a file through Internet connection? Why does its constructor take a URL parameter then?
I took care of applet permissions on the Tomcat web server, it has AllPermission set, so this should not be a problem.
If anybody can help me solve this problem, or knows of an alternative method to achieve the same goal, I would greatly appreciate the help!
(the reason I turned my application into an applet is to “simplify” the way I get hold of my VRML files over Internet, as this is my first project involving network programming, and I am completely “unaware” of how to get the files from server to client computer)