Meaningless Drivel is fun!
The moose likes Servlets and the fly likes help with an error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "help with an error message" Watch "help with an error message" New topic

help with an error message

J Derzaph

Joined: May 29, 2008
Posts: 7
I'm not sure if this is the right catagory for this one or not but here goes:
I'm trying to call a servlet with some javascript using XMLHttpRequest. the servlet is in the same domain but I'm getting this error:

uncaught exception: Access to restricted URI denied (NS_ERROR_DOM_BAD_URI)
[Break on this error]"GET", url, true);

I understand this usually has to do with the same origin policy and accesssing other domains but the servlet is in the same domain here.

Here is the code:

The file structure looks like this:
/Scottys/scripts.js -where the javascript is
/Scottys/contract.html -where the script is called from
/Scottys/servlets/autoSearchServlet -the servlet its trying to call
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Your web app structure looks wonky to begin with. Servlets need to be compiled and located in the hierarchy at WEB-INF/classes or in a jar file in WEB-INF/lib.

Can you "hit" the servlet by typing its URL into the address bar?
[ September 17, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
J Derzaph

Joined: May 29, 2008
Posts: 7
Sorry, missed a couple of directories in there. The path for the servlet would be:
the other two files are

and i can hit it using the url

I think I may have found the problem though. I wasn't calling it from where I thought I was.
I agree. Here's the link:
subject: help with an error message
It's not a secret anymore!