baerchen hat geschrieben:zwei rechner übers internet, und codebase über file-urls...
wenn das so bleibt, bin ich mal gespannt ob eine einzige implementierung richtig läuft....

Moderator: TK 1
baerchen hat geschrieben:zwei rechner übers internet, und codebase über file-urls...
wenn das so bleibt, bin ich mal gespannt ob eine einzige implementierung richtig läuft....
Wenn codebase also über ein netzwerk funktionieren soll, dann muss die codebase auch remote erreichbar sein, zb über einen webserver/ftp...If you don't have a webserver handy, or don't want to take the trouble to start one just for development and debugging, you may be tempted to just use a file: URL as a codebase. While this will work, it's usually not a good idea.
If a server passes a file codebase to a client, the client will try to load any needed code from its own local filesystem. If you're developing and testing both the client and the server on the same machine (or two closely networked machines with the same filesystem) then this may work--since the class files will live in the same place for both the client and the server. But if you ever run the programs on separate machines that do not share a filesystem, your code will suddenly break.
Hm interessant. Ich hatte die Codebase so verstanden, dass lediglich die RMI Registry den Code davon läd und der Client den Code dann wiederum von der Registry bezieht. Wenn also der Server und die Registry auf dem gleichen Rechner laufen, sollten file-URLs funktionieren!?baerchen hat geschrieben:Quelle: http://www.kedwards.com/jini/codebase.htmlWenn codebase also über ein netzwerk funktionieren soll, dann muss die codebase auch remote erreichbar sein, zb über einen webserver/ftp...If you don't have a webserver handy, or don't want to take the trouble to start one just for development and debugging, you may be tempted to just use a file: URL as a codebase. While this will work, it's usually not a good idea.
If a server passes a file codebase to a client, the client will try to load any needed code from its own local filesystem. If you're developing and testing both the client and the server on the same machine (or two closely networked machines with the same filesystem) then this may work--since the class files will live in the same place for both the client and the server. But if you ever run the programs on separate machines that do not share a filesystem, your code will suddenly break.
Was ich damit gemeint habe, dass man dadurch beim Starten des Programs aus der Konsole eine beliebige codebase definieren kann, ohne den Sourcecode zu ändern und neu zu Kompilieren. (Stichwort: Parameter). So kann ich eine globale Codebase für alle Lösungen einrichten, die dann über http oder ftp verfügbar wäre und falls dabei etwas nicht so Abläuft wie es solte, gibt es nach wie vor die Möglichkeit aud die file://-Urls zurückzugreifen.dass man sich keine Gedanken über den Sinn von codebase-Parameter gemacht hat.