Hi,

I got the following working with Eclipse.

1) Create a java2 security policy file such as tuscany.policy in root of the sample project with the following content:

grant codeBase "file:/C:/Tuscany/java/sca/modules/-" {
 permission java.security.AllPermission;
};

grant codeBase "file:${user.home}/.m2/repository/-" {
 permission java.security.AllPermission;
};

The first grant is for the tuscany modules in your workspace. You might need to adjust it to fit your environment.
The second grant is for the 3rd party jars tuscany modules depend on.

2) Create a run profile for the main class with VM arguments set to:
-Djava.security.manager  -Djava.security.policy==tuscany.policy 
-Dpolicy.allowSystemProperty=true

Thanks,
Raymond
--------------------------------------------------
From: "Dan Becker" <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2008 10:56 AM
To: <[email protected]>
Subject: Tuscany policy file syntax

I have two questions on running Tuscany code in Eclipse with security manager and user policy files.

1) In a command line environment, I usually provide a policy files with the following simple syntax: java -Djava.security.manager -Djava.security.policy=mypolicy.policy MyApp

However with my Tuscany sample in Eclipse, I had trouble finding the policy file with that sort of syntax when I placed my policy in the src/main/resource or target/classes directory. It did work when I provided a long ugly workspace file URL: java -Djava.security.manager -Djava.security.policy=file:/D:/workspaces/tuscany-code/sample-security-getprops/target/classes/mypolicy.policy MyApp

Does anyone have a more usable URL or place to locate the policy file so I can use the first simpler syntax?

2) In a similar vein, I tried to add some permissions in my policy file for the tuscany runtime code. I found that this ugly type of syntax inside the policy file seemed to work:
   grant codeBase "file:/tuscany-sca*.jar" {
      ...
   }

However, this simpler, more understandable, more general way of specifying the code base did not seem to work for me:
   grant codeBase "http://org.apache.tuscany.sca/-"; {
      ...
   }
Is there a simpler more obvious way to add access to the runtime code?

--
Thanks, Dan Becker

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to