Discussion:
java.rmi.UnmarshalException
liang li
2008-05-13 12:26:10 UTC
Permalink
hi, all

when i developed a jini program, i met i big problem, like this:
java.rmi.UnmarshalException: error unmarshalling return; nested exception
is:
java.lang.ClassNotFoundException:
com.wri.hy.onecgs.jini.service.logging.Log4JiniImpl
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:120)
at
com.wri.hy.onecgs.jini.test.TestLogService.searchServiceItem(TestLogService.java:55)
at
com.wri.hy.onecgs.jini.test.TestLogService.<init>(TestLogService.java:73)
at com.wri.hy.onecgs.jini.test.TestLogService.main(TestLogService.java:109)
Caused by: java.lang.ClassNotFoundException:
com.wri.hy.onecgs.jini.service.logging.Log4JiniImpl
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
at net.jini.loader.ClassLoading.loadClass(ClassLoading.java:138)
at net.jini.io.MarshalInputStream.resolveClass(MarshalInputStream.java:296)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
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)
... 3 more


what i did is:
1 design a interface class
2 implement the interface class
3 coding a jini service
4 build these java file
5 run rmic to produce a stub
6 rmiregistry(is needed?),launch all jini service and the new service(using
jini browser i can saw this service)
7 run client on another pc
8 exception above is throwed.
(my service and client run on the same pc, everything is OK)

could you tell me what is wrong?

best regards

byron lee

--------------------------------------------------------------------------
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 ***@java.sun.com
Gregg Wonderly
2008-05-13 15:13:13 UTC
Permalink
Post by liang li
hi, all
java.rmi.UnmarshalException: error unmarshalling return; nested
com.wri.hy.onecgs.jini.service.logging.Log4JiniImpl
With all RMI/Jini based client/server applications, you are typically using some
type of mobile code. Typically that mobile code, is based on the
parameterization of your interface methods. That is, the values that your
interface's methods require you to provide when calling, and the values that you
get back as results.

For example

public interface MyInterface extends Remote {
public Results getSomeWorkDone( WorkItem item ) throws RemoteException;
}

will typically (I am skipping smart proxies with custom
marshalling/unmarshalling here) require that the "Results" class/interface
implementation and the WorkItem class/interface implementation be classes that
both the client and the server know about.

One of the primary considerations of mobile code is to minimize the need of the
client to "have" all types, but instead to "have" interface types, and download
implementations that the server returns to it.

The most predominate example is that if your client was looking for a service
that implemented "MyInterface", shown above, that it would download the code for
that service implementation so that it would always get the most up to date
implementation (bug fixes etc).

To facilitate that, you need to provide a "codebase" setting for your service
using the RMIClassLoaderSPI provisions in the JVM. This is done automatically
for you, if you follow the steps that the Jini starter kit documentation, or the
RMI examples (you seem to be using Jini 1.2.X stuff which is outdated since the
release of Jini 2.0 several years ago) that are on the web.

Do you have a commandline option on your server's Java command line of the form
-Djava.rmi.server.codebase=http://mywebserver/classtree/ or some such? If not,
then your downloaded classes, at your client, will have no "codebase annotation"
and thus the "RMIClassLoader" will have no idea how to get implementations of
such classes.

Gregg Wonderly

--------------------------------------------------------------------------
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 ***@java.sun.com
liang li
2008-05-14 01:11:42 UTC
Permalink
thanks gregg.
i will show your more detail:
1) my interface class:

public interface Log4Jini extends Remote
{
public void log(String className, int level, Object msg)
throws RemoteException;

public void log(String className, int level, Object msg, Throwable t)
throws RemoteException;

}

2 ) implements Log4Jini interface

public class Log4JiniImpl implements Serializable, Log4Jini,
ServiceIDListener
{

protected Log log = LogFactory.getLog(Log4JiniImpl.class);

public void serviceIDNotify(ServiceID id)
{
if (log.isInfoEnabled())
{
log.info("Service ID is: " + id);
}

}

public void log(String className, int level, Object msg, Throwable t)
throws RemoteException
{
// do something

}

public void log(String className, int level, Object msg)
throws RemoteException
{
// do something

}

public Log4JiniImpl() throws RemoteException
{
super();
}

}

3) write an service

public class Log4JiniService
{
protected Log log = LogFactory.getLog(Log4JiniService.class);

private final static long LOG4J_CONFIG_AND_WATCH_DELAY = 30000;

private static final String COMPONENT =
"com.wri.hy.onecgs.jini.service.logging";

private transient String[] initialMemberGroups;

private String log4jPropertyFile;

private void initializeSecurityManager()
{
if (System.getSecurityManager() == null)
{
System.setSecurityManager(new RMISecurityManager());
}
}

private void initializeJoinManager()
{
try
{
Log4JiniImpl impl = new Log4JiniImpl();

LookupDiscoveryManager manager = new LookupDiscoveryManager(
initialMemberGroups, null, null);



JoinManager joinManager = new JoinManager(impl, null,
(Log4JiniImpl) impl, manager, null);
}
catch (IOException e)
{
e.printStackTrace();
}
}

public Log4JiniService(String[] args, final LifeCycle lc)
throws ConfigurationException, LoginException, IOException
{

final Configuration config = ConfigurationProvider.getInstance(args,
Log4JiniService.class.getClassLoader());

init(args, config);

}

public Log4JiniService(String[] args)
throws ConfigurationException, LoginException, IOException
{

final Configuration config = ConfigurationProvider.getInstance(args,
Log4JiniService.class.getClassLoader());

init(args, config);
}

private void init(String[] anArgs, Configuration config)
throws ConfigurationException, RemoteException
{

try
{
initialMemberGroups = (String[]) config.getEntry(COMPONENT,
"initialMemberGroups", String[].class);

log4jPropertyFile = (String) config.getEntry(COMPONENT,
"log4jPropertyFile", String.class);

PropertyConfigurator.configureAndWatch(log4jPropertyFile,
LOG4J_CONFIG_AND_WATCH_DELAY);

initializeSecurityManager();
initializeJoinManager();
}
catch (Exception anE)
{
if (log.isErrorEnabled())
{
log.error("loginContext has insufficient privileges", anE);
}
}
}

public static void main(String args[])
{
try
{
new Log4JiniService(args);

Object keepAlive = new Object();
synchronized (keepAlive)
{
keepAlive.wait();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}

}



4) build my java source file

5) run rmic command

rmic -v1.2 -keep -classpath
c:\\jini2_1\\lib\\jini-core.jar;c:\\jini2_1\\lib\\jini-ext.jar;.
Log4JiniImpl

6) jar my class(named jiniLogger.jar)

7) copy jiniLogger.jar to c:\\jini2_1\\lib

8) copy jiniLogger.jar to c:\\jini2_1\\lib-dl, and rename jiniLogger-dl.jar
, and only Log4Jini.class and Log4JiniImpl_Stub.class are left (i delete
Log4JiniImpl.class and Log4JiniService.class, i think both is not needed for
clients)

9) run launch-all.exe(start jini)

10) register my service

java -Djava.security.policy=C:/jini2_1/installverify/support/jsk-all.policy
-Djava.rmi.server.codebase="http://192.168.8.3:8081/jiniLogger-dl.jar<http://192.168.8.3:8081/onecgs-dl.jar>
http://192.168.8.3:8081/jsk-dl.jar" -classpath
"C:\\jini2_1\\lib\\commons-codec-1.1.jar;C:\\jini2_1\\lib\\commons-lang-2.1.jar;C:\\jini2_1\\lib\\commons-logging-1.1.1.jar;C:\\jini2_1\\lib\\icu4j-3.4.4.jar;C:\\jini2_1\\lib\\jasypt-1.4.1.jar;C:\\jini2_1\\lib\\log4j-1.2.15.jar;C:\\jini2_1\\lib\\jiniLogger.jar;C:\\jini2_1\\lib\\jini-ext.jar;C:\\jini2_1\\config"
Log4JiniService C:\\jini2_1\\installverify\\support\\log4Jini.config

11) using jini service browser, i found the name of my service is
Log4JiniImpl.

12) i run an client on another pc, an exception is thrown:

java.rmi.UnmarshalException: error unmarshalling return; nested exception
is:
java.lang.ClassNotFoundException: Log4JiniImpl
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:120)

13) i googled, in the web:

http://jan.newmarch.name/java/jini/tutorial/TroubleShooting.xml#RMI%20Stubs

*Typical error *

*java.rmi.StubNotFoundException:
Stub class not found: rmi.FileClassifierImpl_Stub;
nested exception is:
java.lang.ClassNotFoundException: rmi.FileClassifierImpl_Stub*

**

*Many of the examples export services as remote RMI objects. These objects
are subclasses of UnicastRemoteObject. What gets exported is not the object
itself, but a stub that will act as proxy for the object (which continues to
run back in the server). The stub has to be created using the rmic compiler
as in *

*rmic -v1.2 -d . rmi.FileClassifierImpl*

*This will create a FileClassifierImpl_Stub.class in the rmi subdirectory.
The stub class file needs to be accessible to the Java runtime in the same
way as the original class file.*

*note:*

*the article say XXXX_stub is not found, however, my exception say my
Log4JiniImpl class is not found, not Log4JiniImpl_stub?*

what is wrong?

need help!

best regards

byron lee
Post by Gregg Wonderly
Post by liang li
hi, all
java.rmi.UnmarshalException: error unmarshalling return; nested
com.wri.hy.onecgs.jini.service.logging.Log4JiniImpl
With all RMI/Jini based client/server applications, you are typically
using some type of mobile code. Typically that mobile code, is based on the
parameterization of your interface methods. That is, the values that your
interface's methods require you to provide when calling, and the values that
you get back as results.
For example
public interface MyInterface extends Remote {
public Results getSomeWorkDone( WorkItem item ) throws
RemoteException;
}
will typically (I am skipping smart proxies with custom
marshalling/unmarshalling here) require that the "Results" class/interface
implementation and the WorkItem class/interface implementation be classes
that both the client and the server know about.
One of the primary considerations of mobile code is to minimize the need
of the client to "have" all types, but instead to "have" interface types,
and download implementations that the server returns to it.
The most predominate example is that if your client was looking for a
service that implemented "MyInterface", shown above, that it would download
the code for that service implementation so that it would always get the
most up to date implementation (bug fixes etc).
To facilitate that, you need to provide a "codebase" setting for your
service using the RMIClassLoaderSPI provisions in the JVM. This is done
automatically for you, if you follow the steps that the Jini starter kit
documentation, or the RMI examples (you seem to be using Jini 1.2.X stuff
which is outdated since the release of Jini 2.0 several years ago) that are
on the web.
Do you have a commandline option on your server's Java command line of the
form -Djava.rmi.server.codebase=http://mywebserver/classtree/ or some
such? If not, then your downloaded classes, at your client, will have no
"codebase annotation" and thus the "RMIClassLoader" will have no idea how to
get implementations of such classes.
Gregg Wonderly
--------------------------------------------------------------------------
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 ***@java.sun.com
Gregg Wonderly
2008-05-14 14:09:00 UTC
Permalink
Post by liang li
thanks gregg.
private void initializeJoinManager()
{
try
{
Log4JiniImpl impl = new Log4JiniImpl();
LookupDiscoveryManager manager = new LookupDiscoveryManager(
initialMemberGroups, null, null);
JoinManager joinManager = new JoinManager(impl, null,
(Log4JiniImpl) impl, manager, null);
Here you are passing the join manager a non-exported object that is
serializable. So, that class must be present in the -dl.jar that you have
specified in your codebase. I am not sure, but I believe that you actually want
to use an Exporter here, and if you do that, and use the BasicJeriExporter, you
do not need to perform any RMIC operations because the _stub equivalent
information is automatically generated by the exporter and provided to the
remote client.

So, my recommendation is to remove the Serializable declaration from
Log4JiniImpl, and then replace your initializeJoinManager() method with the
following code.

private volatile Exporter exp;
private volatile Remote svcObj;
private volatile Log4JiniImpl impl;
private void initializeJoinManager() {
try {
impl = new Log4JiniImpl();

LookupDiscoveryManager manager = new LookupDiscoveryManager(
initialMemberGroups, null, null);

// Get the exporter from config, but provide a default
exp = config.getEntry( COMPONENT, "exporter",
Exporter.class, new BasicJeriExporter(
TcpServerEndpoint.getInstance(0),
new BasicILFactory() ) );

// export the service
svcObj = exp.export( impl );

JoinManager joinManager = new JoinManager( svcObj, null,
(Log4JiniImpl) impl, manager, null);
} catch ( IOException ex ) {
log.log( Level.SEVERE, ex.toString(), ex );
}
}

That will get you an exported service who's remote clients will only depend on
the interface, and the types specified by the methods in that interface's
declaration.

All of these things are in the Jini documentation, and through Dan's plethora of
information linked to from his website and from the http://jini.dev.java.net web
site as well as http://www.jini.org.

Gregg Wonderly

--------------------------------------------------------------------------
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 ***@java.sun.com
liang li
2008-05-15 05:20:22 UTC
Permalink
thanks Gregg,
i succeed to export my service . before i saw many examples which
only show how to provide services with the thing the proxy is the server

thank you again.

best regards

byron lee
Post by liang li
Post by liang li
thanks gregg.
private void initializeJoinManager()
Post by liang li
{
try
{
Log4JiniImpl impl = new Log4JiniImpl();
LookupDiscoveryManager manager = new LookupDiscoveryManager(
initialMemberGroups, null, null);
JoinManager joinManager = new JoinManager(impl, null,
(Log4JiniImpl) impl, manager, null);
Here you are passing the join manager a non-exported object that is
serializable. So, that class must be present in the -dl.jar that you have
specified in your codebase. I am not sure, but I believe that you actually
want to use an Exporter here, and if you do that, and use the
BasicJeriExporter, you do not need to perform any RMIC operations because
the _stub equivalent information is automatically generated by the exporter
and provided to the remote client.
So, my recommendation is to remove the Serializable declaration from
Log4JiniImpl, and then replace your initializeJoinManager() method with the
following code.
private volatile Exporter exp;
private volatile Remote svcObj;
private volatile Log4JiniImpl impl;
private void initializeJoinManager() {
try {
impl = new Log4JiniImpl();
LookupDiscoveryManager manager = new LookupDiscoveryManager(
initialMemberGroups, null, null);
// Get the exporter from config, but provide a default
exp = config.getEntry( COMPONENT, "exporter",
Exporter.class, new BasicJeriExporter(
TcpServerEndpoint.getInstance(0),
new BasicILFactory() ) );
// export the service
svcObj = exp.export( impl );
JoinManager joinManager = new JoinManager( svcObj, null,
(Log4JiniImpl) impl, manager, null);
} catch ( IOException ex ) {
log.log( Level.SEVERE, ex.toString(), ex );
}
}
That will get you an exported service who's remote clients will only depend
on the interface, and the types specified by the methods in that interface's
declaration.
All of these things are in the Jini documentation, and through Dan's
plethora of information linked to from his website and from the
http://jini.dev.java.net web site as well as http://www.jini.org.
Gregg Wonderly
--------------------------------------------------------------------------
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 ***@java.sun.com
liang li
2008-05-15 05:50:55 UTC
Permalink
hi, all

when i export an service i only see Proxy$XX in service browser? not a
meaning
service name, for example:Log4JiniImpl.
could anybody tell me how to do?

best regards
byron lee
Post by liang li
thanks Gregg,
i succeed to export my service . before i saw many examples which
only show how to provide services with the thing the proxy is the server
thank you again.
best regards
byron lee
Post by liang li
Post by liang li
thanks gregg.
private void initializeJoinManager()
Post by liang li
{
try
{
Log4JiniImpl impl = new Log4JiniImpl();
LookupDiscoveryManager manager = new LookupDiscoveryManager(
initialMemberGroups, null, null);
JoinManager joinManager = new JoinManager(impl, null,
(Log4JiniImpl) impl, manager, null);
Here you are passing the join manager a non-exported object that is
serializable. So, that class must be present in the -dl.jar that you have
specified in your codebase. I am not sure, but I believe that you actually
want to use an Exporter here, and if you do that, and use the
BasicJeriExporter, you do not need to perform any RMIC operations because
the _stub equivalent information is automatically generated by the exporter
and provided to the remote client.
So, my recommendation is to remove the Serializable declaration from
Log4JiniImpl, and then replace your initializeJoinManager() method with the
following code.
private volatile Exporter exp;
private volatile Remote svcObj;
private volatile Log4JiniImpl impl;
private void initializeJoinManager() {
try {
impl = new Log4JiniImpl();
LookupDiscoveryManager manager = new LookupDiscoveryManager(
initialMemberGroups, null, null);
// Get the exporter from config, but provide a default
exp = config.getEntry( COMPONENT, "exporter",
Exporter.class, new BasicJeriExporter(
TcpServerEndpoint.getInstance(0),
new BasicILFactory() ) );
// export the service
svcObj = exp.export( impl );
JoinManager joinManager = new JoinManager( svcObj, null,
(Log4JiniImpl) impl, manager, null);
} catch ( IOException ex ) {
log.log( Level.SEVERE, ex.toString(), ex );
}
}
That will get you an exported service who's remote clients will only
depend on the interface, and the types specified by the methods in that
interface's declaration.
All of these things are in the Jini documentation, and through Dan's
plethora of information linked to from his website and from the
http://jini.dev.java.net web site as well as http://www.jini.org.
Gregg Wonderly
--------------------------------------------------------------------------
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 ***@java.sun.com
Dennis Brake
2008-05-15 11:50:56 UTC
Permalink
I'm testing scalability on a number of machines by registering services
and then trying to discover them. I've seen similar problems for people
using JavaSpaces but I'm only using the JoinManager and the LookupCache.



I'm testing scalability on a number of machines by registering services
and then trying to discover them. I'm getting random errors like the
following:

INFO: Exception occurred during call to lookup
java.rmi.UnmarshalException: exception unmarshalling response; nested
exception is:
java.io.IOException: I/O error reading from mux connection:
java.io.EOFException
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocat
ionHandler.java:847)
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationH
andler.java:659)
at
net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:
528)
at com.sun.jini.reggie.$Proxy2.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
at
net.jini.lookup.ServiceDiscoveryManager$LookupCacheImpl$LookupTask.run(S
erviceDiscoveryManager.java:929)
at
net.jini.lookup.ServiceDiscoveryManager$LookupCacheImpl$RegisterListener
Task.run(ServiceDiscoveryManager.java:901)
at com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.java:331)
Caused by: java.io.IOException: I/O error reading from mux connection:
java.io.EOFException
at
com.sun.jini.jeri.internal.mux.Session$MuxInputStream.read(Session.java:
852)
at
net.jini.jeri.connection.ConnectionManager$Outbound$Input.read(Connectio
nManager.java:515)
at
net.jini.jeri.BasicObjectEndpoint.executeCall(BasicObjectEndpoint.java:4
11)
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocat
ionHandler.java:806)
... 7 more

I can successfully run my examples using only 2 machines, however when I
scale up I get the errors. The setup where I see the errors is 50
machines and on each machine I run a JVM with 10 services. I have one
LUS running on a separate machine.

My code creates a service and uses the JoinManager to register it (this
part doesn't cause problems), then I create a LookupCache and listen for
new services. In almost all 50 JVMs I get some errors. I'm expecting to
discover 251 registrations (the extra one for the LUS) but I usually get
somewhere in the range of 180. Most of the action happens within the
first minute but my code waits for 5 minutes to complete the test.

I've tested the low level networking by creating a ServerSocket,
announcing its location using a MulticastSocket, and connecting to the
server using unicast. This was scaled to 140 machines and never gave me
a problem, each machine discover the others and was able to connect.

Has anyone else had this problem?

Thanks
Dennis


--------------------------------------------------------------------------
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 ***@java.sun.com
Bob Scheifler
2008-05-16 00:38:49 UTC
Permalink
Post by Dennis Brake
INFO: Exception occurred during call to lookup
java.rmi.UnmarshalException: exception unmarshalling response; nested
java.io.EOFException
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:847)
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:659)
at
net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at com.sun.jini.reggie.$Proxy2.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
This means the multicast discovery of the lookup service worked;
what's failing is the direct lookup of services. Try turning on
detailed server-side JERI logging in the lookup service, to see
what's happening on that end, which seems to be where the problem is.

- Bob

--------------------------------------------------------------------------
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 ***@java.sun.com
Dennis Brake
2008-05-19 17:44:31 UTC
Permalink
Thanks Bob and Dan,

I was looking down the stack trace and didn't recognize that it was a
RemoteException. We have a dynamic test environment that does lots of
stuff automatically so I'm trying to find where the LUS code is loaded
from. There is way too much python code to look through.

BTW I'm using Jini 2.1.

I'll let you know the results.

Dennis

-----Original Message-----
From: Bob Scheifler [mailto:***@Sun.COM]
Sent: Thursday, May 15, 2008 8:39 PM
To: JINI-***@JAVA.SUN.COM
Subject: Re: java.io.EOFException using LookupCache
Post by Dennis Brake
INFO: Exception occurred during call to lookup
java.rmi.UnmarshalException: exception unmarshalling response; nested
java.io.EOFException
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocat
ionHandler.java:847)
Post by Dennis Brake
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationH
andler.java:659)
Post by Dennis Brake
at
net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:
528)
Post by Dennis Brake
at com.sun.jini.reggie.$Proxy2.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
This means the multicast discovery of the lookup service worked;
what's failing is the direct lookup of services. Try turning on
detailed server-side JERI logging in the lookup service, to see
what's happening on that end, which seems to be where the problem is.

- Bob

------------------------------------------------------------------------
--
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
***@java.sun.com

--------------------------------------------------------------------------
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 ***@java.sun.com
Dan Creswell
2008-05-17 09:31:42 UTC
Permalink
Hi Dennis,

Which verion of Jini are you using?

Cheers,

Dan.
Post by Dennis Brake
I'm testing scalability on a number of machines by registering services
and then trying to discover them. I’ve seen similar problems for people
using JavaSpaces but I’m only using the JoinManager and the LookupCache.
I'm testing scalability on a number of machines by registering services
and then trying to discover them. I'm getting random errors like the
INFO: Exception occurred during call to lookup
java.rmi.UnmarshalException: exception unmarshalling response; nested
java.io.EOFException
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:847)
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethod(BasicInvocationHandler.java:659)
at
net.jini.jeri.BasicInvocationHandler.invoke(BasicInvocationHandler.java:528)
at com.sun.jini.reggie.$Proxy2.lookup(Unknown Source)
at com.sun.jini.reggie.RegistrarProxy.lookup(RegistrarProxy.java:128)
at
net.jini.lookup.ServiceDiscoveryManager$LookupCacheImpl$LookupTask.run(ServiceDiscoveryManager.java:929)
at
net.jini.lookup.ServiceDiscoveryManager$LookupCacheImpl$RegisterListenerTask.run(ServiceDiscoveryManager.java:901)
at com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.java:331)
java.io.EOFException
at
com.sun.jini.jeri.internal.mux.Session$MuxInputStream.read(Session.java:852)
at
net.jini.jeri.connection.ConnectionManager$Outbound$Input.read(ConnectionManager.java:515)
at
net.jini.jeri.BasicObjectEndpoint.executeCall(BasicObjectEndpoint.java:411)
at
net.jini.jeri.BasicInvocationHandler.invokeRemoteMethodOnce(BasicInvocationHandler.java:806)
... 7 more
I can successfully run my examples using only 2 machines, however when I
scale up I get the errors. The setup where I see the errors is 50
machines and on each machine I run a JVM with 10 services. I have one
LUS running on a separate machine.
My code creates a service and uses the JoinManager to register it (this
part doesn't cause problems), then I create a LookupCache and listen for
new services. In almost all 50 JVMs I get some errors. I'm expecting to
discover 251 registrations (the extra one for the LUS) but I usually get
somewhere in the range of 180. Most of the action happens within the
first minute but my code waits for 5 minutes to complete the test.
I've tested the low level networking by creating a ServerSocket,
announcing its location using a MulticastSocket, and connecting to the
server using unicast. This was scaled to 140 machines and never gave me
a problem, each machine discover the others and was able to connect.
Has anyone else had this problem?
Thanks
Dennis
--------------------------------------------------------------------------
Getting Started: http://www.jini.org/wiki/Category:Getting_Started
--------------------------------------------------------------------------
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 ***@java.sun.com
Bob Scheifler
2008-05-16 00:46:33 UTC
Permalink
Post by liang li
when i export an service i only see Proxy$XX in service browser? not a
meaning service name, for example:Log4JiniImpl.
could anybody tell me how to do?
If you mean the service browser that's in the Starter Kit, that
browser has a configuration entry, "uninterestingInterfaces",
and from the documentation for that entry: "If the service proxy
implements exactly one interface that is not in this list, the name of
that interface is used to name the service, otherwise the concrete class
of the service proxy is used." What you are seeing is the concrete
class, because your service implements more than one interesting
interface. You can either hack the browser code to do something better,
or you can add more interfaces to the configuration entry.

- Bob

--------------------------------------------------------------------------
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 ***@java.sun.com
liang li
2008-05-16 09:26:44 UTC
Permalink
thanks, bob
i mock the hello example,you know hello example display normal
class name like ***.***.***.hello.Hello.
i tried your way, the problem still.

best regards
byron lee
Post by liang li
when i export an service i only see Proxy$XX in service browser? not a
Post by liang li
meaning service name, for example:Log4JiniImpl.
could anybody tell me how to do?
If you mean the service browser that's in the Starter Kit, that
browser has a configuration entry, "uninterestingInterfaces",
and from the documentation for that entry: "If the service proxy
implements exactly one interface that is not in this list, the name of
that interface is used to name the service, otherwise the concrete class
of the service proxy is used." What you are seeing is the concrete
class, because your service implements more than one interesting
interface. You can either hack the browser code to do something better,
or you can add more interfaces to the configuration entry.
- Bob
--------------------------------------------------------------------------
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 ***@java.sun.com
Bob Scheifler
2008-05-16 14:16:02 UTC
Permalink
Post by liang li
i mock the hello example,you know hello example display normal
class name like ***.***.***.hello.Hello.
i tried your way, the problem still.
Since you didn't explain what you tried, it's kinda hard to figure
out why it didn't help. What interfaces does the Proxy class implement?
If you changed the uninterestingInterfaces configuration entry of
the browser, can you show how you did that?

- Bob

--------------------------------------------------------------------------
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 ***@java.sun.com
liang li
2008-05-17 01:58:21 UTC
Permalink
hi, bob
i am sorry for waht i said last letter, i saw your another answer(
http://www.opensubscriber.com/message/jini-***@java.sun.com/6329042.html)
then i coded a small program for getting all interfaces
implemented by my service, like this:

Exporter exporter = (Exporter) new
BasicJeriExporter(TcpServerEndpoint.getInstance("X.X.X.X", 0), new
BasicILFactory());

AuthenImpl impl = new My Impl();

// export an object of this class
Authen proxy = (Authen) exporter.export(impl);

interfaces = ReflectUtil.getInterfaces(proxy.getClass());

for (int i = 0; i < interfaces.length; i++)
{
System.out.println(interfaces[i].getName());
}

so i got all interfaces , then i modify browser.config

uninterestingInterfaces = new String[]
{"java.io.Serializable",

"net.jini.lookup.ServiceIDListener",
"net.jini.security.proxytrust.ServerProxyTrust",

"java.rmi.Remote",
"net.jini.admin.Administrable",
"net.jini.core.constraint.RemoteMethodControl",
"net.jini.security.proxytrust.TrustEquivalence"};
}
so i saw the right class name not proxy!

thank you very much!
best regards
byron lee
Post by Bob Scheifler
Post by liang li
i mock the hello example,you know hello example display normal
class name like ***.***.***.hello.Hello.
i tried your way, the problem still.
Since you didn't explain what you tried, it's kinda hard to figure
out why it didn't help. What interfaces does the Proxy class implement?
If you changed the uninterestingInterfaces configuration entry of
the browser, can you show how you did that?
- Bob
--------------------------------------------------------------------------
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 ***@java.sun.com
Loading...