I was burned by the above work-around, in that hard-coding the
org.ops4j.pax.exam.rbc.rmi.
port to 1099 breaks the next-free-port selection approach used by pax-exam
for the RMI registry.

So after much trial and error I hit upon the solution to use:

org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption(
   "-Dorg.osgi.framework.system.packages=mypackages ..."
)

instead of:

org.ops4j.pax.exam.container.def.PaxRunnerOptions.rawPaxRunnerOption(
   "--vmOptions",
   "-Dorg.ops4j.pax.exam.rbc.rmi.port=1099 "
   + "-Dorg.osgi.framework.system.packages=mypackages ..."
)

The former approach allows one to ensure the correct system packages are
used without having to explicitly set the RMI port.

/Eoghan



On 8 February 2010 20:42, Eoghan Glynn <[email protected]> wrote:

>
> To answer my own question, apparently just setting:
>
>   rawPaxRunnerOption("--vmOptions",
> "-Dorg.ops4j.pax.exam.rbc.rmi.port=1099")
>
> is sufficient to avoid the -Dorg.osgi.framework.system.packages=...
> override. Odd that.
>
> /Eoghan
>
>
> On 8 February 2010 17:52, Eoghan Glynn <[email protected]> wrote:
>
>>
>> Folks,
>>
>> I've set up a pax-exam test to create its own pax-runner execution
>> environment file, which I then pull in via
>>
>>    rawPaxRunnerOption("--ee", "file:///path/to/my/profile")
>>
>> I'm doing this because I need fine-grained control over the system
>> packages, and the approach works in-so-far-as the generated
>> target/paxrunner/equinox/config.ini file contains the
>> org.osgi.framework.system.packages setting that I want.
>>
>> However, I'm being frustrated by
>> org.ops4j.pax.runner.platform.internal.PlatformImpl.start() also setting a
>> VM option of form "-Dorg.osgi.framework.system.packages=..." which overrides
>> my carefully crafted system packages list. This VM option is pulled in from
>> org.ops4j.pax.runner.platform.Configuration.getVMOptions(), where it appears
>> to originate from a BundleContextPropertyResolver or
>> FallbackPropertyResolver.
>>
>> Does anyone know how I might override this configuration so that the
>> "-Dorg.osgi.framework.system.packages=..." VM option is not set?
>>
>> Cheers,
>> Eoghan
>>
>>
>>
>
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to