Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Can't set Java properties for RAP app
Can't set Java properties for RAP app [message #850006] Thu, 19 April 2012 13:12 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #850947 is a reply to message #850688] Fri, 20 April 2012 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi Rudiger,

Thanks for the explanation. I launch tomcat with a script. I can set the VM args in that script. I would prefer to have my app-specific setting in the web app rather than in tomcat, which of course runs other apps as well. I guess I could perhaps set up different entry points, and have the code pointed to by each endpoint set the property programatically as desired. Unless you have an alternative suggestion, I'll give that a go. Thanks again.

-Mark
Re: Can't set Java properties for RAP app [message #851162 is a reply to message #850947] Fri, 20 April 2012 14:08 Go to previous message
Eclipse UserFriend
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
Previous Topic:How to application RWT.FIXED_COLUMNS, Sample code?
Next Topic:Error validating warproduct
Goto Forum:
  


Current Time: Wed Jun 18 07:41:00 EDT 2025

Powered by FUDForum. Page generated in 0.08561 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top