posted 17 years ago
Actually, port 38766 *is* being used by your application, and specifically the RMI portion. But I guess you gathered that already... the only question is why.
Port 1099 is only the port used by the RMI *Naming Server*. Your RMI server is assigned a different port to listen on.
In the default RMI implementation the port assigned to your server is basically a random port above 1024 which is available. You can get around this by either specifying a port number in the super() constructor in your server's constructor if you extend UnicastRemoteObject. if you don't extend UnicastRemoteObject and use the UnicastRemoteObject.export() method, use the one that specifies a port. Or you can build your own RmiSocketFactory and handle port assignment however you see fit - always assign specific ports to specific apps, use your own range of ports, etc.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.