Can't set Java properties for RAP app [message #850006] |
Thu, 19 April 2012 13:12  |
Eclipse User |
|
|
|
I can't find a way to be successful setting Java properties in a RAP application. I'm trying to specify in a config file VM properties, such as can be set with -vmargs ... on the command line.
Per the eclipse documentation, I should be able to set the value of property "eclipse.vmargs" in the config.ini file, but this doesn't work. Perhaps I'm not formatting the entry properly, but I'e tried every conceivable way to do it, such as
eclipse.vmargs
-Dpropname=propvalue
eclipse.vmargs
propname=propvalue
eclipse.vmargs="propname=propvalue"
eclipse.vmargs="-Dpropname=propvalue"
The eclipse documentation also says I can set -vmargs in the launcher's .ini file. I'm assuming that the launcher .ini file doesn't apply in the RAP context. If it does, then what should I name it, since it's supposed to be named after the executable file, which doesn't exist in RAP?
|
|
|
Re: Can't set Java properties for RAP app [message #850688 is a reply to message #850006] |
Fri, 20 April 2012 04:27   |
Eclipse User |
|
|
|
Mark,
this is really more of a server-side equinox question you are rising
here. In doubt ask on the Equinox forum [1].
The -vmargs argument is evaluated in the executable (i.e. eclipse.exe)
and thus only has an effect if you launch you server app with the
executable. How do you launch the application?
Regards,
Rüdiger
[1] http://www.eclipse.org/forums/index.php?t=thread&frm_id=31
On 19.04.2012 19:12, Mark Leone wrote:
> I can't find a way to be successful setting Java properties in a RAP
> application. I'm trying to specify in a config file VM properties, such
> as can be set with -vmargs ... on the command line.
>
> Per the eclipse documentation, I should be able to set the value of
> property "eclipse.vmargs" in the config.ini file, but this doesn't work.
> Perhaps I'm not formatting the entry properly, but I'e tried every
> conceivable way to do it, such as
>
> eclipse.vmargs
> -Dpropname=propvalue
>
> eclipse.vmargs
> propname=propvalue
>
> eclipse.vmargs="propname=propvalue"
>
> eclipse.vmargs="-Dpropname=propvalue"
>
> The eclipse documentation also says I can set -vmargs in the launcher's
> .ini file. I'm assuming that the launcher .ini file doesn't apply in the
> RAP context. If it does, then what should I name it, since it's supposed
> to be named after the executable file, which doesn't exist in RAP?
--
Rüdiger Herrmann
http://codeaffine.com
|
|
|
|
Re: Can't set Java properties for RAP app [message #851162 is a reply to message #850947] |
Fri, 20 April 2012 14:08  |
Eclipse User |
|
|
|
Mark,
We have run into the same issues. The problem with system properties in Tomcat, is that they are shared for all webapps. The security manager under Tomcat prevents you from setting system properties from within your webapp (this may be configurable).
OSGi has a solution in that it provides a similar property system at the OSGi framework level. If you are running RAP or RWT with OSGi (not standalone RWT), then you can use these properties. In your war you have a file called launch.ini which allows you to set properties that will be available within that OSGi framework. See org.osgi.framework.BundleContext.getProperty(String). You get the BundleContext in your bundle's activator start method (if your bundle has an activator). Otherwise you can get a particular bundle from org.eclipse.core.runtime.Platform.getBundle(String) and then get it's contest.
As Rudiger mentioned, the Equinox forums will probably be of more help.
Cole
|
|
|
Powered by
FUDForum. Page generated in 0.08561 seconds