How to resolve problems in policy file of signed Applet

Hi to All,
I want to connect the web site through my Signed Applet which is working as a Proxy server. but i m facing certain problems in my policy file:
this is my policy file :-
grant {
permission java.security.AllPermission "", "";
permission java.net.SocketPermission "http://www.google.com:4321", "connect, accept,resolve";
permission java.security.UnresolvedPermission;
n i got such type of exceptions n my Applet prompt applet not initialized.
Got connection Socket[addr=/192.168.1.232,port=1200,localport=4321]
Reading request...
URI is: http://www.google.com/
Host to contact is: www.google.com at port 80
Got request...
java.security.AccessControlException: access denied (java.net.SocketPermission www.google.com resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
at java.net.InetAddress.getAllByName(InetAddress.java:1061)
at java.net.InetAddress.getByName(InetAddress.java:958)
at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
at java.net.Socket.<init>(Socket.java:179)
at ProxyApplet.handle(ProxyApplet.java:75)
at ProxyApplet.<init>(ProxyApplet.java:132)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:721)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:650)
at sun.applet.AppletPanel.run(AppletPanel.java:324)
at java.lang.Thread.run(Thread.java:595)
here 4321 is Port no. which i've as a random port no.
plz Help
thnx in advance
with regards
pank_naini

Please, if you can't help me, could you tell me who can I contact ?

Similar Messages

  • How can I attach a policy file to a applet in IE55?

    I want to use jdbc in applet, so I had to run IE55 with a policy file, how can I set it?
    thant u very much.

    Search the JDBC forum. It has been explained in there.

  • How to resolve Unexpected End of file error in Web Crawling

    how to resolve Unexpected End of file error in Web Crawling....
    I am getting java.net.SocketException :Unexpected End of file error in Web Crawling.
    How to get rid of this error.
    Please help anybody ASAP.

    1. Handle this exception - not recommended since you will be creating an exception handling overhead unnecessarily.
    2. Check for EOF using available() method in InputStream. It returns 0 if there are no bytes to read.

  • How to handle the java.policy file ?

    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 have to place it and do I have to call it in some way form my applet?
    Thanks in advance.
    don call

    The java.policy file goes in your jre installation directory in .../jre/lib/security (there should be one there already).
    I used it to allow otherwise restricted permissions for an applet using javax.comm. Add something like the following to the file:
    grant codeBase "URL:http://yourDomainName/rootDirectoryOfYourApp/*" {
         permission java.security.AllPermission;
    This will give the applet downloaded from your site all permissions. You might want to give only certain permissions, I don't know.
    Teri

  • How can I upload a (image) file through an applet ?

    How can I upload a (image) file through an applet ?

    have a look at http://www.haller-systemservice.net/jupload/
    i'm using Apache Jakarta HTTPClient to create a new HTTP connection to the webserver and sending a new POST request, which holds the image file. (So it's RFC1867 conform)
    there is also an open source implementation of such an applet on sourceforge. it's also called JUpload, but i think it's not maintained any more.

  • How to install unlimited strength policy files with 2003 windows server

    Hi all,
    I am working on encryption AES 256 bit key encryption.
    128 is default encryption key.But for use 256 bit encryption key need to add unlimited strength policy file with jdk.
    That is working fine on windows xp.
    Now problem
    But when i run on client machine with operating system windows 2003 server standard.
    I replaced all files under folder Java\jdk1.6.0_10\jre\lib\security with files which i am using on windows XP.
    Restarted the computer after update files but on windows server 2003 256 bit key encryption not working.
    Giving following exception
    java.security.InvalidKeyException: Illegal key size or default parameters
         javax.crypto.Cipher.a(DashoA13*..)
         javax.crypto.Cipher.a(DashoA13*..)
         javax.crypto.Cipher.a(DashoA13*..)
         javax.crypto.Cipher.init(DashoA13*..)
         javax.crypto.Cipher.init(DashoA13*..)
    Please suggest me how to run encryption on windows server 2003..
    Thanks
    Anu

    anu1106 wrote:
    I replaced all files under folder Java\jdk1.6.0_10\jre\lib\security with files which i am using on windows XP.Why? Why not just install the unlimited strength files in the normal way according to the installation instructions given in the distribution file?

  • HELP: How do i include a policy file when embedding a JApplet

    This is the problem i'm facing.I've been able to successfully grant my japplet permission to access resources on the c: drive. When i run it using appletviewer there's no problem, it's able to access the database on the c: drive but when i embedd it in my html page it fails to access the database (i.e it is unable to include the policy file). Does anyone know how to get around this problem?

    You can not directly include a policy within an applet. This would be a security risk.
    In general you have 2 choices if you wish to grant an applet more rights than it has per default:
    1. You can sign it.
    2. You change your local policy file.
    ad 1:
    You can generate a keypair using keytool and sign the applet with jarsigner. (you need to create a jar file first)
    when your applet is then loaded in the browser, a popup asks the user, if he wanna trust the signer. If the user clicks no, the applet is executed with standard applet rights. If the user clicks yes, the applet is executed with full permission (like an applet from file:/*)
    ad 2:
    use policytool to create/change a policy file in your home directory. You can describe the applet either with a path (=codebase) or with some meta-information like signer.
    create a policy that fits your need, and save the file.
    next time you execute your applet in the browser, the policy will grant the applet additional permissions.
    There is a third option. You can mix 1 and 2.
    You can sign your applet, and create a policy for all applets signed by you.
    Then there will be no popup, and the applet has automatically the rights you defined in the policy file.
    But I would suggest to consider the possibility to write a stand-alone application, instead of granting an applet access to the local hard disk.

  • RoboHelp 8 - how to resolve rhbuildtag.apj/.cpd file errors?

    Hi there,
    I’m using RoboHelp 8 (with service packs, version number is 8.0.2.208). There are two writers on our team (in separate offices) and we use SVN (via Tortoise SVN) to version all our source files. Our Online Help is comprised of about 30 individual help projects that we merge at build time. We work locally on our own machines and commit everything to SVN each evening.
    We (mainly me) have had ongoing problems with .cpd files getting corrupted (I’m in the company 5 months). I’ve followed all the good advice I’ve seen on forums about renaming/deleting them and letting the affected RoboHelp project re-create it when I start it up again. This has worked until now.
    Also note, that I got a new machine early this week and I brought all our source files down successfully from our SVN repository after we installed RoboHelp. Happy days.
    Yesterday in one Help project I received the following error messages and noticed that the Conditional Build Tags were not listed in the CBT Pod, despite being present in the topic themselves.
    An error occurred while trying to read data from <Project Path\Project Name\rhbuildtag.apj> <1>
    Your project file, C:<Project Path\Project Name\project.cpd, is corrupt and cannot be opened. Try deleting this file and reopening the project.
    I consulted with my colleague this morning and his local project is fine – all conditions present and correct and no CPD error message. He committed his project to SVN and I updated but still no luck.
    Despite having the latest versions from our repository anyway, I tried copying the contents of his rhbuildtag.apj file to mine but that made no difference at my side. I renamed/deleted CPD files several times over but project still won’t open. I deleted my local working versions of all our Help projects and brought them down from our SVN repository - twice. No luck.
    I’m flummoxed as how to fix this project/restore conditions to CBT Pod?
    Why would I have ongoing CPD issues and my colleague not?
    My colleague is offline until the morning (different time zones) so will catch up with him then again. It seems to be something very local to my setup.
    Many thanks in advance for any wise words offered.

    Hi folks,
    Just to let you know that we resolved our problems with our misbehaving rhbuildtag.apj and .cpd project files. 
    As I mentioned previously, my colleague's version had been working fine. This was the very puzzling bit as I was pulling the exact same set of project files from our SVN repository. 
    Since yesterday...
    From these forums, I discovered the 'Clear project cache(.cpd) before opening any project' check box in the Tools > Options dialog. That wasn't selected in my troubled project (was able to get into the project earlier in the day). It was selected in other projects so selected it but it made no difference.
    I then asked my colleague this morning to check if that check box was selected on his working copy of the project, reasoning that maybe if it was selected on mine and not his, it could cause some kind of disparity.
    Wrong move. Very wrong move. Clearing his cache file caused him to get the same errors as I had got. So while we had the exact same rhbuildtag.apj file, there must have been something in his old cache file, keeping this error at bay. We don't version the .cpd files so his file would have been particular to his local working version of the project.
    So another step back - now a corrupt project at both offices.
    I then took another look at the contents of the troublesome rhbuildtag.apj file. I had noticed yesterday that there was something funny about one condition that I added back in October - a condition based on a release number (6.3.12). There were two instances of it in the file - looked to be saved twice though the condition was only ever added once and displayed once in the project CBT pod. See the attached screenshot. Also There was some markup around it that didn't make sense, looked like the file had saved badly. I compared it to other working build tag files in other projects (and while the conditions would vary slightly across the projects, they should be very similiar. I saw nothing like it.
    I saved the contents of my file locally (though being versioned in SVN would have had a backup anyway).
    I deleted out one of the duplicate 6.3.12 conditions and removed the funny mark up.
    And lo and behold our project opened successfully.
    I commited my changes to the rhbuildtag.apj file back to SVN. My colleague updated his version and his problems too are resolved.
    Root cause:
    Looks like our woes were caused by a corrupt condition in the rhbuildtag.apj file, which then caused the .cpd file to crash.
    Resolution:
    Identified duplicate condition tags and superfluous markup in the rhbuildtag.apj file and remove them (after making a copy). My previous machine was terribly slow and RoboHelp oftened crashed due to the poor machine performance. This could be one plausible cause for the corrupt condition.
    Given we added this condition back in October, I'm not sure why the problem only cropped up now as we would have made changes to the project since then. But such is RoboHelp and our daily battles.
    Hope this info is of help to someone out there.
    Thanks for all the replies - much appreciated.

  • How do you use .wsse policy file from Java Client?

    I'd like to call a WSSE enabled web service from my Java client but setup my encryption/signing requirements with a .wsse policy file.
    I know how to call a web service by programmatically setting up the security headers as described in:
    http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html
    But how can I do the same thing by simply using a .wsse file?

    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    import java.net.*;
    public class links extends java.applet.Applet {
       Panel panel = new Panel();
       public links(){
          super();
          add(panel);
          Link link = new Link(this,"Answers for programmers;- ","http://forum.java.sun.com");
          panel.add(link);
       public void init(){
          setVisible(true);
       public class Link extends Label implements MouseListener {
          Applet applet;
          Color fcolor = Color.blue;
          Color lcolor = Color.pink;
          String text;
          String word;
       public Link(Applet ap, String s, String s1){
          super(s);
             this.applet = ap;
             this.text = s;
             this.word = s1;
             addMouseListener(this);
          setForeground(fcolor);
       public void paint(Graphics g){
       super.paint(g);
          if (getForeground() == lcolor){
             Dimension d = getSize();
             g.fillRect(1,d.height-5,d.width,1);
       public void update(Graphics g){paint(g);}
       public void mouseClicked(MouseEvent e){
          try{
             URL url = new URL(word);
             applet.getAppletContext().showDocument(url,"_self");
          catch(MalformedURLException er){ }
       public void mouseEntered(MouseEvent e){
          setForeground(lcolor);
          setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
          repaint();
       public void mouseExited(MouseEvent e){
          setForeground(fcolor);
          setCursor(Cursor.getDefaultCursor());
          repaint();
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
       public static void main (String[] args){
          new links(); 
    }

  • Problem fetching policy-file-request

    According to
    http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_print.html
    quote:
    * A SWF file may no longer make a socket connection to its
    own domain without a socket policy file. Prior to version
    9,0,115,0, a SWF file was permitted to make socket connections to
    ports 1024 or greater in its own domain without a policy file.
    * HTTP policy files may no longer be used to authorize
    socket connections. Prior to version 9,0,115,0, an HTTP policy
    file, served from the master location of /crossdomain.xml on port
    80, could be used to authorize a socket connection to any port 1024
    or greater on the same host.
    So with the tighter security measures, a policy file has to
    be fetched on port 843 or on the same port on which a connection is
    desired. That leads to another problem. The policy file request
    made by the player has a simple format: clear text
    <policy-file-request/> is sent as raw data bytes on
    the ports.
    As most firewalls block such raw data traffic (of unknown
    protocols) on all the ports, this means that the policy file fetch
    will fail almost always if the user is behind any firewall.
    This will render all SWFs, that do not use well known ports,
    unusable. Does anyone know what is the solution to this
    problem? Or am I missing something here?

    Common guys, someone has to know what to do here.
    I have read all that I can read and tried all that I could
    and the flash app is not accepting my policy file.

  • How to resolve problem in battery in my iphone 4

    hi guys , i am using iphone 4. for nearly 25 days i am facing problem in charging & my battery is also discharging quickly, please help, if some body knows or faced same problem & how to resolve that, please advice

    Download iTunes 11.1.1 directly from Apple.
    http://www.apple.com/itunes/download/
    For the recovery, you may find them in your iTunes backup. If you have not a backup, a third easy iPhone recovery utility is necessary. Please follow the blog to get your notes back.
    http://easy-iphone-recovery.blogspot.com/2013/09/iphone-recovery-resource.html

  • Problem with policy file in Activatable tutorial

    hi all,
    i am just playing with the classes that comes with the RMITutorial.
    i am actually trying to execute the code that comes with the 'Creating an Activatable Object' tutorial, but i am having a lot of problems due to the policy file.
    First of all, i must say that i extracted all the classes in the directory d:\FalcoDevelopment;
    all the files has been put in the following directory:
    d:\FalcoDevelopment\examples\activation
    In hte Setup.java class there is the following line of code:
    props.put("java.security.policy", "examples/activation/policy");
    when i have to run the Setup.class, i have to enter the following command
    java -Djava.security.policy=/home/rmi_tutorial/activation/policy
    -Djava.rmi.server.codebase=file:/home/rmi_tutorial/activation/ examples.activation.Setup
    so, since i have to change to my own path,and since i am in the d:\FalcoDevelopment directory, i entered
    java -Djava.security.policy=/examples/activation/policy -Djava.rmi.server.codebase=file:/d:/FalcoDevelopment/examples/activation/ examples.activation.Setup
    when i then run the Client with the following command
    java -Djava.security.policy=/examples/activation/policy
    examples.activation.Client myhostname
    it always return me a Security exception..
    can anyone tell me what is the CORRECT path that i have to put for the above -D properties??
    thanx in advance and regards
    marco

    Hello,
    I am having the same problem but to start with you are mixing up NT and UNIX things, like file paths
    Other thing is you are using the tutorial given file paths. You must use your own file paths, as you have installed the classes.
    I know its not much help, but still :0)
    Kudos
    ravi

  • How can I change the policy file?

    I have designed an applet to read a file from the local Machine.
    This applet thro a servlet reads the contents of the file specified.
    I use Tomcat 4.1.12 server and this is an client-server application.
    To read the file in the local machine, I set the permission as follows in the .java.policy file in the Local Machine.
    grant codeBase "http://MyMachine:8080/Example" {
    permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete, execute";
    as the applet file is in the Example of the server "MyMachine".
    Its working and my applet is able to read the file from the local machine it runs.
    Now my problem is I cannot set/change the policy file in every machine where my applet runs.
    Instead if there is a way to change the policy when the applet downloads,that'll be effective.
    That is I donot want to go and change the policy file manually in each and every machine where my applet runs(I donot even know which are the machines going to run the applet).
    Is there any means to acheieve my need?
    Please explain me in detail or direct me to the relevent web sites or links.
    Thank you

    Hi Hosuke,
    I had the same problem, thanks for the advise.
    Still I have a remark to make.
    The thing is that, in order for the applet to have the permission granted (for whatever), you need to have a policy file which you can include in the JAR file (like you explained before) AND also you need to add an entry in the java.security file (located for me: "C:\Program Files\Java\j2re1.4.1_01\lib\security\java.security") that tells the applet where to find all the .policy files.
    Something like: policy.url.4=file:/c:/java.policy
    But since we are talking about an applet we are not able to make changes to this file.
    Maybe you or anyone else knows a workaround for this problem.
    Thanks in advance,
    Ronald Vromans.

  • Sorry last question got knocked back my ipad and iPhone on two different levels and I am not able to play through Facebook so not able to progress or unlock next level through Apple store. Don't know how to resolve problem

    Sorry last question got knocked back my ipad and iPhone on two different levels and I am not able to play through Facebook so not able to progress or unlock next level through Apple store. Don't know how to resolve problem

    Thank you again for all of your help!! I really appreciate it!
    I think I am following -- I was able to upload to my iPhoto and all photos and videos are there that is a plus! I tried to create an Event in my iPhoto and put all of my photos in that event but for some reason, now my iTunes it not recognizing that Event in my iPhoto. It is not allowing me to import just that event at the moment but I may be doing something wrong. At least all of my pics and vids are in iPhoto so that is a plus and I know they are at least saved somewhere. Just for some reason, my iTunes it not locating the event that I created with only those photos.
    Thank you for letting me know about my contacts! How do I know if I have the contacts app?
    Also, I had no clue that my iCloud could be backed up via cellular data! However, is this a new feature with the most updated iOS?? Unforutnatly I am like 2 iOS updates behind because I don't have enough storage on my phone. I still get the notification that my phone needs to be plugged in and connected to wifi in order to back up to the cloud :-(
    How can I sync using USB? Right now when i click on the info tab for my iPhone in my iTunes this is the answer that I get -- I am a little unclear as to what it means.
    Sync Contacts:
    Your contacts are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone
    Sync Calendars:
    Your calendars are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone

  • Applets, Policy Files, jar signing, JNI, etc

    Hi,
    I need an Applet to be able to connect to sockets and use some JNI. Hence, as far as I can tell, I need to use a Policy File. In a standalone application, I have written my policy file tried it out by switching on the security manager. However I am not sure how I do this with an applet.
    I have read many examples of Jar signing, yet every example uses appletviewer and the -J-Djava.security.policy to show the security policy in action.
    However I want this to work through a normal browser, so how do I achieve this?
    Do I specify a URL to the java.security.file in the embed/object/applet tags in the HTML?
    Do I put the policy file in the jar and reference it via the Manifest?
    Any ideas much appreciated,
    John B

    The standard AccessControlException:
    java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at java.lang.ClassLoader.getParent(ClassLoader.java:701)
    Or something like that.
    That's what I'm trying to solve, I wish to use the Java Security Policy system to allow my applet access to various resources, such as writing files. Now I've seen that signing an applet will give it full access (in my view, this is rather insecure, but anyway), however following the steps to sign an applet two or three times has still presented me with the same problem. The signing is ignored, and the exception is thrown.
    Applet signing aside, I fail to see any documentation stating how the policy file is used by the VM when running on a browser. I assumed it might be an entry in the Jar's manifest file, but again, I can find no documentation.
    It's all very annoying, and Sun have done quite a bad job at documenting this. For example, their example talkes about -D-Jjava.security.policy=.... being passed to appletviewer. Who on earth uses appletviewer! If policies only work with that, then they are useless. I want them to work with whatever browser the applet is being run within.
    Surely this isn't too much to ask? :)

Maybe you are looking for