• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Adding a -D property to my 6.1 server

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know how I can add a property to my server so that it appears in a servlet as a system property (as if I added it as a -D<> to the java command line).
I tried adding one via the admin console (Application Servers/server/Jave settings/Custom Property - but it doesn't show up in the servlet if I do a System.getProperties.list(...).

Thanks,
AW
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Andy,
I think it should go under Servers > Application Servers> serverName > Process Definition> Java Virtual Machine. I'm not sure the field name on that page as I don't have WebSphere's admin console on me. But I know that's where you set custom classpaths so it stands to reason system properties are on that page too.

Since you have the question, you can probably check faster than me since you have an admin console handy.
 
Andy Wilson
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne - that's where I put it (I didn't have the admin console up when I posted the topic either). But it still isn't showing up in the servlet code.

Cheers,
AW

Jeanne Boyarsky wrote:Andy,
I think it should go under Servers > Application Servers> serverName > Process Definition> Java Virtual Machine. I'm not sure the field name on that page as I don't have WebSphere's admin console on me. But I know that's where you set custom classpaths so it stands to reason system properties are on that page too.

Since you have the question, you can probably check faster than me since you have an admin console handy.

 
Andy Wilson
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops - you were quite correct, I was setting the property in the wrong place. I was using:

Servers > Application Servers> serverName > Administration

Defining a property as you describe now works fine. Thanks very much for your help, much aprpeciated.

AW.
 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Details provided by Jeanne are correct and are true for both 6.x and 7.x version of WebSphere Base and ND versions.

In case you have multiple environment to support, you can write a small Jython script that will create the -D parameter for you. This way the administrator doesnt have to travel thru the deep WAS tunnels to configure a system property.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Andy,
Thanks for posting that was it. I forgot to check in the admin console when I had it open, so it was good to know that was correct.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic