RMI "UnmarshalException" issue
Hi,
I am doing a sample RMI application in the following step by step process but in the *8th* step I am getting exception so please kindly resolve my issue.
Step-1: creating Service interface
AddServiceInterface.java
====================
import java.rmi.*;
public interface AddServiceInterface extends Remote
public int add(int a, int b) throws RemoteException;
Step-2: Compiling Service interface
D:\BAJI\Programs\JAVA\rmi\rmi_server>javac AddServiceInterface.java
D:\BAJI\Programs\JAVA\rmi\rmi_server>
Step-3: creating the Service interface implementation class
AddService.java
============
import java.rmi.*;
import java.rmi.server.*;
public class AddService extends UnicastRemoteObject implements AddServiceInterface
public AddService() throws Exception
public int add(int a, int b) throws RemoteException
return (a+b);
Step-4: Compiling the Service interface implementation class
D:\BAJI\Programs\JAVA\rmi\rmi_server>javac AddService.java
D:\BAJI\Programs\JAVA\rmi\rmi_server>
Step-5: Start the RMI service
1)openned a new command prompt and typed the following command
2)d:\> rmiregistry
Step-6: Create stub and skeleton classes
D:\BAJI\Programs\JAVA\rmi\rmi_server>rmic AddService
D:\BAJI\Programs\JAVA\rmi\rmi_server>
Step-7: Create RMI Server Application which export the Server object into Naming service
RMIServerApp.java
===============
import java.rmi.*;
public class RMIServerApp
public static void main(String[] args) throws Exception
AddServiceInterface asi = new AddService();
Naming.bind("rmi://localhost/as",asi);
System.out.println("\n\n***************** Registored into Naming Service ****************\n\n");
Step-8: Compiling & execute
D:\BAJI\Programs\JAVA\rmi\rmi_server>javac RMIServerApp.java
D:\BAJI\Programs\JAVA\rmi\rmi_server>java RMIServerApp
Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: AddServiceInterface
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
66)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at java.rmi.Naming.bind(Naming.java:111)
at RMIServerApp.main(RMIServerApp.java:8)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException: AddServiceInterface
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
66)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:707)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: AddServiceInterface
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 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 sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:7
07)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
28)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
m.java:238)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
... 9 more
Step-9: Create the client object file
RMIClient.java
===========
import java.rmi.*;
public class RMIClient
public static void main(String[] args) throws Exception
AddServiceInterface asi = (AddServiceInterface)Naming.lookup("rmi://localhost/as");
System.out.println(asi.add(10,20));
Thanks & Regards,
BSK
The registry cannot find the class named in the exception.
Similar Messages
-
Hi ,
I have the following error while i am stopping a Weblogic instance. Did anyone face a similar issue, please let me know. I see a classnotfound error , but not sure what is that jar file. Is it a application jar or a weblogic one?
Stopping Weblogic Server...
Initializing WebLogic Scripting Tool (WLST) ...
log4j: Trying to find [resources/comdev/default-log4j.properties] using context classloader java.net.URLClassLoader@183f74d.
log4j: Using URL [jar:file:/teamrule/10.2/modules/com.bea.cie.comdev_5.3.0.0.jar!/resources/comdev/default-log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL jar:file:/teamrule/10.2/modules/com.bea.cie.comdev_5.3.0.0.jar!/resources/comdev/default-log4j.properties
log4j: Hierarchy threshold set to [ALL].
log4j: Parsing for [root] with value=[INFO, NA].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "NA".
log4j: Parsed "NA" options.
log4j: Finished configuring.
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Connecting to t3://localhost:7009 with userid weblogic ...
This Exception occurred at Sun Apr 10 14:17:03 UTC 2011.
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested excep
tion is:
java.lang.ClassNotFoundException: Failed to load class com.msl.security.providers.SessionPrincipal]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:32)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:673)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:466)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:373)
... 48 more
Problem invoking WLST - Traceback (innermost last):
File "/web/10.2/user_projects/domains/dom/shutdown.py", line 1, in ?
File "<iostream>", line 22, in connect
WLSTException: 'Error occured while performing connect : Error getting the initial context. There is no server running at t3://localhost:7009 Use dumpStac
k() to view the full stacktrace'
Thanks a lot for your time.
ManishHi Manish,
It seems that you are using a custom security provider and the weblogic server is not able to find the class / jar file that contains the class.
java.lang.ClassNotFoundException: Failed to load class com.msl.security.providers.SessionPrincipal]
Make sure you have all the required jar files in the server classpath.
You can use the JarScan utility to find the jar that contains the class.
Refer the below link regarding the jarScan.
http://weblogic-wonders.com/weblogic/2011/01/26/finding-jar-files-using-jarscan/
Regards,
Anandraj
http://weblogic-wonders.com -
Hi ,
I have the following error while i am stopping a Weblogic instance. Did anyone face a similar issue, please let me know. I see a classnotfound error , but not sure what is that jar file. Is it a application jar or a weblogic one?
Stopping Weblogic Server...
Initializing WebLogic Scripting Tool (WLST) ...
log4j: Trying to find [resources/comdev/default-log4j.properties] using context classloader java.net.URLClassLoader@183f74d.
log4j: Using URL [jar:file:/teamrule/10.2/modules/com.bea.cie.comdev_5.3.0.0.jar!/resources/comdev/default-log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL jar:file:/teamrule/10.2/modules/com.bea.cie.comdev_5.3.0.0.jar!/resources/comdev/default-log4j.properties
log4j: Hierarchy threshold set to [ALL].
log4j: Parsing for [root] with value=[INFO, NA].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "NA".
log4j: Parsed "NA" options.
log4j: Finished configuring.
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Connecting to t3://localhost:7009 with userid weblogic ...
This Exception occurred at Sun Apr 10 14:17:03 UTC 2011.
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested excep
tion is:
java.lang.ClassNotFoundException: Failed to load class com.msl.security.providers.SessionPrincipal]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:32)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:673)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:466)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:373)
... 48 more
Problem invoking WLST - Traceback (innermost last):
File "/web/10.2/user_projects/domains/dom/shutdown.py", line 1, in ?
File "<iostream>", line 22, in connect
WLSTException: 'Error occured while performing connect : Error getting the initial context. There is no server running at t3://localhost:7009 Use dumpStac
k() to view the full stacktrace'
Thanks a lot for your time.
ManishHi Manish,
It seems that you are using a custom security provider and the weblogic server is not able to find the class / jar file that contains the class.
java.lang.ClassNotFoundException: Failed to load class com.msl.security.providers.SessionPrincipal]
Make sure you have all the required jar files in the server classpath.
You can use the JarScan utility to find the jar that contains the class.
Refer the below link regarding the jarScan.
http://weblogic-wonders.com/weblogic/2011/01/26/finding-jar-files-using-jarscan/
Regards,
Anandraj
http://weblogic-wonders.com -
Every thing works just fine as both the Client and server runs on the same system,, but as i run one of them on a remote m/c,well i am using vmware for that, Client is not able to locate server's stub and server is not able to locate clients classes for dynamic loading..
I am sure its an issue with the way i set the codebase url's but how should i change them.
presently, i set them as
file:/E:/surshikradmin/workspace/rmi-server/bin/ for server..
and kind of same way for client.. should i add the host name too,,but how??? Any help would be highly helpful since its been years i am dealing with issue and solving it will make ma project go rock..
Client side stack trace if it coul help!
Computeappengine exceptionerror unmarshalling return; nested exception is: java.lang.ClassNotFoundException: Engine.ComputeappEngine_Stub java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: Engine.ComputeappEngine_Stub at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source) at Client.computeappprog.main(computeappprog.java:23) Caused by: java.lang.ClassNotFoundException: Engine.ComputeappEngine_Stub at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:432) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:163) at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620) at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247) at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) ... 2 moreCrossposted and answered here
-
Please, help in RMI UnmarshalException: nested exception is: EOFException
Good day,
I have a problem in sample program, similar like an Oracle oriinal in "Getting Started Usin Java RMI", identically on server and client sides. It correctly works in NetBeans IDE, but never alone, as JAR archive or java class, if I used java -jar or java -classpath command-line form. Fragment of the server code includes final check on correct read from remote object, it corrrectly works within NetBeans but cause UnmarshalException in same server side in independent launch form (WeatherBean - sample object, contains points to information about city name, weather description, temperathure an small "weather" icon, WeatherService - interface with one getWeatherInformation() function):
String serverObjectName = "WeatherService";
final int remotePort = 1099;
final String remoteHost = "localhost";
Registry registry = LocateRegistry.getRegistry(remoteHost);
WeatherService remoteObject = (WeatherService)
UnicastRemoteObject.exportObject(service, 0);
registry.rebind(serverObjectName, remoteObject);
//control export output
java.util.List<WeatherBean> list =
service.getWeatherInformation();
for (int i = 0; i < list.size(); i++) {
WeatherBean wb = list.get(i);
service.addTextWeatherString(wb.getCityName() + " " +
wb.getDescription() + " " + wb.getTemperature());
//back read exported object (cause error)
String[] regArr = registry.list();
java.util.List<String> regList = Arrays.asList(regArr);
if (regList.contains(serverObjectName)) {
Remote remote = registry.lookup(serverObjectName);
if (Proxy.isProxyClass(remote.getClass())) {
Proxy proxy = (Proxy) remote;
InvocationHandler invocationHandler =
Proxy.getInvocationHandler(proxy);
WeatherService weatherService = (WeatherService)
Proxy.newProxyInstance(
WeatherService.class.getClassLoader(),
new Class[] { WeatherService.class },
invocationHandler);
list = weatherService.getWeatherInformation();
for (int i = 0; i < list.size(); i++) {
WeatherBean wb = list.get(i);
service.addTextWeatherString(wb.getCityName() + " " +
wb.getDescription() + " " + wb.getTemperature());
}Starts with form java -jar WeatherServiceProj.jar (my project name) cause this error:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.io.EOFException
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:173)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
at $Proxy0.getWeatherInformation(Unknown Source)
at deitel.rmi.weather.server.WeatherServiceImpl.main(WeatherServiceImpl.java:381)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:375)
at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2775)
at java.io.ObjectInputStream.readInt(ObjectInputStream.java:949)
at javax.swing.ImageIcon.readObject(ImageIcon.java:441)
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:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at java.util.ArrayList.readObject(ArrayList.java:593)
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:597)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:155)
... 4 moreI try to use many forms of java -Dxxxx keys, such as -Djava.rmi.server.codebase or -Djava.rmi.security.policy, but it does not help. Maybe i don't know something else? Key or sustem property, e. g.?
Great thanks for some little help,
Jaroslav
Edited by: EJP on 5/10/2011 20:21: added {noformat}{noformat} tags: please use them.Sweta,
Is this a java mapping or Graphical, If Java, you should not run into this issue as you dont load the nested XSD`s.
Also the error message indicates outofMemory in mercator side when posting your Large message.
java.lang.OutOfMemoryError at com.philips.xi.mercator.MercatorCall.execute(MercatorCall.java:90) at
Regards
Ravi Raman
Edited by: Ravi Raman on Jun 30, 2010 4:26 PM -
Java.rmi.UnmarshalException: skeleton class not found but required for clie
Hello everyone,
I am new to RMI and getting a strange exception. I am using Java 1.5.0_07 both on client and server. They are running on the same machine, the rmi registry is started inside the server application.
I am wondering why java complains about skeletons, I thought they are automatically created when using java 5.0?
Please have a look at the stacktrace below.
Thank you for your help.
Best Regards
Patric
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling call header; nested exception is:
java.rmi.UnmarshalException: skeleton class not found but required for client version
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
sun.rmi.transport.Transport$1.run(Transport.java:153)
java.security.AccessController.doPrivileged(Native Method)
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
java.lang.Thread.run(Thread.java:595)
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
java.rmi.Naming.lookup(Naming.java:84)
org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)The full class path information that I can gather is as follows (some of the library path locations could be suspect...):
Class path: /edge/node3/hotfix::/edge/node3/current/lib/JMdsApi.jar:/edge/node3/current/lib/MemoryProfilingAgent.jar:/edge/node3/current/lib/T2common-2.6.0-SNAPSHOT.3200.jar:/edge/node3/current/lib/T2scripting-jython.jar:/edge/node3/current/lib/activation.jar:/edge/node3/current/lib/alib.jar:/edge/node3/current/lib/alibom.jar:/edge/node3/current/lib/ant.jar:/edge/node3/current/lib/authapi.jar:/edge/node3/current/lib/bbdlapi.jar:/edge/node3/current/lib/bcpg-jdk15-136.jar:/edge/node3/current/lib/bcprov-jdk15-136.jar:/edge/node3/current/lib/c3p0-0.9.1.2.jar:/edge/node3/current/lib/castor-1.1-codegen-anttask.jar:/edge/node3/current/lib/castor-1.1-codegen.jar:/edge/node3/current/lib/castor-1.1-xml.jar:/edge/node3/current/lib/castor-1.1.jar:/edge/node3/current/lib/colt-1.2.0.jar:/edge/node3/current/lib/common-annotations.jar:/edge/node3/current/lib/commons-beanutils.jar:/edge/node3/current/lib/commons-codec-1.3.jar:/edge/node3/current/lib/commons-collections-3.2.1.jar:/edge/node3/current/lib/commons-jexl-1.1.jar:/edge/node3/current/lib/commons-lang-2.3.jar:/edge/node3/current/lib/commons-logging-1.1.1.jar:/edge/node3/current/lib/commons-net-1.4.1.jar:/edge/node3/current/lib/dsn.jar:/edge/node3/current/lib/eagleapi.jar:/edge/node3/current/lib/ezmorph-1.0.3.jar:/edge/node3/current/lib/f2-loader-1.8.jar:/edge/node3/current/lib/fasttrade-boviewer-1.0.1.jar:/edge/node3/current/lib/hsqldb.jar:/edge/node3/current/lib/icu4j-3.4.4.jar:/edge/node3/current/lib/ivy.jar:/edge/node3/current/lib/janino.jar:/edge/node3/current/lib/janus-sdk-1.7.0.0.jar:/edge/node3/current/lib/jasypt-1.4.1.jar:/edge/node3/current/lib/javolution.jar:/edge/node3/current/lib/jcalendar-1.3.2.jar:/edge/node3/current/lib/jcl-over-slf4j-1.5.6.jar:/edge/node3/current/lib/jcommon-1.0.9.jar:/edge/node3/current/lib/jconn2.jar:/edge/node3/current/lib/jconn3-6.05-b26214.jar:/edge/node3/current/lib/jdom.jar:/edge/node3/current/lib/jfreechart-1.0.5.jar:/edge/node3/current/lib/jgroups-all.jar:/edge/node3/current/lib/jline.jar:/edge/node3/current/lib/jmkv123p1.jar:/edge/node3/current/lib/jna.jar:/edge/node3/current/lib/joda-time-1.5.2.jar:/edge/node3/current/lib/jscience.jar:/edge/node3/current/lib/json-lib-2.2.1-jdk15.jar:/edge/node3/current/lib/jul-to-slf4j-1.5.6.jar:/edge/node3/current/lib/junit.jar:/edge/node3/current/lib/jython.jar:/edge/node3/current/lib/log4j-1.2.15.jar:/edge/node3/current/lib/log4j-over-slf4j-1.5.6.jar:/edge/node3/current/lib/loggablePreparedStatement-1.6.jar:/edge/node3/current/lib/looks-2.1.4.jar:/edge/node3/current/lib/mailapi.jar:/edge/node3/current/lib/model-12021.jar:/edge/node3/current/lib/mysql-connector-java-5.1.7-bin.jar:/edge/node3/current/lib/opencsv-1.8.jar:/edge/node3/current/lib/rfa.jar:/edge/node3/current/lib/rspcore.jar:/edge/node3/current/lib/slf4j-api-1.5.6.jar:/edge/node3/current/lib/slf4j-log4j12-1.5.6.jar:/edge/node3/current/lib/smtp.jar:/edge/node3/current/lib/smtphandler-0.6.jar:/edge/node3/current/lib/spring-2.5.2.jar:/edge/node3/current/lib/statsvn.jar:/edge/node3/current/lib/swingx-0.9.3.jar:/edge/node3/current/lib/t2-12021.jar:/edge/node3/current/lib/testng-5.9-jdk15.jar:/edge/node3/current/lib/tibmsg.jar:/edge/node3/current/lib/tibrvj.jar:/edge/node3/current/lib/trove.jar:/edge/node3/current/lib/velocity-tools.jar:/edge/node3/current/lib/velocity.jar:/edge/node3/current/lib/xalan.jar:/edge/node3/current/lib/xerces.jar:/edge/node3/current/lib/patng/activeio-core-3.0.0-incubator.jar:/edge/node3/current/lib/patng/activemq-core-4.1.1.jar:/edge/node3/current/lib/patng/avalon-framework-4.1.3.jar:/edge/node3/current/lib/patng/backport-util-concurrent-2.2.jar:/edge/node3/current/lib/patng/binding-1.4.0.jar:/edge/node3/current/lib/patng/cglib-nodep-2.1_3.jar:/edge/node3/current/lib/patng/common-1.30.jar:/edge/node3/current/lib/patng/commons-cli-1.0.jar:/edge/node3/current/lib/patng/commons-configuration-1.2.jar:/edge/node3/current/lib/patng/commons-discovery-0.2.jar:/edge/node3/current/lib/patng/commons-math-1.1.jar:/edge/node3/current/lib/patng/concurrent-1.3.4.jar:/edge/node3/current/lib/patng/geronimo-j2ee-management_1.0_spec-1.0.jar:/edge/node3/current/lib/patng/geronimo-jms_1.1_spec-1.0.jar:/edge/node3/current/lib/patng/logkit-1.0.1.jar:/edge/node3/current/lib/patng/mina-core-1.0.1.jar:/edge/node3/current/lib/patng/mina-filter-ssl-1.0.1.jar:/edge/node3/current/lib/patng/mina-java5-1.0.1.jar:/edge/node3/current/lib/patng/mx4j-remote-3.0.1.jar:/edge/node3/current/lib/patng/mx4j-tools-3.0.1.jar:/edge/node3/current/lib/patng/org.apache.felix.framework-1.0.0.jar:/edge/node3/current/lib/patng/org.osgi.core-1.0.0.jar:/edge/node3/current/lib/patng/pat-dt-common-1.18.jar:/edge/node3/current/lib/patng/pat-sdt-1.18.jar:/edge/node3/current/lib/patng/patNg-api-1.27.1.jar:/edge/node3/current/lib/patng/patNg-server-aoc-1.21.jar:/edge/node3/current/lib/patng/patNg-server-common-1.21.jar:/edge/node3/current/lib/patng/patNg-server-session-manager-1.21.jar:/edge/node3/current/lib/patng/patNg-utils-1.27.1.jar:/edge/node3/current/lib/patng/qpid-broker-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-client-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-common-2.2.2.0.jar:/edge/node3/current/lib/patng/qpid-mina-core-2.2.2.0.jar:/edge/node3/current/lib/patng/rsee-2.11.jar:/edge/node3/current/lib/patng/servlet-api-2.3.jar:/edge/node3/current/lib/patng/silk-1.3.jar:/edge/node3/current/lib/patng/slf4j-api-1.4.0.jar:/edge/node3/current/lib/patng/slf4j-log4j12-1.4.0.jar:/edge/node3/current/lib/patng/validation-1.2.0.jar
Boot class path: /apps/jdk/1.6.0_13/linux/jre/lib/resources.jar:/apps/jdk/1.6.0_13/linux/jre/lib/rt.jar:/apps/jdk/1.6.0_13/linux/jre/lib/sunrsasign.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jsse.jar:/apps/jdk/1.6.0_13/linux/jre/lib/jce.jar:/apps/jdk/1.6.0_13/linux/jre/lib/charsets.jar:/apps/jdk/1.6.0_13/linux/jre/classes:/tmp/yjp200811122006.jar
Library path: /apps/jdk/1.6.0_13/linux/jre/lib/i386/server:/apps/jdk/1.6.0_13/linux/jre/lib/i386:/apps/jdk/1.6.0_13/linux/jre/../lib/i386::/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/edge/node3/current/lib:/home/eqdev/eqedgeuat/yourkit_7_5_11/yjp-7.5.11/bin/linux-x86-32:/usr/java/packages/lib/i386:/lib:/usr/lib -
RMI Problem -- java.rmi.UnmarshalException:
I am having a client and a server.... when i am trying to bring the client into server. but when i am doing it... i am getting an exception as below as...
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(Unknown Source)
... 60 more
can any one help me out to solve this problem.......Thanks for ur reply...Now i' m getting the access denied problem..
I am able to create the rmi registry successfully on the server, Then Binding is also done successfully. but when i try to connect the client to the server the exception is thrown Please help me..
TEST - client PC name.
java.security.AccessControlException: access denied (java.net.SocketPermission TEST resolve)
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.checkConnect(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at java.net.InetSocketAddress.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source) -
RMI UnmarshalException Occurs after some time
Hi,
I have a client server application that talks via rmi. My client saves data to a server or gets data by passing in parameters that include string, boolean and a Hashtable. The data is saved and retrieved many times. However, after some time, the RMI can't even find the method. That is, the client calls a method and I get a unmarshalling exception from the client, basically stating that it can't find the method.
Here is the method in my interface, the method in question is the override method, the getLast works fine all the time:
public interface Admin extends Remote
Hashtable getLast(Hashtable setLashtHash) throws RemoteException;
//override method can query or set a new data in the form of a hashtable. It return a Hashtable or null
Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException;
Here's the implementation of override:
synchronized public Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException
try{
if(setNew)
if(newOverride!=null)
System.out.println("Saving override hash, entries=" + newOverride.size());
overrideHash=newOverride;
else if(getOverrideHash)
if(overrideHash!=null)
System.out.println("Getting override hash entries=" + overrideHash.size());
return overrideHash;
else
if(getLast)
if(overrideHash==null)
System.out.println("override hash is null");
return null;
OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
if(os.last!=null)
System.out.println("Last price for ticker " + ticker + " is=" +os.last);
Float last=os.last;
return last;
return null;
else if(getPrevious)
if(overrideHash==null)
return null;
OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
if(os.previous!=null)
Float previous=os.previous;
return previous;
return null;
}catch(Exception e)
System.out.println("Unknown Exception caught in override function");
e.printStackTrace();
return null;
Here is the exception, please help.
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: invalid method hash
java.rmi.UnmarshalException: invalid method hash
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at AdminImpl_Stub.override(Unknown Source)
at StocksTable$12.run(stockstable.java:481)
Please help,
Thanks SteveBy the way, this is how my server calls the client:
Hashtable otable=(Hashtable)a1.override(false,new String(""),true,false,false,new Hashtable()); -
RMI: UnmarshalException, can't find method after some time.
Hi,
I have a client server application that talks via rmi. My client saves data to a server or gets data by passing in parameters that include string, boolean and a Hashtable. The data is saved and retrieved many times. However, after some time, the RMI can't even find the method. That is, the client calls a method and I get a unmarshalling exception from the client, basically stating that it can't find the method.
Here is the method in my interface, the method in question is the override method, the getLast works fine all the time:
public interface Admin extends Remote
Hashtable getLast(Hashtable setLashtHash) throws RemoteException;
//override method can query or set a new data in the form of a hashtable. It return a Hashtable or null
Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException;
Here's the implementation of override:
synchronized public Object override(boolean setNew, String ticker, boolean getOverrideHash,boolean getLast, boolean getPrevious,Hashtable newOverride) throws RemoteException
try{
if(setNew)
if(newOverride!=null)
System.out.println("Saving override hash, entries=" + newOverride.size());
overrideHash=newOverride;
else if(getOverrideHash)
if(overrideHash!=null)
System.out.println("Getting override hash entries=" + overrideHash.size());
return overrideHash;
else
if(getLast)
if(overrideHash==null)
System.out.println("override hash is null");
return null;
OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
if(os.last!=null)
System.out.println("Last price for ticker " + ticker + " is=" +os.last);
Float last=os.last;
return last;
return null;
else if(getPrevious)
if(overrideHash==null)
return null;
OverrideStruct os=(OverrideStruct)overrideHash.get(ticker);
if(os.previous!=null)
Float previous=os.previous;
return previous;
return null;
}catch(Exception e)
System.out.println("Unknown Exception caught in override function");
e.printStackTrace();
return null;
Here is the exception, please help. Does anyone know why the exception is "invalid method hash"? I don't understand why it's saying that, I am calling method override(....).
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: invalid method hash
java.rmi.UnmarshalException: invalid method hash
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at AdminImpl_Stub.override(Unknown Source)
at StocksTable$12.run(stockstable.java:481)
Please help,
Thanks SteveBy the way, this is how my server calls the client:
Hashtable otable=(Hashtable)a1.override(false,new String(""),true,false,false,new Hashtable()); -
Hi Guys,
I currently have an application using RMI and every now and then receive the following error:
java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.net.SocketException: Connection reset
My RMI connection between the client and server is then disconnected. At the moment I have implemented
a heart beat type arrangement to know when the connection has died, and to reconnect it. This solution is just temporary until I am able to fix the real problem.
I have been doing alot of searching to try and find the problem but have been unsuccesful in finding the problem / solution. Seems many people get this kind of problem.
Can anyone help me out ?
Cheers ... Gregg.Hi ,
Le' me give u some hints ................
@ Check the java.policy file for the permissions and make the changes.........where u need to add permissions....
permission java.net.SocketPermission "<hostname>:<portno>-", "listen, connect, accept, resolve";
and few more things.
@ An UnmarshalException can be thrown while unmarshalling the parameters or results of a remote method call if any of the following conditions occur: if an exception occurs while unmarshalling the call header if the protocol for the return value is invalid if a java.io.IOException occurs unmarshalling parameters (on the server side) or the return value (on the client side).
Did this solve ur problem.
Rave. -
Java.rmi.UnmarshalException:
hai,
I am facing a problem in rmi , when running my RMI server program, I am a beginner to this area, earlier it was working and i got the output, i didnt change anything, i used three windows to test my program, one for rmiregistry, another for running the server and other for running the client.
But when i execute server, after two seconds i got the following error,
Trouble java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.net.SocketException: Connection reset
please help me to solve this.
rajesh kumarI am a beginner to this area, earlier
it was working and i got the output, i didnt change
anythingevidently, you did, or it would still be working -
RemoteException: java.rmi.UnmarshalException in jdk 1.4.2
i'm implementing an RMI over the jdk 1.4.2 (can't do it in the 1.5 or 1.6) i've seen this topic [http://forum.java.sun.com/thread.jspa?threadID=370196&messageID=1808449] but it didn't help me, or i'm doing something wrong...
i know the RMI code is ok because it runs on java 1.6 (with the automatic generation of stubs and skeletons) but when i change the platform to 1.4 it throws the exception:
RemoteException: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: servidor.MensageiroImpl_Stub
the VM is configured to use the -Djava.security.policy=C:\Projecto\Policy\permissions.policy both in the client and server
please help me :S i've been burning my head with this for 3 days
i leave my code here:
The interface:
package rmiinterface;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Mensageiro extends Remote {
public void sendMsg(String msg) throws RemoteException;
public String readMsg() throws RemoteException;
}the implementation:
package servidor;
import rmiinterface.Mensageiro;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class MensageiroImpl extends UnicastRemoteObject implements Mensageiro {
public MensageiroImpl() throws RemoteException {
super();
public void sendMsg(String msg) throws RemoteException {
System.out.println(msg);
public String readMsg() throws RemoteException {
return "This is not a Hello World! message";
}the server:
package servidor;
import rmiinterface.Mensageiro;
import java.rmi.Naming;
import java.rmi.RMISecurityManager;
public class MensageiroServer {
public MensageiroServer() {
System.setSecurityManager(new RMISecurityManager());
try {
Mensageiro m = new MensageiroImpl();
java.rmi.registry.LocateRegistry.createRegistry(1099);
System.out.println("RMI registry successfully initiated");
Naming.rebind("MensageiroService", m);
System.out.println("Servidor Online");
} catch (Exception e) {
System.out.println("Trouble: " + e.getMessage());
public static void main(String[] args) {
new MensageiroServer();
}and the client:
package cliente;
import rmiinterface.Mensageiro;
import java.rmi.RMISecurityManager;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.NotBoundException;
import java.net.MalformedURLException;
public class MensageiroClient {
public MensageiroClient() {
public static void main(String args[]) {
System.setSecurityManager(new RMISecurityManager());
try {
Mensageiro m = (Mensageiro) Naming.lookup("//localhost/MensageiroService");
System.out.println(m.readMsg());
m.sendMsg("Hello World!");
} catch (MalformedURLException e) {
System.out.println();
System.out.println("MalformedURLException: " + e.toString());
} catch (RemoteException e) {
System.out.println();
System.out.println("RemoteException: " + e.toString());
} catch (NotBoundException e) {
System.out.println();
System.out.println("NotBoundException: " + e.toString());
} catch (Exception e) {
System.out.println();
System.out.println("Exception: " + e.toString());
}NOTE: my IDE is Netbeans 6.1. and the client and server are in diffrent projects
thanks in advance
Best Regards,
Carlos Daniel Ribeirothe stub and the skeleton are being generated, and they are there, in the server project! i don't know why the class defs for the stub filearen't downloded by the client project...I don't know why you think they will be downloaded. They won't be, unless you're using the codebase feature. The client needs the remote interface and the stub on its classpath, and all classes that the remote interface depends on, and so on recursively until closure. You have to do something about that.
It works under 1.6 because it doesn't need the stub at all. -
New @ RMI need help with java.rmi.UnmarshalException: error unmarshalling
Hi @ all out there,
I'm new with Java RMI and have to write a EventSystem for an college project where clients can subscribe to a topic and get notified when someone publishes a message to the subscribed topic.
At server-side I have a class called EventSystem that provides methods for subscribing and unsubscribing from topics, and also for posting messages (for publishers).
To subscribe i thought that the client must specify the topic and also itself ( means that a client calls in this way: obj.subscribe("mytopic", this).
The EventSystem handles a list of all clients, and whenever a new message is posted it goes trough all clients and invokes the handleMessage(String msg) method that all Clients have to provide.
On my local machine without RMi this concept works just great.
I now tried to get it working using RMI , but I get the following Exception when starting the client (the server starts fine) :
Looking up for rmiregistry at 138.232.248.22:1099
Subscriber exception:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:336)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
at $Proxy0.subscribe(Unknown Source)
at SubscriberImpl.main(SubscriberImpl.java:48)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:293)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.InvalidClassException: SubscriberImpl; SubscriberImpl; class invalid for deserialization
at java.io.ObjectStreamClass.checkDeserialize(ObjectStreamClass.java:713)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1733)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:306)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:290)
... 9 more
Caused by: java.io.InvalidClassException: SubscriberImpl; class invalid for deserialization
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:587)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
... 13 moreI googled now for 2 hours but can't resolve the problem alone. As far as I can understand I have to serialize Objects that I want to send to the server, right?
So how can i do this? I've never used serialization till now.
any ideas how to solve this problem?
greets from italy and sorry for my very weak english
bd_italyA class has been modified after deployment. Stop the Registry, clean, recompile, and redeploy.
-
JSP client in RMI system - java.rmi.UnmarshalException: error unmarshalling
Hi,
Im developing a login part for a distributed airline reservation system using JSP as the client but while executing the jsp, the error that is being catched is :
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: AirlineImpl_Stub (no security manager: RMI class loader disabled)
Here are my codes:
//Interface - Airline.java
package Air;
import java.rmi.*;
public interface Airline extends Remote
public int CheckUname(String username) throws RemoteException;
}//implementation - AirlineImpl.java
import java.net.*;
import java.io.*;
import java.sql.*;
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class AirlineImpl extends UnicastRemoteObject implements Airline
public AirlineImpl() throws RemoteException
super();
public int CheckUname(String username) throws RemoteException
try
int UnameCount = 0;
String xxx = "eaglebeta";
if(username.equals(xxx)
UnameCount++;
return UnameCount;
catch (Exception e3)
System.out.println("Error: " + e3);
return 0;
}//Server - AirlineServer.java
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
public class AirlineServer
public static void main(String arg[])
try
Airline myAirline = new AirlineImpl();
Naming.rebind("Airline", myAirline);
System.out.println();
System.out.println("************************************");
System.out.println(" >>> Airline Reservation System <<< ");
System.out.println(" >>> Server is Listening! <<< ");
System.out.println("************************************");
System.out.println();
catch (RemoteException e)
//System.out.println("Error: " + e);
System.out.println("RMI Registry is not active!");
System.out.println("Activate RMI Registry and retry!");
System.out.println("Bye bye, exiting...");
catch (java.net.MalformedURLException e)
//System.out.println("URL Error: "+ e);
System.out.println("URL Malformed!");
System.out.println("Bye bye, exiting...");
}//JSP client - newuser.jsp
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.rmi.*, javax.servlet.*" %>
<%@ page import="java.util.*, java.lang.*, java.io.*, Air.Airline" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#99CCFF">
<%
Object Airline = null;
try
Airline Air = (Airline)Naming.lookup("rmi://localhost/Airline");
String Name = "eaglebeta";
if(Air.CheckUname(Name)>0)
%>
Username already exists, choose another name
<%
else
%>
<%=Name%>
<%
catch (Exception e1)
%>
<%=e1%>
<%
%>
</body>
</html>The server, implementation, interface and stub are in a folder named "Airline Server" located on my desktop.
The interface and stub again are in another folder named "Air" located in the "classes\Air" directory which is located in the tomcat 5.5 installation directory!
The JSP client is located in the "Root" folder in the tomcat 5.5 installation derectory!
1. I start the registry in the "Airline Server" folder by typing rmiregistry
2. Load the Airline Server - java AirlineServer
3. Call the jsp - http://localhost/newuser.jsp
And i get the following error:
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: AirlineImpl_Stub (no security manager: RMI class loader disabled)
Please help me to solve this problem!When I am including security manager in my JSP code, the browser just get blank without any display
if(System.getSecurityManager() == null)
System.setProperty("java.security.policy", "java.policy");
System.setSecurityManager(new RMISecurityManager());
}Please, someone solve my problem! Im realy stuck and I don't know how to proceed! Provide me with a solution or any tutorial that would help me... -
Java.rmi.UnmarshalException: Error unmarshaling return header
Hi,
We are running an RMI server instance to serve data ( from memory) to clients. It works fine if fewer number of inquiries goes in. But when the number of inquiries are larger, I am getting some exceptions at the client side. The server crashes without throwing any exceptions. Following are the exceptions received at client side:
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.net.SocketException: Connection reset
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:203)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at com.emf1.dataserver.KeyFrequencyKeeper_Stub.getDUNSCounts(Unknown Source)
at com..match.KeyFrequencyKeeperProxy.getKeyKQSs(KeyFrequencyKeeperProxy.java:307)
at com.emf1.match.KeyGenerator.generateKeys(KeyGenerator.java:453)
at com.emf1.match.InquiryProcessor.run(InquiryProcessor.java:870)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
at java.io.DataInputStream.readByte(DataInputStream.java:331)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:189)
... 6 more
The period of time, the server keeps on running (before it crashes) is also not the same. Sometimes it works fine without any problem. But most of the time the server crashes after processing some records.
I don't know why this is happening.
Please help...
Thanks in advance..I have this error too when I running my rmi server site program.
I am running it in Linux Environment.
Anyone got any idea about this?
Maybe you are looking for
-
How can I change the tempo of a single track?
Hi, I've been struggling with finding a way to change the BPM of a single track. There are three tracks and only one of them needs to be sped up. When I try using the flex editor, it is too complicated for what I am trying to do. Is there any more co
-
NW BI-JAVA 7.01 SP6 deployment failed with error main_rules.ept
Dear all, I've installed a new Web AS JAVA instance 7.01 SR1 with usage type BI-JAVA I then patched this instance with SP6 At the end of the deployment process, I got a message from JSPM stating that the deployment failed but all the components had t
-
CAN SOMEONE PLEASE HELP? WE ARE NOT ALL TECHOGEEKS...
I recant my previous post saying I had no problems. I have five email addresses. ALL are used and are important to me; three are linked to business websites and have stationery printed. I CANNOT AFFORD TO CHANGE ALL THESE. All are used via MS outloo
-
Hey I just don't understand why I can't get my songs to carry their artwork from my iTunes library to my iPod. Its great that we don't get that error 50 message anymore when disconnecting the iPod and checking the box from artwork, but even when it i
-
Plant specific material variant
Hi Forum, Has anybody downloaded plant specific material variant from R/3 to CRM. Please advise. Regards,