2

I know Jini (Apache River) is a pretty old and outdated technology, but I need it for an university project.

The problem is I cannot even start the lookup service script (jrmp-reggie.sh). Executing the httpd.sh works good.

Any advice? Thanks.

By the way, here is the output I'm getting:

+ java -Djava.security.policy=config/start.policy -Djava.ext.dirs=../../lib-ext/ -jar ../../lib/start.jar config/start-reggie.config
Jun 14, 2013 8:19:51 PM com.sun.jini.reggie.RegistrarImpl <init>
SEVERE: Reggie initialization failed
java.lang.ExceptionInInitializerError
    at net.jini.config.AbstractConfiguration.getEntryInternal(AbstractConfiguration.java:371)
    at net.jini.config.AbstractConfiguration.getEntry(AbstractConfiguration.java:193)
    at com.sun.jini.reggie.RegistrarImpl.init(RegistrarImpl.java:4554)
    at com.sun.jini.reggie.RegistrarImpl.access$000(RegistrarImpl.java:143)
    at com.sun.jini.reggie.RegistrarImpl$1.run(RegistrarImpl.java:448)
    at com.sun.jini.reggie.RegistrarImpl.loginAndRun(RegistrarImpl.java:461)
    at com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:396)
    at com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarImpl.java:39)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivatableServiceDescriptor.java:674)
    at com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:287)
    at com.sun.jini.start.ServiceStarter.processServiceDescriptors(ServiceStarter.java:445)
    at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:476)
Caused by: java.lang.RuntimeException: Unexpected exception
    at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
    at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
    ... 16 more
Caused by: java.io.EOFException
    at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
    at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
    ... 17 more

Jun 14, 2013 8:19:51 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(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at com.sun.jini.start.NonActivatableServiceDescriptor.create(NonActivatableServiceDescriptor.java:674)
    at com.sun.jini.start.ServiceStarter.create(ServiceStarter.java:287)
    at com.sun.jini.start.ServiceStarter.processServiceDescriptors(ServiceStarter.java:445)
    at com.sun.jini.start.ServiceStarter.main(ServiceStarter.java:476)
Caused by: java.lang.ExceptionInInitializerError
    at net.jini.config.AbstractConfiguration.getEntryInternal(AbstractConfiguration.java:371)
    at net.jini.config.AbstractConfiguration.getEntry(AbstractConfiguration.java:193)
    at com.sun.jini.reggie.RegistrarImpl.init(RegistrarImpl.java:4554)
    at com.sun.jini.reggie.RegistrarImpl.access$000(RegistrarImpl.java:143)
    at com.sun.jini.reggie.RegistrarImpl$1.run(RegistrarImpl.java:448)
    at com.sun.jini.reggie.RegistrarImpl.loginAndRun(RegistrarImpl.java:461)
    at com.sun.jini.reggie.RegistrarImpl.<init>(RegistrarImpl.java:396)
    at com.sun.jini.reggie.TransientRegistrarImpl.<init>(TransientRegistrarImpl.java:39)
    ... 8 more
Caused by: java.lang.RuntimeException: Unexpected exception
    at com.sun.jini.logging.Levels.createLevel(Levels.java:142)
    at com.sun.jini.logging.Levels.<clinit>(Levels.java:52)
    ... 16 more
Caused by: java.io.EOFException
    at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2596)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1316)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
    at com.sun.jini.logging.Levels.createLevel(Levels.java:138)
    ... 17 more

Jun 14, 2013 8:19:51 PM com.sun.jini.start.ServiceStarter checkResultFailures
WARNING: Associated service descriptor [0]: [http://t420:8080/reggie-dl.jar http://t420:8080/jsk-dl.jar, config/reggie.policy, ../../lib/reggie.jar, com.sun.jini.reggie.TransientRegistrarImpl, [config/jrmp-reggie.config], com.sun.jini.start.NonActivatableServiceDescriptor$1@c27ce4, BasicProxyPreparer[]]
Viktor
  • 205
  • 2
  • 3
  • 13

3 Answers3

1

This looks like the same error I have seen when upgrading the JDK. Try JDK 1.6.0_38 (if you are using a higher version). Also the Apache River project did come across this issue and appeared to have a workaround which involves changing Levels.java

https://issues.apache.org/jira/browse/RIVER-415

Regards

Rod

RodAllen
  • 36
  • 4
0

Sounds like you didn't start rmid possibly.

Rocky Pulley
  • 22,531
  • 20
  • 68
  • 106
  • I just started it with `rmid -J-Djava.security.policy=rmid.policy` and I get the exact same error. Is there any other way to do it properly? – Viktor Jun 14 '13 at 18:48
  • 1
    did the HTTP server start properly? what's the command for it? any error logs in the http server? – Rocky Pulley Jun 14 '13 at 18:54
  • Nope, not at all. The HTTP server started perfectly. The command is just `./scripts/httpd.sh` according to [this guide](http://river.apache.org/user-guide-basic-river-services.html) -- with this output `+ java -jar ../../lib/classserver.jar -port 8080 -dir lib:../../lib-dl Jun 14, 2013 8:07:19 PM com.sun.jini.tool.ClassServer run INFO: ClassServer started [[lib/, ../../lib-dl/], port 8080]` – Viktor Jun 14 '13 at 19:00
  • 1
    so you can open http://localhost:8080/reggie-dl.jar in a browser and it downloads the file? If that works I'm not sure what else it could be, other than maybe some file permissions issues on the server. – Rocky Pulley Jun 14 '13 at 19:02
  • Yes, that works. Just Reggie doesn't start. And `java.policy` contains the grant `permission java.security.AllPermission;` – Viktor Jun 14 '13 at 19:07
  • yes i saw you have the java permissions file, I was talking about file permissions. I'm guessing maybe you are running this on linux, does the directory it's running under have write permissions. I know it writes some log files, maybe it can't create the log files due to the OS file system permissions. – Rocky Pulley Jun 14 '13 at 19:43
0

I guess the Reggie script attempts to gain access to configuration files, but it cant! If the script is located in: river/examples/hello/scripts Copy it on folder higher. I mean river/examples/hello/ Then, run it. Just let me know about your output. You are using 'sh' file. But, do not use the 'bat' file. Let me know the result.

Emad Van Ben
  • 1,578
  • 1
  • 10
  • 12
  • In addition, open the script in editor. check: at the beginning there should be a 'set -x' command. Then, Jini was developed long time ago. The JDK is Java 1.6 update 24. – Emad Van Ben Jun 15 '13 at 09:15
  • on thing more, run the httpd.sh with verbose option to check that reggie can request the httpd or not. $ sh httpd.sh -verbose – Emad Van Ben Jun 15 '13 at 09:18
  • Did all of the above. Still the same errors. This is the Reggie script `set -x java -Djava.security.policy=config/start.policy \ -Djava.ext.dirs=../../lib-ext/ \ -jar ../../lib/start.jar \ config/start-reggie.config` – Viktor Jun 15 '13 at 09:29