File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Error: uncaught exception: [Exception... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Error: uncaught exception: [Exception... "Access to restricted URI denied"  code: "1012" nsresult: "" Watch "Error: uncaught exception: [Exception... "Access to restricted URI denied"  code: "1012" nsresult: "" New topic
Author

Error: uncaught exception: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "

Sowjanya Venkiteela
Greenhorn

Joined: Nov 25, 2009
Posts: 17
We have created reports through Jasper Reports and created a file called x.html file.

In local sytem if I specify the file system path like D:\example\...

It is working fine.But,when it deploy it in server it is not taking the path of that file which is automatically created.

Giving some exception like
Error: uncaught exception: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"

Thanks in Advance,
Sowjanya.V.R

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

I don't know anything about Jasper Reports, but I do know that accessing files (via http) outside of the web app's directory is not allowed.

In local sytem if I specify the file system path like D:\example\...

It is working fine.But,when it deploy it in server it is not taking the path of that file which is automatically created.

Huh? I don't understand this at all. The text is too vague, please be more specific: exactly where is the file located, and exactly what path/URL was used to access it.


JBoss In Action
Sowjanya Venkiteela
Greenhorn

Joined: Nov 25, 2009
Posts: 17
In local sytem if I specify the file system path like D:\example\... -->in the system where I am working in eclipse it is fine

But when I place the file in server machine(remote machine) it is not taking that path.it is giving below exception.

Exception... "Access to restricted URI denied" code: "1012" nsresult:..
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Does drive D:\ exist on the server ??

Maybe there is a file security policy on the server ??

Why do you need to hard code the path ?? (it is not allowed to have hard coded file paths in a JavaEE Application - you need to refer to files relative to your Application)


Regards, Rene Larsen
Dropbox Invite
Sowjanya Venkiteela
Greenhorn

Joined: Nov 25, 2009
Posts: 17
Yes,we are trying to do the same.Referring to files relative to your Application.

For this,In servlets we can do this from servletContext.geResource()

But,it is failing in portlets(JSR 168)

our issue how to do this in portlets.

Thanks in Advance,
Sowjanya.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

Wonderful. I ask for "exactly where is the file located, and exactly what path/URL was used to access it." and you repeat that the file is in d:\example\...
A lot of good that does! Do you want help or not? Once you provide the information requested I will consider helping you. It is impossible for me to help someone when I do not have all of the facts. Until you supply the facts the most I can tell you is to fix your code and it will work.

TellTheDetails
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error: uncaught exception: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "