Current Position:Home > ClassLoader & java.policy

ClassLoader & java.policy

Update:10-11Source: network consolidation
Advertisement
Hi ,
I am facing problem with the following code.
ClassLoader loaderPrev = Thread.currentThread().getContextClassLoader();
ClassLoader loader = URLClassLoader.newInstance(new URL[]{new URL(CodeBase)} , loaderPrev );
ClassLoader loader = new URLClassLoader(urlList);
Thread.currentThread().setContextClassLoader(loader) ;
result = Thread.currentThread().getContextClassLoader().loadClass(className);
This loads class successfully if I give "AllPermision" in my java.policy. But in real project I cann't do this. If I give only the http port in the java.policy file, it doesn't work . It gives socket permission denied exception.
I appreciate if somebody can give some input on this.
Thanks
Surendra

The Best Answer

Advertisement
try to sign applets
please check documents
or search in the forums
http://java.sun.com/security/signExample12/
http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/rsa_signing.html
renjith.
  • ClassLoader & java.policy Update:10-11

    Hi , I am facing problem with the following code. ClassLoader loaderPrev = Thread.currentThread().getContextClassLoader(); ClassLoader loader = URLClassLoader.newInstance(new URL[]{new URL(CodeBase)} , loaderPrev ); ClassLoader loader = new URLClassL

  • How can I change java.policy at runtim on client machines using java webst? Update:10-11

    Hi, I have to change java.policy to launch my application through webstart to provide one RuntimePermission "permission java.lang.RuntimePermission "getClassLoader";" Its because of a bug in java bug "_http://bugs.sun.com/bugdatab

  • How can I change java.policy at runtim? Update:11-30

    Hi, I have to change java.policy to launch my application through webstart to provide one RuntimePermission "permission java.lang.RuntimePermission "getClassLoader";" Its because of a bug in java bug "_http://bugs.sun.com/bugdatab

  • How to handle the java.policy file ? Update:10-11

    Can somebody tell me how to handle the java.policy file? I always get java.net.SocketExceptions and java.security.AccessControlExceptions while connecting to an appserver from an applet. What do I have to write in the java.policy file, where do I hav

  • File Access with unsigned Applet through editing the java.policy file Update:10-11

    I'am starting to lose my hair on this... I am trying to get an applet to run so that it can access the file system to move files on my local maschin. Because this applet is only running on my VM i can change the java.policy to avoid the signing of th

  • How add grant permission in java.policy Update:10-11

    hi master sir serch in my system C:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\lib\security C:\Program Files\j2sdk_nb\_jvm\lib\security C:\Program Files\Java\j2re1.4.1_03\lib\security C:\Program Files\Java\jre1.5.0_10\lib\security sir i have many java.pol

  • Java Applets and .java.policy Update:10-11

    Hi. We are developing an applet that need to access to the file systems and anothers properties, like user.home. To do this and don't modify the java.policy of the jre, we create a .java.policy file into user home. The content is: grant { permission

  • Explicitly installin java.policy problem Update:11-30

    is there any one who knows how to explicitly install the java.policy. What i have been doing is set the policy of the RMI server through a file like java.policy which contains this grant { permission java.security.AllPermission "*:1024-65535",&q

  • Can distribution of a .java.policy file be eliminated Update:11-30

    Sorry for the stupid question, but I'm fairly new to the realm of dealing with Java security... I have an applet that I want to deploy worldwide as part of an upgrade to an existing website, but I've run into the following error: "Error getting conne

  • Does Java Plug-in Ignore java.policy Permissions? Update:11-30

    I am running Firefox 3.6.12 on Ubuntu Karmic with Java plug-in 1.6.0_22. I'm trying to run an Aventail OnDemand applet, and I keep getting I/O file-reading permissions exceptions in the Java console. I tried granting the permission in /usr/lib/jvm/ja