Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can RMI servers dynamically load classes? How?

2 views
Skip to first unread message

Jeff Wandling

unread,
Feb 5, 1998, 3:00:00 AM2/5/98
to

Hi,

JDK1.1.3 on a solaris 2.6 box.

all browsers jdk1.1 compliant.


i'm using Dynamo and weblogic's class libraries to construct an
application that makes a jdbc connection to a sybase database.

this application works. no errors.

i want to use RMI to build a 'little rmi server that knows how to make
jdbc connections to my database'...

the jdbc-only test application uses Class.forName() to dynamically load
a weblogic class..

so.. then.. seprate from this... i got a basic helloworld rmi
interface, server and client.

the rmi client is an applet. i've used javakey to sign the applet's jar
file and it all works. ie., i copied David Flanagan's Bank example
verbatim. pretty neat.

i bring the rmi system and the jdbc-test application together...

i grafted the jdbc-test method into the method in my helloworld rmi
server code.

then.. CLASSPATH is set and all the rmi code compiles.. (javac the
interface, the server and the client, rmic for the skeletons)

turn on rmiregistry

unset CLASSPATH

then turn on the rmi server

so far so good.

load the client in netscape (jdk1.1 capable). "press the button" that
invokes the Class.forName() in the rmi server and the server complains:

"Class not found..".. I expected this since I ran the rmi server
without CLASSPATH set in the environment. at least the rmi server
starts without the error below.


ok.. start over.. restart the rmi server, but before doing so, set
CLASSPATH to the path list of where I know the Class.forName()'d class
is located.

CLASSPATH=.:/usr/java/lib:/proj/dynamo/Dynamo2.6.1/weblogic/classes-jdk110

Trying to start the rmi server now complains:

unix% java filmServer

java.lang.UnsatisfiedLinkError: initAgent
at sun.tools.debug.Agent.run(Agent.java:280)
at java.lang.Thread.run(Thread.java)
java.rmi.MarshalException: Error marshaling call header;
nested exception is:
java.io.IOException: Not implemented.
java.rmi.MarshalException: Error marshaling call header; nested
exception is:
java.io.IOException: Not implemented.
at
sun.rmi.transport.StreamRemoteCall.<init>(StreamRemoteCall.java:64)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:80)
at
sun.rmi.registry.RegistryImpl_Stub.rebind(RegistryImpl_Stub.java:122)
at java.rmi.Naming.rebind(Naming.java:115)
at filmServer.main(filmServer.java:27)


The question is:

Can RMI servers dynamically load classes? How?

What is a "marsheled call header" ? How do I find the error in it?
what isn't "implemented" (Not implemented) ?

What does this mean?

If I run Flanagan's (Java Examples in a Nutshell, O'Reilly) Bank RMI
example, it works.


If more information is needed to understand the problem then please
write.

-jeff
j...@speakeasy.org

0 new messages