Hello,

I am evaluating JINI for use in a personal project.  The apache example
builds and works perfectly, but when I use it as a point of departure for
my own project, I am getting an AccessControlException when using the
Browser. (Text below.)  Perhaps a push in the right direction will help me
to understand the issue.

I started with the example project and changed the package
 from org.apache.river.examples.browser.Browser to
com.myproject.river. . . .

I changed all references in the config files to the new package name.  Also
modified the POM.  Everything looks like it should work.

The browser builds and runs, but when I select the registrar from the
pulldown (which became visible when I started the infrastructure services),
the application crashes and gives AccessControlException (below).  It is
able to see the infrastructure service, but when I select it, the exception
is thrown.

When I inspect the manifest of my Browser jar file, it is identical except
that the entry class is different, as intended.

Again, all I did was change the package name, the maven build, and the
references to it in the .config files.

Any help appreciated.  I am very interested in JINI for its multicast
discovery which will simplify configuration of my application for end users
who may not be tech savvy.


C:\Users\Chris\workspace\my-browser>java -Djava.security.manager
-Djava.security.policy=server.policy
-Djava.rmi.server.useCodebaseOnly=false -jar lib/start.jar
start-browser.config
Jun 01, 2016 7:00:06 PM com.myproject.river.examples.browser.Browser failure
INFO: call to lookup service failed
java.security.AccessControlException: access denied
("java.lang.RuntimePermissio
n" "accessClassInPackage.com.sun.proxy")
        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.checkPackageAccess(Unknown Source)
        at sun.reflect.misc.ReflectUtil.checkPackageAccess(Unknown Source)
        at sun.reflect.misc.ReflectUtil.checkPackageAccess(Unknown Source)
        at java.io.ObjectOutputStream.writeProxyDesc(Unknown Source)
        at java.io.ObjectOutputStream.writeClassDesc(Unknown Source)
        at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
        at java.io.ObjectOutputStream.writeObject0(Unknown Source)
        at java.io.ObjectOutputStream.writeObject(Unknown Source)
        at
com.sun.jini.jeri.internal.runtime.Util.marshalValue(Util.java:176)
        at
net.jini.jeri.BasicInvocationHandler.marshalArguments(BasicInvocation
Handler.java:1182)
        at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvo
cationHandler.java:778)
        at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocati
onHandler.java:659)
        at
net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.ja
va:528)
        at com.sun.jini.reggie.$Proxy6.notify(Unknown Source)
        at
com.sun.jini.reggie.RegistrarProxy.notify(RegistrarProxy.java:139)
        at
com.myproject.river.examples.browser.Browser.update(Browser.java:1301)

...

Reply via email to