Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Websphere variables

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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: 25682
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic