facebook

WebSphereJVM Custom Property not being picked up by app

  1. MyEclipse IDE
  2.  > 
  3. WebSphere Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #314400 Reply

    joyceewy
    Participant

    I’m converting a working J2EE project from WAS 6.0 to WAS 6.1 using MyEclipseBlue. A crucial part of my app is a JVM environment variable that tells the app if it’s running in local, dev, tst, or prod. I’ve put the environment variable in 6.1 in the same fashion as I did in 6.0, but my app isn’t seeing it. It still comes up null when it calls that value. I’ve restarted the server several times and it still doesn’t show up.

    The variable is set using the local admin console: Application servers/server1/Process Definitions/Java Virtual Machine/Custom Properties. It is called in the app with the call: String server = System.getProperty(“com.lilly.isg.env.server”);

    Is there something in MyEclipseBlue that is holding me up? Is there a way to restart only the JVM, or does restarting the whole server do that? This worked in RAD, so I know it should work. But for some reason it’s not picking it up in MyEclipseBlue.

    #314425 Reply

    support-swapna
    Moderator

    joyceewy,

    Can you enter that property on JDK configuration page of Websphere 6.1 server instance?

    Here are the steps :

    a) Right click on the WAS 6.1 under Servers tab, select the ‘configure server connector’. You can also go from Window > Preferences > MyEclipse > Servers > Websphere 6.1.
    b) This will open up the edit screen. Hit next to get to the JDK configuration page.
    c) Enter the property under the ‘Optional Java VM arguments’. Ex: -Dcom.lilly.isg.env.server=xxx

    Let us know how this works for you.

    #314429 Reply

    joyceewy
    Participant

    I tried adding my property to the ‘Optional Java VM arguments and it doesn’t recognize it. Here is how it looks in the argument box (first argument populated automatically):

    -Xscmx50M -Xms50m -Xmx256M
    com.lilly.isg.env.server=local

    When I try to start the server, I get this message:

    The java class is not found: com.lilly.isg.env.server=local

    Any other ideas? Thanks!

    #314439 Reply

    support-piotr
    Participant

    joyceewy,

    Please add “-D” before your argument. Your argument box should look like this:

    -Xscmx50M -Xms50m -Xmx256M -Dcom.lilly.isg.env.server=local 

    Let us know how this works for you.

    #314467 Reply

    joyceewy
    Participant

    Excellent. That fixed it. Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: WebSphereJVM Custom Property not being picked up by app

You must be logged in to post in the forum log in