aspose file tools*
The moose likes Applets and the fly likes Can't set a codeBase in my .policy file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Can Watch "Can New topic
Author

Can't set a codeBase in my .policy file

Dupont Girard
Greenhorn

Joined: Mar 21, 2011
Posts: 24
Hello,
When i run the following java code:

I get this exception:

Here is my file .policy:

But it works fine if i remove the codeBase and set the full path as follow:

Is there something wrong with the codeBase ?
Please help me !
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

Dupont Girard wrote:
Is there something wrong with the codeBase ?

No. The way you are specifying it is wrong.
Note: a codeBase value is a URL and thus should always utilize slashes (never backslashes) as the directory separator, even when the code source is actually on a Win32 system. Thus, if the source location for code on a Win32 system is actually C:\somepath\api\, then the policy codeBase entry should look like:

Quoted from here (emphasis mine)


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Dupont Girard
Greenhorn

Joined: Mar 21, 2011
Posts: 24
Thank you for your quick response.
Still get the same error, here is my new code:



.policy file:
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

Did you visit the link?
Did you notice this?
Dupont Girard
Greenhorn

Joined: Mar 21, 2011
Posts: 24
i tried many things, but none of them works.

Here are my code as you you told me and as i read on the website:





it gives me the same exception

Many thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't set a codeBase in my .policy file
 
Similar Threads
Tomcat Java2 Security Issue: modifyThread and modifyThreadGroup
Java 2 Security Problems
Java2 Security Permissions
RAD - WAS6 Admin Console -Error page exception
struts file upload problem