File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Websphere variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Websphere variables" Watch "Websphere variables" New topic
Author

Websphere variables

Jason Eilert
Greenhorn

Joined: May 22, 2006
Posts: 5
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.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: May 22, 2006
Posts: 5
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

Joined: May 22, 2006
Posts: 5
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.
Steve Clarke
Greenhorn

Joined: Feb 16, 2011
Posts: 1
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
 
Consider Paul's rocket mass heater.
 
subject: Websphere variables