Re: Unmarshalled Exception : ClassnotfoundException

G D <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <LISTSERV%[email protected]>
Hi Thanks for the suggestion but the problem would occur either way.

My problem is this :

I am using the Sun Jini2.0 Service Browser. I am experiencing this exception
and would like to know if someone can help me understand how I can solve it
please.


I using separate vm one to start the Sun services and one vm to kick off my
service (Impl).

I am using a starterService method of starting the service. I have included
the Server, Service, config files and console output.

Jar files consist of the following classes :
Starter-dl.jar
     RemoteIface.class
     StarterServer.class

Starter.jar
     RemoteIface.class
     Iface.class
     Impl.class
     .
     .
     .



While running the Server class which starts the service (Impl) and registers
the it with the Registrar and the following output results on the console
window :

Service Browser Output (after running serviceStarter):

cwd: C:\jini2_1\installverify\support
cmd: "C:\Program Files\Java\jdk1.5.0_03\jre\bin\java.exe"
-Djava.security.policy="C:\\jini2_1\\installverify\\support\\jsk-all.polic
y" -classpath
"C:\jini2_1\lib\start.jar;C:\jini2_1\installverify\support\lax.jar;"
com.zerog.lax.LAX "C:/jini2_1/installverify/suppo
rt/launch-all.lax" "C:/Documents and Settings/glenn/Local
Settings/Temp/laxB.tmp"
15/05/2007 22:33:06 com.sun.jini.tool.ClassServer run
INFO: ClassServer started [[C:\jini2_1\lib-dl\], port 8081]
browser-dl.jar requested from 192.168.2.3:1534
jsk-dl.jar requested from 192.168.2.3:1535
reggie-dl.jar requested from 192.168.2.3:1538
jsk-dl.jar requested from 192.168.2.3:1539
15/05/2007 22:33:23 com.sun.jini.reggie.RegistrarImpl init
INFO: started Reggie: 3557c23d-835c-45ef-ba17-51eb06332af9,
[glennInstallVerifyGroup], ConstrainableLookupLocator[[jini://192.168.2.
3/], [null]]
reggie-dl.jar probed from 192.168.2.3:1542
reggie-dl.jar requested from 192.168.2.3:1543
jsk-dl.jar requested from 192.168.2.3:1544
fiddler-dl.jar requested from 192.168.2.3:1545
jsk-dl.jar requested from 192.168.2.3:1546
15/05/2007 22:33:23 com.sun.jini.fiddler.FiddlerImpl logInfoStartup
INFO: Fiddler started: 4418cdc8-0340-4792-b71f-93f648648f4a,
[glennInstallVerifyGroup], []
fiddler-dl.jar probed from 192.168.2.3:1550
fiddler-dl.jar requested from 192.168.2.3:1552
mahalo-dl.jar requested from 192.168.2.3:1553
jsk-dl.jar requested from 192.168.2.3:1554
15/05/2007 22:33:24 com.sun.jini.mahalo.TxnManagerImpl doInit
INFO: Mahalo started: com.sun.jini.mahalo.TransientMahaloImpl@da6bf4
mahalo-dl.jar probed from 192.168.2.3:1558
mahalo-dl.jar requested from 192.168.2.3:1559
mercury-dl.jar requested from 192.168.2.3:1560
jsk-dl.jar requested from 192.168.2.3:1561
15/05/2007 22:33:24 com.sun.jini.mercury.MailboxImpl doInit
INFO: Mercury started: com.sun.jini.mercury.TransientMercuryImpl@29ce8c
mercury-dl.jar probed from 192.168.2.3:1565
mercury-dl.jar requested from 192.168.2.3:1566
norm-dl.jar requested from 192.168.2.3:1567
jsk-dl.jar requested from 192.168.2.3:1568
15/05/2007 22:33:24 com.sun.jini.norm.NormServerBaseImpl init
INFO: Norm service started:
TransientNormServerImpl[e2631224-25f6-4470-985c-ac9c409dc102]
norm-dl.jar probed from 192.168.2.3:1572
norm-dl.jar requested from 192.168.2.3:1573
outrigger-dl.jar requested from 192.168.2.3:1574
jsk-dl.jar requested from 192.168.2.3:1575
15/05/2007 22:33:25 com.sun.jini.outrigger.OutriggerServerImpl <init>
INFO: Outrigger server started:
com.sun.jini.outrigger.OutriggerServerImpl@1f31652
outrigger-dl.jar probed from 192.168.2.3:1579
outrigger-dl.jar requested from 192.168.2.3:1580
browser-dl.jar probed from 192.168.2.3:1581
browser-dl.jar requested from 192.168.2.3:1582
Starter-dl.jar requested from 192.168.2.3:1646
reggie-dl.jar probed from 192.168.2.3:1651
reggie-dl.jar requested from 192.168.2.3:1652
jsk-dl.jar requested from 192.168.2.3:1653
15/05/2007 23:13:23 com.sun.jini.reggie.RegistrarProxy handleException
INFO: unmarshalling failure
java.lang.ClassNotFoundException: com.common.jini.service.concrete.RemoteIface
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at
net.jini.loader.pref.PreferredClassLoader.loadClass(PreferredClassLoader.java:922)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at
net.jini.loader.pref.PreferredClassProvider.loadProxyInterfaces(PreferredClassProvider.java:1360)
        at
net.jini.loader.pref.PreferredClassProvider.loadProxyClass(PreferredClassProvider.java:1241)
        at
net.jini.loader.pref.PreferredClassProvider.loadProxyClass(PreferredClassProvider.java:1145)
        at
java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
        at net.jini.loader.ClassLoading.loadProxyClass(ClassLoading.java:240)
        at
net.jini.io.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:373)
        at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
        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.Item.get(Item.java:141)
        at
com.sun.jini.reggie.RegistrarEvent.readObject(RegistrarEvent.java:113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
        at com.sun.jini.jeri.internal.runtime.Util.unmarshalValue(Util.java:221)
        at
net.jini.jeri.BasicInvocationDispatcher.unmarshalArguments(BasicInvocationDispatcher.java:1049)
        at
net.jini.jeri.BasicInvocationDispatcher.dispatch(BasicInvocationDispatcher.java:599)
        at
com.sun.jini.jeri.internal.runtime.ObjectTable$6.run(ObjectTable.java:597)
        at
net.jini.export.ServerContext.doWithServerContext(ServerContext.java:103)
        at
com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch0(ObjectTable.java:595)
        at
com.sun.jini.jeri.internal.runtime.ObjectTable$Target.access$700(ObjectTable.java:212)
        at
com.sun.jini.jeri.internal.runtime.ObjectTable$5.run(ObjectTable.java:568)
        at
com.sun.jini.start.AggregatePolicyProvider$6.run(AggregatePolicyProvider.java:527)
        at java.security.AccessController.doPrivileged(Native Method)
        at
com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:565)
        at
com.sun.jini.jeri.internal.runtime.ObjectTable$Target.dispatch(ObjectTable.java:540)
        at
com.sun.jini.jeri.internal.runtime.ObjectTable$RD.dispatch(ObjectTable.java:778)
        at
net.jini.jeri.connection.ServerConnectionManager$Dispatcher.dispatch(ServerConnectionManager.java:148)
        at com.sun.jini.jeri.internal.mux.MuxServer$2.run(MuxServer.java:244)
        at
com.sun.jini.start.AggregatePolicyProvider$5.run(AggregatePolicyProvider.java:513)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.jini.jeri.internal.mux.MuxServer$1.run(MuxServer.java:241)
        at com.sun.jini.thread.ThreadPool$Worker.run(ThreadPool.java:136)
        at java.lang.Thread.run(Thread.java:595)


Starter Config File :
import com.sun.jini.start.ServiceDescriptor;
import com.sun.jini.start.NonActivatableServiceDescriptor;

com.sun.jini.start{
    private static  codebase = "http://pegasus:8081/Starter-dl.jar";
    private static  policy = "config/policy.all";
    private static  classpath = "C:/project/jini/build-src/dist/Starter.jar";
    private static  config = "config/starter/service.config";
 private static  impl =
"com.common.jini.service.concrete.StarterSpringAdapter";

    static serviceDescriptors = new ServiceDescriptor[] {
                new NonActivatableServiceDescriptor( codebase, policy,
classpath, impl, new String[] {config} )
    };

}


Implementation Class:

public class Impl implements RemoteIface
{

 public Impl(String[] args, LifeCycle lifecycle)
 {
  System.out.println(args);
 }

 public Impl()
 {

 }

 /*
  * (non-Javadoc)
  *
  * @see com.common.jini.service.concrete.Iface#f()
  */
 public void f() throws RemoteException
 {
  System.out.print("in here!");
 }
}



Interface Class:
public interface Iface extends Serializable
{

 public void f() throws RemoteException;

}

Remote Interface Class:

public interface RemoteIface extends Iface, Remote
{

}


Would really appreciate any help or ideas please.


Thanks in advance


On Wed, 16 May 2007 16:54:30 +0200, Rikard Elofsson
<[email protected]> wrote:

>G D wrote:
>> The line used to start the service is :
>>     java -jar start.jar ServiceStarter config/starter/start-service.config
>
>Not sure I understand and quite sure I dont know enough but you could
>start the whole thing in the same vm:
>
>String[] args = { "config/starter/start-service.config" };
>ServiceStarter.main(args);
>
>just mu tiny .02
>
>//R
>
>--------------------------------------------------------------------------
>Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
>Community Web Site:  http://jini.org
>jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
>Unsubscribing:       email "signoff JINI-USERS"  to [email protected]

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.