Any way to see the codebase of an object?

View: New views
3 Messages — Rating Filter:   Alert me  

Any way to see the codebase of an object?

by Alex Co :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi
Is there any way to print or see the codebase of an object that is about to be
serialized to a socket?

This is because I have a client server and server sends an object throught the
socket to client and if the .class of that object does not exists on client side
the client throws an exception of java.lang.ClassNotFoundException.

I have the jini web server running and the www dir has the .class. If i try to
access the .class through web browser there is no problem. The browser asks
to save the file.

It seems that the object do not carries a valid codebase?!

Thanks

Alex
PS: Both client and server are running on the same machine for now. When
running client and server i pass the following:


 -Djava.rmi.server.codebase=http://127.0.0.1:8080/



--------------------------------------------------------------------------
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 listserv@...

Parent Message unknown Re: Any way to see the codebase of an object?

by Alex Co :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Solved.
It seems that client can not receive  
-Djava.rmi.server.codebase=http://localhost:8080/
during launch

Only the server needs that.


Alex

--------------------------------------------------------------------------
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 listserv@...

Re: Any way to see the codebase of an object?

by Gregg Wonderly-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alex Co wrote:
> Solved.
> It seems that client can not receive  
> -Djava.rmi.server.codebase=http://localhost:8080/
> during launch
>
> Only the server needs that.

Yes, java.rmi.server.codebase is a property used by the RMI/Jini mechanisms
through the RMIClassLoaderSPI to cause MarshalledObject() use by RMI/Jini to
attach the indicated URLs as the annotations for "server" exported objects.

The client's URLClassLoader (or like class loader implementation per
RMIClassLoaderSPI) use (through the implementation details in RMI/Jini
endpoint/invocation layer activities) will use those annotations to download and
resolve 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 listserv@...