Policy files syntax

The policy file syntax lets grant lists of permissions to identified code, for example giving its source.
To grant several permissions to several code sources, it is possible to repeat the required permissions blocks for each of the code source... But, what is the best way to write policy files to grant permissions to any code source, (including SDK's extensions), and deny specific accesses (as file access, for example) for a given code source.
Thanks for ideas...

You cannot do something like "negative permission". You give a permission or you don't give it.

Similar Messages

  • Unable to create access to file in .policy file

    I'm trying to grant permission to a specific file in the file system by granting permission in the .policy file.
    When I uncomment the line permission java.security.AllPermission; the code works fine and interacts with the file correctly. This is just to prove that the code works, I need to tighten this up to a single file.
    When I use the following, I get an exception, shown below. Nothing of consequence is being written to the logs
    grant {
      permission java.io.FilePermission "C:/test/essbase/CalcProfile.db", "write, read";
    java.security.AccessControlException: access denied (java.io.FilePermission C:\esstest\Server\PlugIns\Essbase read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
         at java.security.AccessController.checkPermission(AccessController.java:546)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
         at com.hyperion.essbase.calculator.ESecurityManager.checkRead(ESecurityManager.java:80)
         at java.io.File.exists(File.java:731)
         at org.sqlite.Conn.open(Conn.java:98)
         at org.sqlite.Conn.<init>(Conn.java:57)
         at org.sqlite.JDBC.createConnection(JDBC.java:77)
         at org.sqlite.JDBC.connect(JDBC.java:64)
         at java.sql.DriverManager.getConnection(DriverManager.java:582)
         at java.sql.DriverManager.getConnection(DriverManager.java:207)
         at com.accelatis.essbase.calcprofile.cdf.CalcComment.calcComment(CalcComment.java:16)I've tried creating the policy using PolicyTool, same result. However, I have no idea what or if I should put in the "CodeBase" field.
    Has anyone had success creating read & write permissions to a single file using .policy file? What is the magic syntax?
    Regards,
    Robb Salzmann
    Edited by: Robb Salzmann on Sep 22, 2011 11:38 AM

    >
    I have heard that there's a tendency for people to only read the first sentence of a post, so I will restrict this to just one sentence.
    >
    Wow, A little sharp doncha think?
    While I didn't write about it, I did check your link. Thank you, that got me over the hump.
    For anyone else who might stumble upon this thread, here's what I got to work:
    grant{
       permission java.security.AllPermission "C:\\test\\essbase\\CalcProfile.db", "read, write";
    };Regards,
    Robb Salzmann

  • Problems using codeBase in policy file

    Hi,
    I'm experiencing problems using the codeBase option with the grant option in my .policy file.
    I want to start a 'manager' which has limited access to files. This manager starts workers (threads) who need complete access to... everything. I know I need to use the codebase identifier to separate those two groups of rights, but I don't seem to get the codebase right. The worker threads don't get any rights at all. The manager works fine (without any codebase definition).
    I've used full and relative pathnames, with and without '/-' or '/*'
    The file I use currently is (slightly truncated :), pathnames are package names:
    grant codeBase "file:com/response/timber/broker/*" {
    permission java.security.AllPermission;
    grant {
    permission [..].FilePermission "manager.properties","read";
    permission [..].SocketPermission "localhost","connect,[..]";
    permission [..].FilePermission "com/[..]/jaxb.properties","read";
    According to the various examples on the Internet, it should work, but ofcourse it doesn't. Could the use of threat have any influence on the defined security?

    All I can say is I hope someone gives you
    (and indirectly me) the answer. I've got a
    serious problem granting special permissions
    in Sun ONE to a servlet and it's jars.
    One strange thing (to me), is that the format
    for the .policy file seems quite different between
    say Tomcat and Sun One. Things that work in Tomcat
    don't work for Sun ONE. But I thought the underlying
    vm et al was all the same! So did I... Why does
    this have to be so Opaque? Why different syntax
    platform to platform? Its all Java!

  • How to create an application-specific policy file?

    Hi Everybody:
    I'm a .NET developer with C #. I have a few applications currently running on my computer using the ODP 10.1
    Two weeks ago I installed on my computer the ODP 10.2 Release & now my previous applications have stopped working: when I try to make the connection to the database gives me this exception:
    OraOLEDB (0x80004005)
    ORA-12154: TNS: could not resolve the connect identifier specified
    In FAQ section for ODP.NET I found the next:
    Q: I have two .NET applications on the same machine running two different versions of ODP.NET. How do I ensure both these applications use the correct ODP.NET version?
    A: Beginning with ODP.NET 10.1.0.3, the Oracle installer will register the following publisher policy DLLs in the Global Assembly Cache (GAC) that redirect 9.2, 10.1 and 10.2 ODP.NET applications to use the last installed version of ODP.NET: Policy.9.2.Oracle.DataAccess.dll and Policy.10.1.Oracle.DataAccess.dll.
    ODP.NET 9.2 includes just the first policy DLL above. These policy files ensure that all your ODP.NET applications use the most recently installed version of ODP.NET.
    You may undo the redirection manually. Policy DLLs can be de-installed through gacutil.exe using the /u option. Another approach is to navigate to the GAC directory (i.e. C:\WINNT\assembly) through the Windows Explorer and delete the policy folders. That will eliminate any policy enforcement for all your ODP.NET applications.
    If you have applications on the same machine using different ODP.NET versions, you should create an application-specific policy file.
    I'm trying to do that, but I don't know what is an application-specific policy file. Someone can give me an example of How can I create and application-specific policy file???
    Regards

    Hi,
    Binding redirection is a ".net thing" as opposed to a "odp.net thing", see if this helps:
    http://msdn.microsoft.com/en-us/library/7wd6ex19(VS.71).aspx
    Hope it helps,
    Greg

  • 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(); 
    }

  • Server.policy file

    The ejb I am developing is trying to delete the following file from a local filesystem (Linux SuSE 9.3 Pro) : /path/to/file/delete.me I get the following exception:
    java.security.AccessControlException: access denied (java.io.FilePermission /path/to/file/delete.me delete)
    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.checkDelete(SecurityManager.java:990)
    at java.io.File.delete(File.java:869)
    I tried to modify the server.policy file adding the following line:
    permission java.io.FilePermission "/path/to/file/delete.me", "delete";
    but nothing changes, even when I restart the application server (don't know even if it is necessary to restart). I am using Sun Java System Application Server Enterprise Edition 8.1. Any help is welcome...
    Thanks in advance
    null

    I think I solved the problem. At least I managed to delete the file :-)
    First I had to add the following line to JRE's java.policy file:
    permission java.io.FilePermission "/path/to/file/delete.me", "delete";Then I added the following entry to the server's server.policy file:
    grant codeBase "file:${com.sun.aas.instanceRoot}/applications/j2ee-apps/MyApp-" {
      permission java.io.FilePermission "/path/to/file/delete.me", "delete";
    };like described here:
    http://docs.sun.com/app/docs/doc/819-3659/6n5s6m58n?a=view#beabz
    I hope this could help to someone with the same problem

  • 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 specify a policy file in a WS client (AXIS2)

    I am trying to access a dot net web service and i want to make use of the policy file they gave me. i read that AXIS2 supports WS-Policy in the client side but i still can not figure out how to tell the client to use the file. I searched thouroghly for examples and searched through diffirent forums with no success. I found only similar questions with no answer. if somebody could help it would be appreciated.
    Thank you

    We you codegen a Policy annotated WSDL, the policies are get included in the stub. Hence you don't have to specify a separate Policy file.
    But if you need to use a separate policy then you need to set them in the AxisDescription object that you use in the ServiceClient and OperationClient.
    e.g.
    ServiceClient serviceClient = new ServiceClient();
    OperationClient operationClient = serviceClient
    .createClient(ServiceClient.ANON_OUT_IN_OP);
    FileInputStream fis = new FileInputStream("path-to-policy.xml");
    Policy servicePolicy = PolicyEngine.getPolicy(fis);
    AxisService axisService = serviceClient.getAxisService();
    axisService.getPolicyInclude().setPolicy(servicePolicy);
    If you need more information please repost this to [email protected] with a [AXIS2] subject prefix.

  • How to use a custum permission in the .policy file

    Hi,
    I am stuck with the problem of having a custum permission that extands java.security.BasicPermission.
    I really want this permission to be checked from my .policy file, but when I try to include its location : c:\java_project\server\SpecialPolicy.class
    it pops a message that file is not found. I have tried dots, different slashes (back and forward) and still have no luck. I need this custum permission to be checked so that I can allow special access from a certain codebase so that say if I try a dangerous method I can just simply check in the code;
    this.getSecurityManager.checkPermission(new SpecialPermission("lol"));
    Also I need a paramater option, but I cant think of any since its not a FilePermission that takes a name and attributes (read, write..) what does BasicPermission take and if I extend it what attribute should I pass in. I dont really care about how this permission works, i just use it to restrict access to a certain functions in code that are ran from specific codeBAse.
    Please dont ask why I need this :)
    Thanks in advance, the documentation on how to add custum policies is simply NOT THERE. thus I have to bug people around.

    Hi
    If you just have to add another permission it is easy.
    Create a class extending the BasicPermission. Have an entry into
    the policy file like
    grant <Principal> {
    permission <CumstomPermission> "lol"
    }that should be all. If you do have a specific Principal, please
    do not forget to add the Principal to the relevant Subject after login.
    cheers
    Projyal

  • Error in manifest or policy file

    Can't run Dreamweaver CS6 or CC - checked my log files - I see:
    Activation context generation failed for "F:\AdobeCC\Adobe Dreamweaver CC\Dreamweaver.exe".Error in manifest or policy file "" on line . A component version required by the application conflicts with another component version already active. Conflicting components are:. Component 1: C:\windows\WinSxS\manifests\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0. 7601.17514_none_fa396087175ac9ac.manifest. Component 2: C:\windows\WinSxS\manifests\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.76 01.17514_none_41e6975e2bd6f2b2.manifest.
    Ran fine a few days ago, now won't run at all. Hangs on start.

    Have a look at this discussion Event ID 80 SideBySide

  • Java.lang.SecurityException: Jurisdiction policy files are not signed by t

    Hi
    *I am installing ECC6 onAIX 6.1 with oarcle 10g.*
    *I am getting error in create secure store*
    *Policy and security files are ok,*
    aused by: java.lang.ExceptionInInitializerError
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:218)
            at javax.crypto.Cipher.a(Unknown Source)
            at javax.crypto.Cipher.getInstance(Unknown Source)
            at iaik.security.provider.IAIK.a(Unknown Source)
            at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source)
            at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source)
            at com.sap.security.core.server.secstorefs.Crypt.<clinit>(Crypt.java:82)
            at java.lang.J9VMInternals.initializeImpl(Native Method)
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
            at com.sap.security.core.server.secstorefs.SecStoreFS.setSID(SecStoreFS.java:158)
            at com.sap.security.core.server.secstorefs.SecStoreFS.handleCreate(SecStoreFS.java:804)
            at com.sap.security.core.server.secstorefs.SecStoreFS.main(SecStoreFS.java:1274)
            ... 6 more
    Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
            at javax.crypto.b.<clinit>(Unknown Source)
            at java.lang.J9VMInternals.initializeImpl(Native Method)
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
            ... 17 more
    Caused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!
            at javax.crypto.b.a(Unknown Source)
            at javax.crypto.b.a(Unknown Source)
            at javax.crypto.b.access$600(Unknown Source)
            at javax.crypto.b$0.run(Unknown Source)
            at java.security.AccessController.doPrivileged(AccessController.java:246)
            ... 20 more
    ERROR      2009-07-07 14:10:47.063
               CJSlibModule::writeError_impl()
    CJS-30050  Cannot create the secure store. SOLUTION: See output of log file SecureStoreCreate.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:61)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    Caused by: java.lang.ExceptionInInitializerError
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:218)
            at javax.crypto.Cipher.a(Unknown Source)
            at javax.crypto.Cipher.getInstance(Unknown Source)
            at iaik.security.provider.IAIK.a(Unknown Source)
            at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source)
            at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source)
            at com.sap.security.core.server.secstorefs.Crypt.<clinit>(Crypt.java:82)
            at java.lang.J9VMInternals.initializeImpl(Native Method)
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
            at com.sap.security.core.server.secstorefs.SecStoreFS.setSID(SecStoreFS.java:158)
            at com.sap.security.core.server.secstorefs.SecStoreFS.handleCreate(SecStoreFS.java:804)
            at com.sap.security.core.server.secstorefs.SecStoreFS.main(SecStoreFS.java:1274)
            ... 6 more
    Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
            at javax.crypto.b.<clinit>(Unknown Source)
            at java.lang.J9VMInternals.initializeImpl(Native Method)
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
            ... 17 more
    Caused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!
            at javax.crypto.b.a(Unknown Source)
            at javax.crypto.b.a(Unknown Source)
            at javax.crypto.b.access$600(Unknown Source)
            at javax.crypto.b$0.run(Unknown Source)
            at java.security.AccessController.doPrivileged(AccessController.java:246)
            ... 20 more.
    ERROR      2009-07-07 14:10:47.547 [sixxcstepexecute.cpp:960]
    FCO-00011  The step createSecureStore with step key |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|2|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_SecureStore|ind|ind|ind|ind|8|0|createSecureStore was executed with status ERROR ( Last error reported by the step :Cannot create the secure store. SOLUTION: See output of log file SecureStoreCreate.log:
    SAP Secure Store in the File System - Copyright (c) 2003 SAP AG
    java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:61)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:81)
    Caused by: java.lang.ExceptionInInitializerError
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:218)
            at javax.crypto.Cipher.a(Unknown Source)
            at javax.crypto.Cipher.getInstance(Unknown Source)
            at iaik.security.provider.IAIK.a(Unknown Source)
            at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source)
            at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source)
            at com.sap.security.core.server.secstorefs.Crypt.<clinit>(Crypt.java:82)
            at java.lang.J9VMInternals.initializeImpl(Native Method)
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
            at com.sap.security.core.server.secstorefs.SecStoreFS.setSID(SecStoreFS.java:158)
            at com.sap.security.core.server.secstorefs.SecStoreFS.handleCreate(SecStoreFS.java:804)
            at com.sap.security.core.server.secstorefs.SecStoreFS.main(SecStoreFS.java:1274)
            ... 6 more
    Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
            at javax.crypto.b.<clinit>(Unknown Source)
            at java.lang.J9VMInternals.initializeImpl(Native Method)
            at java.lang.J9VMInternals.initialize(J9VMInternals.java:196)
            ... 17 more
    Caused by: java.lang.SecurityException: Jurisdiction policy files are not signed by trusted signers!
            at javax.crypto.b.a(Unknown Source)
            at javax.crypto.b.a(Unknown Source)
            at javax.crypto.b.access$600(Unknown Source)
            at javax.crypto.b$0.run(Unknown Source)
            at java.security.AccessController.doPrivileged(AccessController.java:246)
            ... 20 more.).
    what could be the problem ?
    Please give me the soluation
    regards
    Vijay

    Dear Juan
    You are correct.
    I downloaded correct file from IBM site , and Create Secure store step completed but innext step IMPORT JAVA DUMP
    it gave error
    n error occurred while processing service SAP ERP 6.0 Support Release 3 > SAP Systems > Oracle > Central System > Central System( Last error reported by the step : Execution of JLoad tool '/usr/java14_64/bin/java -classpath /swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/launcher.jar -showversion -Xmx512m -Xj9 com.sap.engine.offline.OfflineToolStart com.sap.inst.jload.Jload /swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/lib/iaik_jce.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/jload.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/antlr.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/exception.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/jddi.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/logging.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/offlineconfiguration.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/opensqlsta.jar:/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/install/sharedlib/tc_sec_secstorefs.jar:/oracle/client/10x_64/instantclient/ojdbc14.jar -sec AGQ,jdbc/pool/AGQ,/usr/sap/AGQ/SYS/global/security/data/SecStore.properties,/usr/sap/AGQ/SYS/global/security/data/SecStore.key -dataDir /swdump/NW7.0_SR3_JAVA_COMP_51033513/DATA_UNITS/JAVA_EXPORT_JDMP -job /swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/IMPORT.XML -log jload.log' aborts with return code 1. SOLUTION: Check 'jload.log' and '/swdump/tmpinst/sapinst_instdir/ERP/SYSTEM/ORA/CENTRAL/AS/jload.java.log' for more information.
    regards
    vijjay

  • Load XML file from addon domain without cross-domain Policy file

    Hello.
    Assuming that there are two addon domains on the same server: /public_html/domain1.com       and      /public_html/domain2.com
    I try to load XML file from domain2.com into domain1.com without using cross-domain policy file (since it doesn’t work on xml files in my case).
    So the idea is to use php file in order to load XML and read it back to flash.
    I’ve found an interesting scripts that seems to do the job but unfortunately I can't get it to work. In my opinion there is somewhere problem with AS3 part. Please take a look.
    Here are the AS3/PHP scripts:
    AS3 (.swf in www.domain1.com):
    // location of the xml that you would like to load, full http address
    var xmlLoc:String = "http://www.domain2.com/MyFile.xml";
    // location of the php xml grabber file, in relation to the .swf
    var phpLoc:String = "loadXML.php";
    var xml:XML;
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest(phpLoc+"?location="+escape(xmlLoc) );
    loader.addEventListener(Event.COMPLETE, onXMLLoaded);
    loader.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorHandler);
    loader.load(request);
    function onIOErrorHandler(e:IOErrorEvent):void {
        trace("There was an error with the xml file "+e);
    function onXMLLoaded(e:Event):void {
        trace("the rss feed has been loaded");
        xml = new XML(loader.data);
        // set to string, since it is passed back from php as an object
        xml = XML(xml.toString());
        xml_txt.text = xml;
    PHP (loadXML.php in www.domain1.com):
    <?php
    header("Content-type: text/xml");
    $location = "";
    if(isset($_GET["location"])) {
        $location = $_GET["location"];
        $location = urldecode($location);
    $xml_string = getData($location);
    // pass the url encoded vars back to Flash
    echo $xml_string;
    //cURLs a URL and returns it
    function getData($query) {
        // create curl resource
        $ch = curl_init();
        // cURL url
        curl_setopt($ch, CURLOPT_URL, $query);
        //Set some necessary params for using CURL
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       //Execute the curl function, and decode the returned JSON data
        $result = curl_exec($ch);
        return $result;
        // close curl resource to free up system resources
        curl_close($ch);
    ?>

    I think you might be right about permissions/settings on the server for php. Unfortunately I'm not allowed to adjust them.
    So I wrote my own script - this time I used file path instead of http address of the XML file.  It works fine in my case.
    Here it is:
    XML file on domain2.com:
    <?xml version="1.0" encoding="UTF-8"?>
    <gallery>
        <image imagePath="galleries/gallery_1/images/1.jpg" thumbPath="galleries/gallery_1/thumbs/1.jpg" file_name= "1"> </image>
        <image imagePath="galleries/gallery_1/images/2.jpg" thumbPath="galleries/gallery_1/thumbs/2.jpg" file_name= "2"> </image>
        <image imagePath="galleries/gallery_1/images/3.jpg" thumbPath="galleries/gallery_1/thumbs/3.jpg" file_name= "3"> </image>
    </gallery>
    swf  on domain1.com:
    var imagesXML:XML;
    var variables:URLVariables = new URLVariables();
    var varURL:URLRequest = new URLRequest("MyPHPfile.php");
    varURL.method = URLRequestMethod.POST;
    varURL.data = variables;
    var MyLoader:URLLoader = new URLLoader;
    MyLoader.dataFormat =URLLoaderDataFormat.VARIABLES;
    MyLoader.addEventListener(Event.COMPLETE, XMLDone);
    MyLoader.load(varURL);
    function XMLDone(event:Event):void {
        var imported_XML:Object = event.target.data.imported_XML;
        imagesXML = new XML(imported_XML);
       MyTextfield_1.text = imagesXML;
       MyTextfield_2.text = imagesXML.image[0].attribute("thumbPath");  // sample reference to attribute "thumbPath" of the first element
    php file on domain1.com:
    <?php
    $xml_file = simplexml_load_file('../../domain2.com/galleries/gallery_1/MyXMLfile.xml');  // directory to XML file on the same server
    $imported_XML = $xml_file->asXML();
    print "imported_XML=" . $imported_XML;
    ?>
    Regards
    PS: for those who read the above discussion: the first and the second script work but you must test which one is better in your situation. The first script will also work between two domains on different servers. No cross domain policy file needed.

  • 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?

  • How do I apply JCE Jurisdiction Policy Files in oracle jvm

         I have some java procedure using AES, while the default key size limit is 128.
         For local java, I can easily replace Jurisdiction Policy Files in JDK OR JRE,  But I do not know how to do such thing in oracle database(11g2) jvm

    $ORACLE_HOME/jdk/jre/lib/security

  • How to assign special FilePermission in a policy file

    Hi,
    I'm using jaas 1.0 with JDK1.3.
    I want a user to be able to specify a file (a password file : login-password) and to be able to access it before being authenticated. (and so without any permissions to access it)
    I'd like to assign FilePermission not for a file in particulary but for files with an extension in particular (*.pwd in my example). How can I do it in a policy file ?
    Check my code :
    I am in the e:/dvpl directory.
    if I specify that the file must be passwd2.pwd, that's ok, that works, but
    if I want to give read permissions for all the files in conf/ or just for *.pwd, that doesn't work.
    How can I do ?
      //permission java.io.FilePermission "e:/dvpl/conf/passwd2.pwd", "read";
      permission java.io.FilePermission "./conf/-", "read";
      permission java.io.FilePermission "e:/dvpl/conf/-", "read";
      permission java.io.FilePermission "e:/dvpl/conf/*.pwd", "read";Thanks for any help.
    Yann P.
    JOnAS The EJB Server
    http://www.objectweb.org/jonas/index.html

    if you want to give read permissions for all the files in conf:
    permission java.io.FilePermission "\\dvp\\conf\\-","read";
    Hope this help!

Maybe you are looking for