• 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

Websphere variables

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was wondering if there is a way to keep String variables on a websphere application server to allow me to change the variable in the admin
console so that the String is different based on the server the application is running on.

For example, I'm having an issue on different server environments where I need to point to a different location based on the environment.

Any help would be appreciated.
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course, that's exactly the sort of thing they are for.

But you seem to be asking about Websphere variables as if you weren't sure whether they actually existed. Look under the "Environment" tab in the admin console and you'll see a "Websphere variables" link. Was that what you were asking?
 
Jason Eilert
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know they (websphere variables) exist, but didn't know they could be used for these kind of cases. I just figured they were there for the applicaiton.

I'll just create a new one and access it in a servlet. Thanks for your quick response, I'll give it a try.
 
Jason Eilert
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was able to create a websphere variable and access it. The following code did the trick....



I was wondering if this is the correct way to go about retrieving a websphere variable.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've tried this code but am having a problem with this line:

Set objs = adminService.queryNames( queryName, null );

it is returning a null pointer exception.


Can I confirm with you which class libraries you imported to ensure types, as Set has two different class libraries.

Here are the ones I imported:


import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.ReflectionException;

import com.ibm.websphere.*;
import com.ibm.websphere.management.AdminService;
import com.ibm.websphere.management.AdminServiceFactory;


Suggestions welcomed.

Thanks

Steve
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic