• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

policy file

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you need to specify Policy file when you are using the application in NON-networked mode ?
I feel that it should only be specified when u r accessing classes/files on a remote machine.
Any ideas?
Ravi.
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The problem is that the mode to run in is not one of the acceptable parameters to pass to the application.
So that means that if the user must choose after the application starts, you must always start with the security profile parameter.
Of course if you can determine which mode to run in solely by the name of the database parameter, then my logic falls through.
Hope this helps.
 
Ravikiran Choppalli
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But, when starting a local client without any server, if you just pass the db.db file it should be enough. You can always decide by judging the no. of parameters passed.
my question is that do we need to specify the policy file when we are not using RMI for the local client.
and when starting networked client with a server running, you can specify the policy file along with the hostname and port number.
what do u say?
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that the policy file is only needed for RMI
and not required for the local mode.
 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With reference to the above discussion, please help me out with the following:
1. Do we need a policy file for the client at all?
I seem to running fine on networked mode without a policy file? Am I missing something?
2. Where can I find the instructions on what my end jar file should be called? My entire application is in a suncertify directory structure. Therefore I will am hoping the create a final jar structure that looks like

application
|
- README.txt
|
- suncertify
I am not sure what this application is to be called. I hear people saying it should contain the user ID and so on. Please help...
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks but I figured out from the galton website that the final jar must be titled scjda-num.jar.
I am still not sure of the policy file though? Do we need separate ones for the client and server? Or can just one be used? Any insights would be greately appreciated.
 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:
I have seen few people had two separate policy file each for client and server. No problem they pass the test. Most of other had only one policy file both for client and user. SUN examiner does not mind for this choice too. There is no clear instruction for policy file. I think, choice is yours, just got to document it.
-Bal
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bal,
Thanks a lot for the answer. I am using the follwoing file for my policy
grant {
permission java.net.SocketPermission "*:1024-65535", "connect,accept,resolve";
permission java.io.FilePermission "<>", "read, write";
};
Also I'n passing in the host name to my server using java -DHOST=rmi://hostname -DPORTNUM=1999 ....
I am getting the following exception:
Exception in thread "main" java.security.AccessControlException: access denied (java.util.PropertyPermission HOST read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
at java.security.AccessController.checkPermission(AccessController.java:399)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1278)
at java.lang.System.getProperty(System.java:560)
at suncertify.server.FBNServer.main(FBNServer.java:116)
I have limited experiences with policy files. Any input is greately appreciated. Thanks dude.
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I fixed my bug and got the server startup screen up with thefollowing change:
grant {
permission java.net.SocketPermission "*:1024-65535", "connect,accept,resolve";
permission java.io.FilePermission "*", "read , write";
permission java.util.PropertyPermission "HOST", "read";
permission java.util.PropertyPermission "PORT", "read";
};
Now I have a new problem. The screen has tool bar in the bottom that says applet window when it not even an applet..Any clues please...
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
You need this:

/Ren�
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rene. I just granted java.awt.AWTPermission "*" and that worked. What you says also will work definitely.
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kalichar:
I think you have already solved the problem adding java.awt.AWTPermission, right!. I did not explicitly mention any specific security. I had one single line policy file as below for both client and server.

In other words, there is no security at all. I gave all permission. What is the heck of this security? Meaningless right!
But if I don't reference this policy during the implementation, it is not goanna work. That is it.
Good luck BUDDY. -Bal
 
A wop bop a lu bop a womp bam boom! Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic