greetings,
may someone have a hint as to what my problem may be and how to fix it.
here is what is happening. i have a an rmi application with linux
client (jdk 1.2) and solaris server (jdk 1.3). the client throws an
UnmarshalException. i could not figure out why it wa happening, so i
tried the rmi example from the "professional java server programming"
which also throws the unmarshal exception. the client ran fine on the
same solaris box where the server ran, so i tried the client from
another solaris host, also running jdk 1.3 - runs fine.
are there any issues with running my configuration? the details below.
tia.
server:
bash$ uname -rs
SunOS 5.6
bash$ java -version
java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O-release, 1.3beta-O-release,
interpreted mode)
bash$ cat ~/.java.security
grant {
permission java.io.FilePermission "/home/astromas/work/jaas/cert/-",
"read,write";
};
bash$ java -Djava.rmi.server.codebase=file:/home/astromas/work/rmi/
-Djava.security.policy=/home/astromas/.java.security
com/wrox/rmi/Reverse
Object bound
Linux client:
bash$ java -version
java version "1.2"
Classic VM (build Linux_JDK_1.2_pre-release-v2, native threads, sunwjit)
bash$ cat ~/.java.security
grant codebase "file:/home/ams/work/rmi/-" {
permission java.security.AllPermission;
};
grant {
permission java.net.SocketPermission "*:1024-65535",
"connect,resolve,accept";
};
bash$ java -Djava.security.policy=/home/ams/.java.security Client
java.rmi.UnmarshalException: error unmarshalling return; nested
exception is:
java.lang.ClassNotFoundException: com.wrox.rmi.Reverse_Stub
java.lang.ClassNotFoundException: com.wrox.rmi.Reverse_Stub
at java.io.ObjectInputStream.inputObject(Compiled Code)
at java.io.ObjectInputStream.readObject(Compiled Code)
at java.io.ObjectInputStream.readObject(Compiled Code)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Compiled Code)
at java.rmi.Naming.lookup(Compiled Code)
at Client.main(Compiled Code)
bash$
solaris client:
bash$ java -version
java version "1.3beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
Java(TM) HotSpot Client VM (build 1.3beta-O-release, 1.3beta-O-release,
interpreted mode)
bash$ cat ~/.java.security
grant codebase "file:/home/astromas/work/rmi/-" {
permission java.security.AllPermission;
};
grant {
permission java.net.SocketPermission "*:1024-65535",
"connect,resolve";
};
bash$ java -Djava.security.policy=/home/astromas/.java.security Client
DCBAbash$
client source:
bash$ cat *.java
//Client.java
import java.rmi.*;
import com.wrox.rmi.ReverseInterface;
public class Client {
public static void main(String[] args) {
try {
if (System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());
ReverseInterface ri = (ReverseInterface)
Naming.lookup("//ncnc-sun22.us.oracle.com/com.wrox.rmi.Reverse");
String r = ri.reverseString("ABCD");
System.out.print(r);
} catch (Exception e) {
e.printStackTrace();
}
}
}
//ReverseInterface.java
package com.wrox.rmi;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface ReverseInterface extends Remote {
String reverseString(String s) throws RemoteException;
}
server source:
//Reverse.java
package com.wrox.rmi;
import java.rmi.*;
import java.rmi.server.*;
public class Reverse extends UnicastRemoteObject implements
ReverseInterface {
public Reverse() throws RemoteException {
super();
}
public String reverseString(String s) throws RemoteException {
int n = s.length();
StringBuffer t = new StringBuffer(n);
for (int i = n; i > 0; i--)
t.append(s.substring(i-1, i));
return t.toString();
}
public static void main(String[] args) {
if (System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());
String name = "//ncnc-sun22.us.oracle.com/com.wrox.rmi.Reverse";
try {
Reverse r = new Reverse();
Naming.rebind(name, r);
System.out.println("Object bound");
} catch (Exception e) {
e.printStackTrace();
}
}
}
//ReverseInterface.java
package com.wrox.rmi;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface ReverseInterface extends Remote {
String reverseString(String s) throws RemoteException;
}
--
Aaron Stromas | "Tick-tick-tick!!!... ja, Pantani is weg..."
Oracle Corp | BRTN commentator
+1 703.708.68.21 | L'Alpe d'Huez
1995 Tour de France
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]