Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
karaf-1.4.0
-
None
Description
Pax-runner calculates the next free port to use on the "client side" of the RMI connection, whereas the "server side" RMI registry takes its port from the org.ops4j.pax.exam.rbc.rmi.port property regardless of whether this is free or not.
Therefore the org.ops4j.pax.exam.rbc.rmi.port should not be hard-coded via the rawPaxRunnerOption("--vmOptions", ...) mechanism.
Now the whole point of setting the raw --vmOptions was to avoid the karaf-specific system.packages setting being overridden by pax-runner. However a similar effect can be achieved without having to specify a org.ops4j.pax.exam.rbc.rmi.port property if the org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption is used instead of the org.ops4j.pax.exam.container.def.PaxRunnerOptions.rawPaxRunnerOption.
This approach appears to work even when another process is hogging port 1099.