Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Java Java.security.accesscontrolexception
sparkx
post Apr 21 2008, 11:21 PM
Post #1


Sparkx
Group Icon

Group: [HOSTED]
Posts: 340
Joined: 11-October 06
From: Dana Point, CA, USA
Member No.: 16,496



 I have looked all over the web for a solution and none of them seem to work. Anyway, I am trying to load a 3d object onto a scene with a java applet and I get the following error.
CODE
java.security.AccessControlException: access denied (java.io.FilePermission object.obj read)

I think that it has to do with my java.policy permissions, but I cant find anything that will fix it. Has anyone ever seen this error and/or know a solution to it? I am looking for a solution that will work on other people's computers without them downloading anything extra (other then the basic java) and hopefully the solution will be compatible with Astahost Webhosting.

Thanks in advanced,
Sparkx
Go to the top of the page
 
+Quote Post
java-area
post Apr 25 2008, 05:20 PM
Post #2


Member [ Level 1 ]
Group Icon

Group: [HOSTED]
Posts: 47
Joined: 4-February 08
Member No.: 28,119



QUOTE(sparkx @ Apr 21 2008, 07:21 PM) *
I am trying to load a 3d object onto a scene with a java applet and I get the following error.
CODE
java.security.AccessControlException: access denied (java.io.FilePermission object.obj read)
...


Are you trying to load the image with an applet from the host using a socket connection or to load the image from client's local machine?
In both situations the applet must be granted to get an access to this resource!

Here is a good example how to grand an access from the applet to the local system file:
http://www.captain.at/programming/java/
As you can see, keytool (which is included in Sun Development Kit) is used for this.
Go to the top of the page
 
+Quote Post
sparkx
post Apr 28 2008, 04:10 PM
Post #3


Sparkx
Group Icon

Group: [HOSTED]
Posts: 340
Joined: 11-October 06
From: Dana Point, CA, USA
Member No.: 16,496



Thank you very much for replying. My problem did have to do with permissions for local files. I finally got it to work by signing my applet and using the keytool. Now I can access local files and it works on astahost and the object loads just fine (without color but that is probably because I messed up when I exported my .obj file). It seems like you know lots about java maby you could help me out in the future if I get some more errors.

Thanks again,
Sparkx
Go to the top of the page
 
+Quote Post
xboxrulz
post May 1 2008, 02:15 AM
Post #4


Colonel Panic
Group Icon

Group: [MODERATOR]
Posts: 2,724
Joined: 25-March 05
From: Toronto, Ontario, Canada
Member No.: 3,233



Next time, you should also use try/catch to print your errors.

CODE
try{
//code logic here
}catch(AccessControlException err){
System.out.println("I can't access a file here! Access Denied!");
}


xboxrulz
Go to the top of the page
 
+Quote Post
iGuest
post May 10 2008, 03:37 PM
Post #5


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



exception in thread \\\"main\\\" java.lang.noclassdeffounderror: Gui press any key to continue..
Java Java.security.accesscontrolexception

Hey I get this error when I try to run this program
The error is "exception in thread "main" java.Lang.Noclassdeffounderror: Gui press any key to continue.."

I have 3 javas downloaded:
Jre1.6.0_02
Jre6
Jre1.6.0_05

I'm not sure if its three javas, but is there a way to make this program run? I've been trying to fix it for days...

Please help me..
Kaleb

-reply by Kaleb
Go to the top of the page
 
+Quote Post
sparkx
post Jun 12 2008, 04:01 AM
Post #6


Sparkx
Group Icon

Group: [HOSTED]
Posts: 340
Joined: 11-October 06
From: Dana Point, CA, USA
Member No.: 16,496



I thought I had finally solved this problem but I keep getting errors. I go to put my program on the web and bam security errors again. Anyway I was a little confused about something. I read this and made the Write.jp but it won’t work correctly. I get a java.security.AccessControlException that has access denied for (java.lang.RuntimePermission createClassLoader). Is there any other tutorial that will show me how to sign my jar and attach the policy to it so that the class will be granted permission for all (java.security.AllPermission) and will work for HTML (without modifying my .java file).

Kaleb Noclassdeffounderror is caused by something different. I think it has to do with an invalid class or an incorrect class path. Also I think that error is cause by JDK (Java Development Kit) not JRE (Java Runtime Environment).

Thanks for the help,
Sparkx
Go to the top of the page
 
+Quote Post
yordan
post Jun 13 2008, 05:42 PM
Post #7


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 1,980
Joined: 16-August 05
Member No.: 7,896



Did you try a general chmod for testing purposes ? Just chmod -R 777 on the whole folder, so everybody and each program has permission on everything ? If this works, you could refine step by step.
I know this is a trapping situation, because the userid of the owner of the files is not the userid of the process executing java.
Besides that, sorry, I'm a system admin, and I know close to nothing about java and html.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. java.lang.NullPointException(4)
  2. Java Unlimited(14)
  3. Array Sorting(21)
  4. What Are The Advantages Of Java Vs C++?(15)
  5. Need Help: Find Lowest Character Using Java(7)
  6. Download Java Ebooks(13)
  7. Java By Example(8)
  8. Video Streaming In Web Browser Through Java Or Jsp(1)
  9. Looking For A Java IDE(25)
  10. Java App To Web App(12)
  11. On Why Java Is 'c'ooler!(10)
  12. How To Configure/intergrate Jboss 4 With Java?(1)
  13. Other Sound Format Support(3)
  14. Java Phone Book(2)
  15. How To Create Exe File In Java?(12)
  1. How Do I Test A Java Aplication(11)
  2. Mozilla And Java!(2)
  3. Need To Modify Xml Attribute Using Java(4)
  4. Bluetooth And Java(5)
  5. Java Sdk Vs. Java Jdk?(2)
  6. Graphcal User Interfaces In Java(4)
  7. Java Db Help Pls(2)
  8. Loading 3d Models In Java?(2)
  9. Java Applet Loading Error(5)
  10. Setting Up Java Correctly(8)
  11. Simple Java Question(3)
  12. Java And Sql: Data Mismatch(6)
  13. Java Memory Leak?(0)


 



- Lo-Fi Version Time is now: 29th August 2008 - 08:14 PM