A strange problem when I start JINI lookup service

Discussion in 'Java' started by Zheng Da, Feb 26, 2006.

  1. Zheng Da

    Zheng Da Guest

    I installed JINI in d:\jini2_1.
    I started http service, and it succeeded:
    D:\>java -jar jini2_1\lib\classserver.jar -port 8080 -dir
    jini2_1\lib-dl
    Feb 26, 2006 4:04:07 AM com.sun.jini.tool.ClassServer run
    INFO: ClassServer started [[jini2_1\lib-dl\], port 8080]

    The config files are from the Hello example in JINI, and I made some
    little change, and put them in the path of jini2_1\myconfig.

    start-reggie.config:
    /* Configuration file for starting non-secure Reggie */

    import com.sun.jini.config.ConfigUtil;
    import com.sun.jini.start.NonActivatableServiceDescriptor;
    import com.sun.jini.start.ServiceDescriptor;

    com.sun.jini.start {

    private static codebase =
    ConfigUtil.concat(
    new Object[] {
    "http://", ConfigUtil.getHostName(), ":8080/reggie-dl.jar",
    " ",
    "http://", ConfigUtil.getHostName(), ":8080/jsk-dl.jar"
    } );
    private static policy = "${/}jini2_1${/}myconfig${/}reggie.policy";
    private static classpath = "${/}jini2_1${/}lib${/}reggie.jar";
    private static config =
    "${/}jini2_1${/}myconfig${/}jrmp-reggie.config";

    static serviceDescriptors = new ServiceDescriptor[] {
    new NonActivatableServiceDescriptor(
    codebase, policy, classpath,
    "com.sun.jini.reggie.TransientRegistrarImpl",
    new String[] { config })
    };

    }//end com.sun.jini.start
    -------------------------------------------------------------------------------------------------------------------------------
    start.policy:
    /* Policy file for the service starter */

    grant{
    permission java.security.AllPermission;
    };
    --------------------------------------------------------------------------------------------------------------------------------
    jrmp-reggie.config:
    /* Configure source file for JRMP reggie */

    import net.jini.jrmp.JrmpExporter;

    com.sun.jini.reggie {

    serverExporter = new JrmpExporter();
    initialMemberGroups = new String[] { "" };

    }//end com.sun.jini.reggie



    Then I started JINI lookup service, but when I started it in the path
    of D:\jini2_1\source\src\com\sun\jini\example\hello, it would succeed
    D:\jini2_1\source\src\com\sun\jini\example\hello>java
    -Djava.security.policy=/jini2_1/myconfig/start.policy -jar
    /jini2_1/lib/start.jar /jini2_1/myconfig/start-reggie.config
    Feb 26, 2006 1:04:23 PM com.sun.jini.reggie.RegistrarImpl init
    INFO: started Reggie: f86244ec-994b-4ccd-a567-5031421e517e, [],
    jini://school-44bb4a4a/

    But if I started the service in the other paths, it would get some
    exception:
    D:\jini2_1\source\src\com\sun\jini\example>java
    -Djava.security.policy=/jini2_1/
    myconfig/start.policy -jar /jini2_1/lib/start.jar
    /jini2_1/myconfig/start-reggie
    ..config
    Feb 26, 2006 12:50:26 PM com.sun.jini.reggie.RegistrarImpl <init>
    SEVERE: Reggie initialization failed
    net.jini.config.ConfigurationException:
    \jini2_1\myconfig\jrmp-reggie.config:pro
    blem reading configuration file; caused by:
    java.security.AccessControlException: access denied
    (java.io.FilePermiss
    ion \jini2_1\myconfig\jrmp-reggie.config read)
    at
    net.jini.config.ConfigurationFile.oops(ConfigurationFile.java:2746)
    at
    net.jini.config.ConfigurationFile.<init>(ConfigurationFile.java:1815)

    at
    net.jini.config.ConfigurationProvider.getInstance(ConfigurationProvid
    er.java:225)
    at
    com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:391)
    at
    com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarI
    mpl.java:37)
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at
    com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivata
    bleServiceDescriptor.java:628)
    at
    com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:290)
    at
    com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:470)
    Caused by: java.security.AccessControlException: access denied
    (java.io.FilePerm
    ission \jini2_1\myconfig\jrmp-reggie.config 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.checkRead(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at
    net.jini.config.ConfigurationFile.<init>(ConfigurationFile.java:1801)

    ... 10 more
    Feb 26, 2006 12:50:26 PM com.sun.jini.start.ServiceStarter
    checkResultFailures
    WARNING: Exception creating service.
    java.lang.reflect.InvocationTargetException
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at
    com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivata
    bleServiceDescriptor.java:628)
    at
    com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:290)
    at
    com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:470)
    Caused by: net.jini.config.ConfigurationException:
    \jini2_1\myconfig\jrmp-reggie
    ..config:problem reading configuration file; caused by:
    java.security.AccessControlException: access denied
    (java.io.FilePermiss
    ion \jini2_1\myconfig\jrmp-reggie.config read)
    at
    net.jini.config.ConfigurationFile.oops(ConfigurationFile.java:2746)
    at
    net.jini.config.ConfigurationFile.<init>(ConfigurationFile.java:1815)

    at
    net.jini.config.ConfigurationProvider.getInstance(ConfigurationProvid
    er.java:225)
    at
    com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:391)
    at
    com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarI
    mpl.java:37)
    ... 7 more
    Caused by: java.security.AccessControlException: access denied
    (java.io.FilePerm
    ission \jini2_1\myconfig\jrmp-reggie.config 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.checkRead(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at
    net.jini.config.ConfigurationFile.<init>(ConfigurationFile.java:1801)

    ... 10 more
    Feb 26, 2006 12:50:26 PM com.sun.jini.start.ServiceStarter
    checkResultFailures
    WARNING: Associated service descriptor [0]:
    [http://school-44bb4a4a:8080/reggie-
    dl.jar http://school-44bb4a4a:8080/jsk-dl.jar,
    \jini2_1\myconfig\reggie.policy,
    \jini2_1\lib\reggie.jar, com.sun.jini.reggie.TransientRegistrarImpl,
    [\jini2_1\m
    yconfig\jrmp-reggie.config],
    com.sun.jini.start.NonActivatableServiceDescriptor$
    1@7a78d3, BasicProxyPreparer[]]
    Zheng Da, Feb 26, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    469
  2. felix

    Servlet / Jini Lookup pbm

    felix, Mar 15, 2005, in forum: Java
    Replies:
    0
    Views:
    396
    felix
    Mar 15, 2005
  3. Replies:
    2
    Views:
    424
    Cameron Laird
    Jan 10, 2006
  4. Replies:
    2
    Views:
    356
    Cameron Laird
    Jan 10, 2006
  5. Mr. X.
    Replies:
    0
    Views:
    301
    Mr. X.
    Jul 5, 2007
Loading...

Share This Page