Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » jvm arguments/parameters to server startup
jvm arguments/parameters to server startup [message #106810] Mon, 23 May 2005 18:12 Go to next message
Eclipse UserFriend
Originally posted by: mark_lybarger.yahoo.com

we pass system properties to our server on the command line when starting
our servers. is there planned to be a mechanism in the future to control
the server environment so i can easily add command line parameters to the
jvm startup of the server? such as -DMY_VARIABLE=TEST

currently, i edit the .serverdef file to have parameters passed in.

thanks!
Re: jvm arguments/parameters to server startup [message #107196 is a reply to message #106810] Tue, 24 May 2005 20:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gercan.removeThis.acm.org

There is no mechanism to make your changes permanent for every server
configured for any server in WTP. However you can edit .serverdef file
as you have discovered. If you wish to have a not so permanent change
you can edit the launch configuration created in the first launch of the
server.
Gorkem Ercan

mark wrote:
> we pass system properties to our server on the command line when
> starting our servers. is there planned to be a mechanism in the future
> to control the server environment so i can easily add command line
> parameters to the jvm startup of the server? such as -DMY_VARIABLE=TEST
>
> currently, i edit the .serverdef file to have parameters passed in.
>
> thanks!
>
>
Re: jvm arguments/parameters to server startup [message #107342 is a reply to message #107196] Wed, 25 May 2005 10:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mark_lybarger.yahoo.com

Thank you for your response! How do I modify the launch configuration
that was created to add additional jvm parameters?

I see a Servers project created in the workspace. and under that, i see a
folder for my particular server config.

workspace/Servers/Tomcat v4.1 Server @ localhost-config

and in that folder i just see some web.xml, server.xml
catalina.properties, etc. nothing that seems to point me to easily add
jvm arguments.

i think the run on server dialog should have support to add jvm arguments
(system variables).

Gorkem Ercan wrote:

> There is no mechanism to make your changes permanent for every server
> configured for any server in WTP. However you can edit .serverdef file
> as you have discovered. If you wish to have a not so permanent change
> you can edit the launch configuration created in the first launch of the
> server.
> Gorkem Ercan

> mark wrote:
>> we pass system properties to our server on the command line when
>> starting our servers. is there planned to be a mechanism in the future
>> to control the server environment so i can easily add command line
>> parameters to the jvm startup of the server? such as -DMY_VARIABLE=TEST
>>
>> currently, i edit the .serverdef file to have parameters passed in.
>>
>> thanks!
>>
>>
Re: jvm arguments/parameters to server startup [message #107411 is a reply to message #107342] Wed, 25 May 2005 19:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gercan.removeThis.acm.org

You can reach this from Run-->Run.. menu.

mark wrote:
> Thank you for your response! How do I modify the launch configuration
> that was created to add additional jvm parameters?
>
> I see a Servers project created in the workspace. and under that, i see
> a folder for my particular server config.
> workspace/Servers/Tomcat v4.1 Server @ localhost-config
>
> and in that folder i just see some web.xml, server.xml
> catalina.properties, etc. nothing that seems to point me to easily add
> jvm arguments.
> i think the run on server dialog should have support to add jvm
> arguments (system variables).
>
> Gorkem Ercan wrote:
>
>> There is no mechanism to make your changes permanent for every server
>> configured for any server in WTP. However you can edit .serverdef file
>> as you have discovered. If you wish to have a not so permanent change
>> you can edit the launch configuration created in the first launch of
>> the server.
>> Gorkem Ercan
>
>
>> mark wrote:
>>
>>> we pass system properties to our server on the command line when
>>> starting our servers. is there planned to be a mechanism in the
>>> future to control the server environment so i can easily add command
>>> line parameters to the jvm startup of the server? such as
>>> -DMY_VARIABLE=TEST
>>
>>> currently, i edit the .serverdef file to have parameters passed in.
>>>
>>> thanks!
>>>
>>>
>
Re: jvm arguments/parameters to server startup [message #107420 is a reply to message #107196] Wed, 25 May 2005 19:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: laurentd75___no.sp_am.yahoo.fr

"Gorkem Ercan" wrote:
> There is no mechanism to make your changes permanent for every server
> configured for any server in WTP.

> mark wrote:
> > we pass system properties to our server on the command line when
> > starting our servers. is there planned to be a mechanism in the future
> > to control the server environment so i can easily add command line
> > parameters to the jvm startup of the server? such as -DMY_VARIABLE=TEST

Hi all,

I'm not sure what is this .serverdef file you're referring to, but here is a
workaround I found to make configuration changes to a server permanent:

Note : Initially, I came up with this workaround to solve another problem:
how to configure a server so as to declare "dependencies" between projects
(i.e. I create a "WebProj" Web project that uses classes defined in a "Util"
library Java project, and I want to configure my Tomcat server definition so
that the "Util" project gets on the Tomcat classpath)

Anyway... Back to your problem: here is the procedure I suggest:

1) create your server using the Servers view, and add your project to this
server

2) From the main menu, select the "Run --> Run..." option. The "Manage
configurations" dialogue is displayed.

3) In the left-hand pane, select your server in the "Configurations"
tree-view.

4) in the right-hand-pane, click on the "Arguments" tab. You will see a "VM
Arguments" text area that is filled with some arguments
(like -Dcatalina.base=....). You can edit this text area to add your custom
VM arguments for starting your server.

5) Click on the "Apply" button to save your changes

FROM NOW ON, YOU MUST REFRAIN FROM STARTING YOUR SERVER USING THE "SERVERS"
VIEW OR THE PROJECT EXPLORER'S CONTEXTUAL MENU, OR YOU WILL LOSE YOUR
CHANGES !!

So, from now on:

- TO START THE SERVER: ALWAYS use either the "Run-->Run..." or "Debug -->
Debug..." main menu options, selecting your server in the left-hand pane and
clicking on the "Run" or "Debug" button in the right-hand pane.

When you start your server, you will notice that gets status is updated
(i.e. from "Stopped" to "Started") in the "Servers" view.

Also note that will you should not use the "Servers" view to start your
server, you can however still use the "Publish" option in case you need to
synchronize changes made in your project.

- TO STOP YOUR SERVER: you CAN use the "Stop" toolbar button or contextual
menu option in the "Servers" view.

Note that you will have to manually open a Web browser and make it point to
your application's URL in order to test your application (the browser will
not be launched automatically as is the case when you use the "Run --> Run
on Server" contextual menu option in the "Project Explorer" view).

CONFIGURING PROJECT DEPENDENCIES:

As I previously explained, I came up witht this workaround while trying to
configure project dependencies and have them work...

So, if you need to configure dependencies, here is how you can do it:

1) Configuring the Java Build Path for allowing Eclipse to compile your
project:

Say for instance you have a "WebProj" Web project that uses classes defined
in a "Util" library Java project:

Right-click on the "WebProj" folder in the "Project Explorer" view and
select "Properties".
In the "Properties" dialogue, select the "Project References" item in the
left-hand pane.
The right-hand pane displays the list of projects in the workspace. Check
the project(s) that your project depends on (in this example, I would check
the "Util" project), and click "OK" to save your changes

You can now successfully compile your "WebProj" project.

2) Configuring the project dependencies for your Server

- Select the "Run --> Run..." menu option to display the "Manage
configurationns" dialogue.
- Select your server in the left-hand pane
- Select the "Classpath" tab in the right-hand pane. You will see a
"Classpath" tree-view that lists a couple of items arranged in two
categories: "Bootstrap entries", and "User entries".
- Click on "User entries". You will notice that some of the buttons to the
right of the treeview that were previously grayed out now become active.
- Click on the "Add projects.." button. The "Project Selection dialogue"
will be displayed.
- Check the project(s) you want to add as dependencies (in my example, I
would check the "Util" project) and click "OK"
- Back to the "Manage Configurations" dialogue, save your changes by
clicking on the "Apply" button
- You can now start your server by clicking on the "Run" button. The server
will be launched and it will use the dependencies you configured, so your
application should run correctly.
- REMEMBER to ALWAYS start your server using the "Run--> RUn..." or "Run -->
Debug..." main menu option, or you will lose your configuration changes.

Hope this helps !!!

Cheers,
Laurent
Re: jvm arguments/parameters to server startup [message #107425 is a reply to message #107420] Wed, 25 May 2005 20:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: laurentd75___no.sp_am.yahoo.fr

Sorry, there was a serious inaccuracy in the following section of my
message:

> CONFIGURING PROJECT DEPENDENCIES:
>
> 1) Configuring the Java Build Path for allowing Eclipse to compile your
> project:
>
> Say for instance you have a "WebProj" Web project that uses classes
defined
> in a "Util" library Java project:
>
> Right-click on the "WebProj" folder in the "Project Explorer" view and
> select "Properties".
> In the "Properties" dialogue, select the "Project References" item in the
> left-hand pane.
> The right-hand pane displays the list of projects in the workspace. Check
> the project(s) that your project depends on (in this example, I would
check
> the "Util" project), and click "OK" to save your changes

This is wrong. Actually, in the "Properties" dialogue, you should:
- Select the "Java Build Path" item in the right-hand pane
- Select the "Projects" tab in the left-hand pane and click on the "Add..."
button
- check the required projects in the "Required Project Selection" dialogue,
and click "OK"
- and finally click "OK" to close the "Properties" window and save your
changes
Re: jvm arguments/parameters to server startup [message #108615 is a reply to message #107411] Wed, 01 June 2005 13:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mark_lybarger.yahoo.com

Gorkem,

thank you for the response. this works nicely for me to directly edit the
org.eclipse.jdt.launching.VM_ARGUMENTS to append our environment variables
as -DVAR=VALUE items at the end of the line using the VM arguments tab.

using the environment variables tab doesn't seem to work quite nicely as
of yet. I found that adding an env var created in my workspace a .launch
file created in .metadata/.plugins/org.eclipse.debug.core with the
following entry:

<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="USE_DEV_DB" value="true"/>
</mapAttribute>

my application looks for this environment property, but never sees it
unless i append -DUSE_DEV_DB=true to the VM arguments tab.

any thoughts/ideas on the environment property would be most appreciated.
i'm just starting my server from the Servers view, and hitting the start
button. our group hasn't migrated our entire development environment to
eclipse wtp yet, so we're using wtp to start/stop the server, and using
ant tasks to deploy our projects to the server.

thanks again for showing me how to customize in the workspace the server
runtime properties. i do think the server configuration should be a bit
easier to locate. i think it should be accessible from the Servers view.

~mark

Gorkem Ercan wrote:

> You can reach this from Run-->Run.. menu.

> mark wrote:
>> Thank you for your response! How do I modify the launch configuration
>> that was created to add additional jvm parameters?
>>
>> I see a Servers project created in the workspace. and under that, i see
>> a folder for my particular server config.
>> workspace/Servers/Tomcat v4.1 Server @ localhost-config
>>
>> and in that folder i just see some web.xml, server.xml
>> catalina.properties, etc. nothing that seems to point me to easily add
>> jvm arguments.
>> i think the run on server dialog should have support to add jvm
>> arguments (system variables).
>>
>> Gorkem Ercan wrote:
>>
>>> There is no mechanism to make your changes permanent for every server
>>> configured for any server in WTP. However you can edit .serverdef file
>>> as you have discovered. If you wish to have a not so permanent change
>>> you can edit the launch configuration created in the first launch of
>>> the server.
>>> Gorkem Ercan
>>
>>
>>> mark wrote:
>>>
>>>> we pass system properties to our server on the command line when
>>>> starting our servers. is there planned to be a mechanism in the
>>>> future to control the server environment so i can easily add command
>>>> line parameters to the jvm startup of the server? such as
>>>> -DMY_VARIABLE=TEST
>>>
>>>> currently, i edit the .serverdef file to have parameters passed in.
>>>>
>>>> thanks!
>>>>
>>>>
>>
Re: jvm arguments/parameters to server startup [message #108658 is a reply to message #107420] Wed, 01 June 2005 14:13 Go to previous message
Eclipse UserFriend
Originally posted by: mark_lybarger.yahoo.com

Laurent,

thanks for the response! i've found that i can start/stop my server from
the servers view if i've edited the command line parameters to my
application with the patch for jboss 4.0.0.

Laurent D wrote:

> "Gorkem Ercan" wrote:
>> There is no mechanism to make your changes permanent for every server
>> configured for any server in WTP.

>> mark wrote:
>> > we pass system properties to our server on the command line when
>> > starting our servers. is there planned to be a mechanism in the future
>> > to control the server environment so i can easily add command line
>> > parameters to the jvm startup of the server? such as -DMY_VARIABLE=TEST

> Hi all,

> I'm not sure what is this .serverdef file you're referring to, but here is a
> workaround I found to make configuration changes to a server permanent:

> Note : Initially, I came up with this workaround to solve another problem:
> how to configure a server so as to declare "dependencies" between projects
> (i.e. I create a "WebProj" Web project that uses classes defined in a "Util"
> library Java project, and I want to configure my Tomcat server definition so
> that the "Util" project gets on the Tomcat classpath)

> Anyway... Back to your problem: here is the procedure I suggest:

> 1) create your server using the Servers view, and add your project to this
> server

> 2) From the main menu, select the "Run --> Run..." option. The "Manage
> configurations" dialogue is displayed.

> 3) In the left-hand pane, select your server in the "Configurations"
> tree-view.

> 4) in the right-hand-pane, click on the "Arguments" tab. You will see a "VM
> Arguments" text area that is filled with some arguments
> (like -Dcatalina.base=....). You can edit this text area to add your custom
> VM arguments for starting your server.

> 5) Click on the "Apply" button to save your changes

> FROM NOW ON, YOU MUST REFRAIN FROM STARTING YOUR SERVER USING THE "SERVERS"
> VIEW OR THE PROJECT EXPLORER'S CONTEXTUAL MENU, OR YOU WILL LOSE YOUR
> CHANGES !!

> So, from now on:

> - TO START THE SERVER: ALWAYS use either the "Run-->Run..." or "Debug -->
> Debug..." main menu options, selecting your server in the left-hand pane and
> clicking on the "Run" or "Debug" button in the right-hand pane.

> When you start your server, you will notice that gets status is updated
> (i.e. from "Stopped" to "Started") in the "Servers" view.

> Also note that will you should not use the "Servers" view to start your
> server, you can however still use the "Publish" option in case you need to
> synchronize changes made in your project.

> - TO STOP YOUR SERVER: you CAN use the "Stop" toolbar button or contextual
> menu option in the "Servers" view.

> Note that you will have to manually open a Web browser and make it point to
> your application's URL in order to test your application (the browser will
> not be launched automatically as is the case when you use the "Run --> Run
> on Server" contextual menu option in the "Project Explorer" view).

> CONFIGURING PROJECT DEPENDENCIES:

> As I previously explained, I came up witht this workaround while trying to
> configure project dependencies and have them work...

> So, if you need to configure dependencies, here is how you can do it:

> 1) Configuring the Java Build Path for allowing Eclipse to compile your
> project:

> Say for instance you have a "WebProj" Web project that uses classes defined
> in a "Util" library Java project:

> Right-click on the "WebProj" folder in the "Project Explorer" view and
> select "Properties".
> In the "Properties" dialogue, select the "Project References" item in the
> left-hand pane.
> The right-hand pane displays the list of projects in the workspace. Check
> the project(s) that your project depends on (in this example, I would check
> the "Util" project), and click "OK" to save your changes

> You can now successfully compile your "WebProj" project.

> 2) Configuring the project dependencies for your Server

> - Select the "Run --> Run..." menu option to display the "Manage
> configurationns" dialogue.
> - Select your server in the left-hand pane
> - Select the "Classpath" tab in the right-hand pane. You will see a
> "Classpath" tree-view that lists a couple of items arranged in two
> categories: "Bootstrap entries", and "User entries".
> - Click on "User entries". You will notice that some of the buttons to the
> right of the treeview that were previously grayed out now become active.
> - Click on the "Add projects.." button. The "Project Selection dialogue"
> will be displayed.
> - Check the project(s) you want to add as dependencies (in my example, I
> would check the "Util" project) and click "OK"
> - Back to the "Manage Configurations" dialogue, save your changes by
> clicking on the "Apply" button
> - You can now start your server by clicking on the "Run" button. The server
> will be launched and it will use the dependencies you configured, so your
> application should run correctly.
> - REMEMBER to ALWAYS start your server using the "Run--> RUn..." or "Run -->
> Debug..." main menu option, or you will lose your configuration changes.

> Hope this helps !!!

> Cheers,
> Laurent
Previous Topic:Struggling with WTP M4
Next Topic:WTP M4 on BEA Weblogic 8.1
Goto Forum:
  


Current Time: Sun Oct 06 09:15:38 GMT 2024

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

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

Back to the top