Weird XJ3D exception on VRML file loaded by URL

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 :frowning: ) 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)

Where did you get the laoder from?

If there is any kind of support communtyi for it I would start there.

Oterhwise you may have to dig into the code (assumign you have source) and figure it otu yourself as the chances that someoen here has experience with the exact laoder you are using are slim…

Be aware that in genreal an unsigned applet may NOT conatct any server other then the server it was served from./

But since yo uarent showing a security exception, unelss the laoder code is hiding it (whioch woudl be possible but bad) I’d geuss thats not your aprticualr problem.

One more comment…

Yo M IGHT have more luck finding someone with experiecne with your particular loadaer over in the J3D desktop forums

No sane and rational person uses VRML for game content.

Google is your friend ;D

http://archives.java.sun.com/cgi-bin/wa?A2=ind0308&L=java3d-interest&D=0&P=18857

To Alan_W:

  • Thank you for your help. Unfortunately I found that link on Google too :-/ , before deciding to post this topic, and it didn’t help me at all - it’s a very bogus phrase, that doesn’t point to any solution in my case: I already have the XJ3D installed properly, in the /lib/ext directory. And also, this time around, Google is not a very good friend I’m afraid, as it finds only 2 similar posts on JavaInterest Archives. Thanx again, though, even just for the intention of helping me!

To Jeff:

  • Thanx at least for trying to point me in the right direction about the kind of forums I should be posting my message in.
    As I stated in my original message, the loader is the one supplied by XJ3D.org. I didn’t have any luck posting on a forum of theirs, as it seems to be kind of deserted ??? . That’s why I decided to post it on other forums as well, sorry if I have offended you in any way by doing that!
    I tried the Sun version of the loader tonight, but even though this one can connect to my Tomcat server, it has problems of compatibility with some nodes in my VRML files… I understand that Sun did not implement a full-spec VRML97 compatible loader… kind of unprofessional of them.
    By the way, I use a VRML loader only as a tool to to load my geometries (which I export in a VRML format from 3DMax)… why that would be insane and irrational I leave it to others to decide…
    Thank you anyway.

Its not insane, its just not necc optimal.

VRML is verbose, carries a lot of info game developers don’t need, and, unless its imrpoved a lot sicne last I saw it, is missing some thing ga,e developers might need.

The biggest issue IMO though is probably load time for any significantly complex scheme. You really don’t want the ascii-parsing time associated with any text model format adding to your level load.

And ofcouree if your data isnt local its only compounded by the time to transmit that bloated data from the server to the client.