473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

RMI compiling error

kirara
19
Hello,

I am new to rmi and linux enviroment, I have been trying to test this code (java) on uinx where there
are three machines:
-One as a Controller
-an execution host
- a submitter

I do the following to run them:
- type "make" in all the machines to compile the all the java classes along with the remote objects.
- then run rmiregistry on all the machines
- then run the Controller class
- run the host class the reports to the Controller periodecally
- submit an application

the problem is when I run the Host class it gives me the following exceptions:
[user@machine1 code]$ java Host 10.70.50.99
Binding Report failed: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Report_Stub
Binding Runn failed: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Runn_Stub

I use jdk1.5 on all the machines althought the code is written with jdk1.4 is that affecting the compiling??
Apr 19 '07 #1
12 2924
JosAH
11,448 Expert 8TB
You should run the rmic compiler for the Runn and Report files. The compiler
generates stubs for those classes; store thos stubes in the classpaths on the
hosts that reported the Exceptions. btw, it has nothing to do with Java 1.4 or
Java 1.5. Very old versions of Java (1.2 or so) also needed skeleton files but
you don't need those anymore.

kind regards,

Jos
Apr 19 '07 #2
r035198x
13,262 8TB
You should run the rmic compiler for the Runn and Report files. The compiler
generates stubs for those classes; store thos stubes in the classpaths on the
hosts that reported the Exceptions. btw, it has nothing to do with Java 1.4 or
Java 1.5. Very old versions of Java (1.2 or so) also needed skeleton files but
you don't need those anymore.

kind regards,

Jos
Please don't remind us of the skeletons.
Apr 19 '07 #3
kirara
19
I have runned the rmic for both the Runn and the Report classes, and then I runned the Host class that uses those two but I am still getting the same
error...any thoughts?
Apr 19 '07 #4
kirara
19
I can see the the Runn_Stub.class and the Report_stub.class
but still the host class give me the same exceptions, does have to do with loading these stubs?
Apr 19 '07 #5
JosAH
11,448 Expert 8TB
Are those classes reachable through the classpath?

kind regards,

Jos
Apr 19 '07 #6
kirara
19
they are in same path as the Host class, but is there a way for me to check it?
Apr 19 '07 #7
JosAH
11,448 Expert 8TB
they are in same path as the Host class, but is there a way for me to check it?
Yup, I can't tell anything in detail from here but store those stub classes on
every single machine that is part of your experiment. Those classes should
be reachable through the machine's classpaths. It sould work then. Afterwards,
one by one remove the stubs and see which of your hosts need those stub
classes.

kind regards,

Jos
Apr 19 '07 #8
kirara
19
this is what I have done:
shell1:
ran the rmiregistry on all the machines
shell2:
ran the rmic for Report and Runn
shell3:
ran the host class
but now I have another exception:

Exception in thread "main" java.rmi.ConnectException: Connection refused to host: 10.70.50.99; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEnd point.java:574)
at sun.rmi.transport.tcp.TCPChannel.createConnection( TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCP Channel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:9 4)
at Report_Stub.init(Unknown Source)
at Host.main(HostDaemon.java:51)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl .java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSoc ketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.j ava:366)
at java.net.Socket.connect(Socket.java:516)
at java.net.Socket.connect(Socket.java:466)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:179)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.cre ateSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.cre ateSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEnd point.java:569)
... 5 more
Apr 19 '07 #9
JosAH
11,448 Expert 8TB
At least your JVMs found the stubs. The connection to the peer at the other
side of the wire refused the connection: either a fire wall problem or a wrong
IP address. Maybe another server isn't running? Start your processes at the
server side(s) then start your clients.

kind regards,

Jos

ps. if all else fails see if you can 'ping' the other side(s).
Apr 19 '07 #10
kirara
19
hi again I appreciate your replies,

I have runned the server side first(Controller class) then the client(Host class)
the stubs of the host class are found and the controller is working fine,
BUT the host class give me this exception:
Exception in thread "main" java.rmi.NotBoundException: Registrar
at sun.rmi.registry.RegistryImpl.lookup(RegistryImpl. java:106)
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknow n Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:375)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:1 53)
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:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:3 43)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:84)
at Host.main(HostDaemon.java:53),

the Registrar is a remote object in the Controller class and the Host class tries to look it up
Apr 19 '07 #11
kirara
19
I have a question, I am not sure but is rmiregistry for one machine should be the same as another one (I mean the classpath)?

I use this code to in the Host class to lookup the Registrar remote object of the other machine:

ri = (RegistrarInterface) Naming.lookup ("//" + args[0] + "/Registrar");
where args[0] is the IP of the other machine>>>should I specify the path
Apr 19 '07 #12
JosAH
11,448 Expert 8TB
I have a question, I am not sure but is rmiregistry for one machine should be the same as another one (I mean the classpath)?

I use this code to in the Host class to lookup the Registrar remote object of the other machine:

ri = (RegistrarInterface) Naming.lookup ("//" + args[0] + "/Registrar");
where args[0] is the IP of the other machine>>>should I specify the path
There's no need to specify a path there, i.e. the rmiregistry is just a naming
service, i.e. it associates (maps) a name to an object. The object is already
there (most of the times 'this') when the the rmiregistry registers it.

A registry operates on one host where objects are associated with a name.
Other hosts query that/those registries for remote objects. The stubs must
be present locally and reachable through the classpath.

kind regards,

Jos

ps. I think about this a bit more when I have some more spare time.
Come to think of it: does a VM on host A need a remote object from a VM
running on host B and vice versa?
Apr 19 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Martin Bless | last post by:
I need to access a MSSQL database (MS-Sql, not MySQL!)and would very much like to use mssql-0.09.tar.gz which is available from http://www.object-craft.com.au/projects/mssql/download.html ...
0
by: pruebauno | last post by:
Hello all, I am having issues compiling Python with large file support. I tried forcing the configure script to add it but then it bombs in the make process. Any help will be appreciated. ...
11
by: Arturo DiDonna | last post by:
Hello everyone. I am trying to compile someone else code and I am stuck with compilation problems using the g++ 3.3 compiler. Basically, when compiling the following code, I get this error...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
1
by: Jim Heavey | last post by:
Hello, trying to round out my knowlege here about compiling. To date I have used VS.Net to do all my compiling "majically", but I want to understand how to do it on my own, should the need ever...
1
by: Mike Hutton | last post by:
I need some help. I am trying to set up our development environment so as to make life easy for my fellow developers (none of whom have used ASP.NET or VS.NET before). We are developing our...
6
by: Josefo | last post by:
Hello all. I am a newbie following the C++ tutorial in : http://www.cplusplus.com/doc/tutorial/templates.html I am unable to succesfully compile any of the examples with templates of this...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
6
by: Cybex | last post by:
I am taking a C++ class and would like to use a Linux based IDE vs C+ + .Net but I am a little lost in how to go about this. I think that the IDE and compilation tools are separate under Linux. I...
2
by: renagade629 | last post by:
Can anybody help me understand what i'm doing wrong or what I'm missing? Is there anyother good and commendable C++ program I can use (free) from the internet like Dev C++? I'm having trouble doing...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.