[Aglets-developer] A bug in the default security policy file ...??
Status: Beta
Brought to you by:
cat4hire
|
From: <tom...@gm...> - 2006-08-11 06:36:53
|
Hi!
I have had the same problem. It seems there is a bug in the standard
security policy file or it is not working with a standard windows system
anymore...
If you just remove all the text in the file and write:
// Do what you will
grant {
permission java.security.AllPermission;
};
There should not be a problem. Be aware that this is not safe !!!
But you can start from there and see if it works. I
On 8/10/06, agl...@li... <
agl...@li...> wrote:
>
> Send Aglets-developer mailing list submissions to
> agl...@li...
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/aglets-developer
> or, via email, send a message with subject or body 'help' to
> agl...@li...
>
> You can reach the person managing the list at
> agl...@li...
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Aglets-developer digest..."
>
>
> Today's Topics:
>
> 1. need urgent help (jsp patt)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 10 Aug 2006 08:03:50 -0700 (PDT)
> From: jsp patt <pat...@ya...>
> Subject: [Aglets-developer] need urgent help
> To: agl...@li...
> Message-ID: <200...@we...>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
> i am using the platform java 1.4,aglet 2.0 version.getting error at
> security policy file
>
> The code is as folows...
>
> import java.awt.Frame;
> import java.net.URL;
> import java.net.UnknownHostException;
> import java.io.File;
> import java.util.Properties;
> import com.ibm.maf.*;
> import com.ibm.aglet.*;
> import com.ibm.aglet.system.*;
> import com.ibm.aglets.MAFAgentSystem_AgletsImpl;
> import com.ibm.aglets.tahiti.Tahiti;
> import com.ibm.awb.security.AccessController;
> import com.ibm.awb.misc.*;
> public class AirServer extends ContextAdapter {
>
> public void agletCreated(ContextEvent ev) {
> System.out.println("Aglet Created : " + ev.getAgletProxy());
> }
>
> public void agletCloned(ContextEvent ev) {
> // System.out.println("Aglet Cloned : " + ev.getAgletProxy());
> }
>
> public void agletArrived(ContextEvent ev) {
> // System.out.println("Aglet Arrived : " + ev.getAgletProxy());
> }
>
> public void agletActivated(ContextEvent ev) {
> // System.out.println("Aglet Activated : " + ev.getAgletProxy());
> }
> public void agletDisposed(ContextEvent ev) {
> System.out.println("Aglet Disposed : " + ev.getAgletProxy());
> }
>
> public void agletDispatched(ContextEvent ev) {
> System.out.println("Aglet Dispatched : " + ev.getAgletProxy());
> }
>
> public void agletDeactivated(ContextEvent ev) {
> // System.out.println("Aglet Deactivated : " + ev.getAgletProxy());
> }
>
> public void agletReverted(ContextEvent ev) {
> // System.out.println("Aglet Reverted : " + ev.getAgletProxy());
> }
>
> public void showMessage(ContextEvent ev) {
> // System.out.println("message : " + ev.getMessage());
> }
>
> private static final String PROTOCOL_FILE = "file";
>
> // additional options
> final static Opt options[] = {
> Opt.Entry("-protocol", "maf.protocol", null),
> Opt.Entry("-username", "username", null),
> Opt.Entry("-password", "password", null),
> };
>
> public static void main(String args[]) throws java.lang.Exception {
> Opt.setopt(options);
> AgletRuntime runtime = null;//AgletRuntime.init(args);
>
> String DEFAULT_USERNAME = "eseidler";
> String username = "eseidler";
> String password = "bla";
> try {
> AccessController.beginPrivileged();
> DEFAULT_USERNAME = System.getProperty("user.name");
> file://username = "eseidler"; file://System.getProperty("username",
> DEFAULT_USERNAME);
> file://password = "bla"; file://System.getProperty("password",
> "");
> username = "aglet_key";
> password = "aglets";
> } finally {
> AccessController.endPrivileged();
> }
>
> Object obj = runtime.authenticateOwner(username, password);
> if (obj == null) {
> System.err.println("Cannot authenticate the user \"" + username +
> "\"");
> throw new Exception("User authentication failed.");
> }
>
>
> MAFAgentSystem maf_system = new MAFAgentSystem_AgletsImpl(runtime);
>
> String protocol = "atp";
> try {
> AccessController.beginPrivileged();
> protocol = System.getProperty("maf.protocol", "atp");
> } finally {
> AccessController.endPrivileged();
> }
>
> MAFAgentSystem.initMAFAgentSystem(maf_system, protocol);
> file://Tahiti.initializeGUI();
> Tahiti.installFactories();
>
> //
> // Creates a named context. To dispatch to this context, you have to
> // specify the destination, for example,
> // "atp://aglets.trl.ibm.com:434/test"
> // Defining multiple context is also supported.
> //
> Tahiti.installSecurity();
> MAFAgentSystem.startMAFAgentSystem(maf_system, protocol);
> AgletContext cxt = runtime.createAgletContext("aircraft");
> cxt.addContextListener(new AirServer());
>
> cxt.start();
> // From here on, you can use this context.
> // (creating, dispatching an aglet, for instance)
> cxt.createAglet(null, "aircraft.AircraftAgent", null);
> }
> }
>
> i am getting the foloowing error...
> java.lang.ClassCastException: sun.security.provider.PolicyFile
> at com.ibm.awb.security.Policy.getThisPolicy(Policy.java:82)
> at com.ibm.awb.security.Policy.getPolicy(Policy.java:59)
> at com.ibm.awb.security.ProtectionDomain.<clinit>(
> ProtectionDomain.java:62)
> at
> com.ibm.awb.security.AccessController$BootstrapIntrospector.getDomain
> At(AccessController.java:64)
> at com.ibm.awb.security.AccessController.beginPrivileged
> (AccessControlle
> r.java:134)
> at AirServer.main(AirServer.java:70)
> Exception in thread "main" java.lang.NoClassDefFoundError
> at com.ibm.awb.security.ProtectionDomain.getDomain(
> ProtectionDomain.java
> :238)
> at
> com.ibm.awb.security.AccessController$BootstrapIntrospector.getDomain
> At(AccessController.java:64)
> at com.ibm.awb.security.AccessController.endPrivileged
> (AccessController.
> java:147)
> at AirServer.main(AirServer.java:77)
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail Beta.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://sourceforge.net/mailarchive/forum.php?forum=aglets-developer/attachments/20060810/dbc1ab8d/attachment.html
>
> ------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
> ------------------------------
>
> _______________________________________________
> Aglets-developer mailing list
> Agl...@li...
> https://lists.sourceforge.net/lists/listinfo/aglets-developer
>
>
> End of Aglets-developer Digest, Vol 3, Issue 1
> **********************************************
>
|