|
Summary: How to externally set HTTP codebase and port using -Djava.rmi.server.codebase.
OverviewA codebase is how programs that use RMI remote classloading semantics find new classes. When the sender of an object serializes an object for transmission to another JVM, it annotates the serialized stream of bytes with information called the codebase. This information tells the receiver where the implementation of this object can be found. There is a difference between who sets and who uses the codebase information. Any program that wants to pass an object to another program that might not recognize it must set the codebase, so that the receiver can know where to download the code from, if it doesn't have the code available locally. The receiver, upon deserializing the object, fetches the codebase from it and load the code from that location. The actual information stored in the codebase annotation is a list of URLs from which the classfile for the needed object can be downloaded. If you don't set a codebase, you can't pass an object to any program that doesn't have that object's classfile already available locally.
Defining HTTP codebase using -Djava.rmi.server.codebaseBy default, GigaSpaces sets the codebase, and adds the JSpaces-dl.jar/JSpaces.jar, reggie-dl.jar (if reggie is used) and jsk-dl.jar files to it. However, you can choose to pre-define you codebase using -Djava.rmi.server.codebase. In this case, no jar files are added by default, meaning you must add all of the relevant jar files yourself (in previous versions, even if you set the codebase externally, some jar files were added by default).
Defining HTTP PortWhen externally defining your codebase, you define a port (in previous versions, the port number was defined dynamically). Make sure the port number you define in the codebase is the same port number you set in your container schema: <embedded-services> <!-- Starts a Webster HTTP Server embedded in the container VM Default value: true --> <httpd> ... <!-- The host port the server socket HTTPD (Webster) is using is bound to. Default value: port 9813 but if that is busy it generates an anonymous port--> <explicit-binding-port>${com.gs.embedded-services.httpd.port}</explicit-binding-port> <httpd> |
(works on Firefox 2 and Internet Explorer 7)