I'm new to Jini and having problems registering a service. I have Jini installed and my client can successfully connect. My simple service is running on a 3rd machine, but doesn't seem to register correctly. First, the service browser shows my service as "Unknown Service" with a red X over it. Second, when my client attempts to lookup that service I get the following stack trace:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: com.softprotech.xmlencoder.XMLEncoder at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:120) at com.softprotech.jini.UnicastClient.getXMLEncoder(UnicastClient.java:73) at com.softprotech.jini.UnicastClient.execute(UnicastClient.java:36) at com.softprotech.jini.Main.main(Main.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Caused by: java.lang.ClassNotFoundException: com.softprotech.xmlencoder.XMLEncoder at java.net.URLClassLoader$1.run(URLClassLoader.java:199) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:219) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:430) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165) at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631) at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257) at net.jini.loader.ClassLoading.loadClass(ClassLoading.java:138) at net.jini.io.MarshalInputStream.resolveClass(MarshalInputStream.java:296) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at net.jini.io.MarshalledInstance.get(MarshalledInstance.java:358) at net.jini.io.MarshalledInstance.get(MarshalledInstance.java:287) at com.sun.jini.proxy.MarshalledWrapper.get(MarshalledWrapper.java:127) at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:116) ... 8 more
Also, when I query for all the available services the service has a null value in ServiceItem.service. I've done a lot of forum reading and it appears that the problem is with the way my service's HTTP server is handling the class file.
I've tried hosting the jar file using Tomcat and the lightweight server provided with Jini, both have the same results. I have the Jini HTTP server running in the same directory as the jar file:
java -jar tools.jar -port 8080
I'm specify the following codebase:
-Djava.rmi.server.codebase=http://10.0.141.90:8080/XMLEncoder-dl.ja r
Any thoughts as to what I'm doing wrong? Thanks in advance for any help.