• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAAS1.0 sample Error

 
Tiger Scott
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I was trying to run the JAAS1.0 sample on win2000, jdk1.3. I have followd the steps with regard to the
classpath and editing the policy files (with '/') etc. But when I run it I get this error:
C:\jaas>java -classpath lib\jaas.jar;doc\samples\sample.jar;doc\samples\sample
_action.jar;doc\samples\sample_module.jar -Djava.security.manager -Djava.securit
y.policy=doc\samples\config\sample_java2.policy -Djava.security.auth.policy=doc\
samples\config\sample_jaas.policy -Djava.security.auth.login.config=doc\samples
\config\sample_jaas.config sample.Sample
Exception in thread "main" java.lang.ExceptionInInitializerError: java.security.
AccessControlException: access denied (java.util.PropertyPermission java.securit
y.auth.debug read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at javax.security.auth.login.Debug$1.run(Debug.java:27)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.Debug.<clinit>(Debug.java:24)
at javax.security.auth.login.LoginContext.<clinit>(LoginContext.java:147
)
at sample.Sample.main(Sample.java:41)
Thanks a lot,
Sanjay
 
Nanna
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you modify the policy files and specified the correct path in those files? You have to give the correct path of jaas.jar in the sample_jaas.policy and sampl_java2.policy files located in the config directory.
 
Tiger Scott
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
As mentioned I had done it.
TIA
Sanjay
 
Tiger Scott
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nanna,
Have you been able to run the examples?
Thanks
Sanjay
 
Tiger Scott
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There may be an editing error in my policy file. I can'y figure it out. When I try to open the policy file thru policytool it errors out.
For jaas_sample.policy it says: Error parsing file: line :expecting codeBase or SignedBy. The policy file looks like:
/** Subject-Based Access Control Policy for the JAAS Sample Application **/
grantcodeBase "file:c:/jaas/doc/samples/sample_action.jar",
Principal sample.SamplePrincipal "testUser" {
permission java.util.PropertyPermission "java.home", "read";
permission java.util.PropertyPermission "user.home", "read";
permission java.io.FilePermission "foo.txt", "read";
TIA
Sanjay
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!