Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8555871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:13:23+00:00 2026-06-11T15:13:23+00:00

In fact I found such message before: Configuring and looking up a simple String

  • 0

In fact I found such message before:
Configuring and looking up a simple String via JNDI in WebSphere

I want to do the “clean” way (http://www.ibm.com/developerworks/websphere/library/techarticles/0611_totapally/0611_totapally.html). Maybe I am simply too green on WebSphere, my mind is totally messed up by the article because it is showing a more complicated example.

Can someone give me a brief steps on how to configure WebSphere so that I can bind a String value in JNDI? Thanks so much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:13:24+00:00Added an answer on June 11, 2026 at 3:13 pm

    Well, assuming that what you want to store is a “configuration” element, I’d actually take the time and implement it using Resource Environment Providers as it’s a more flexible, and obviously more portable, approach.

    In order to bind a String using JNDI, use “String Namespace Bindings”: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.nd.doc/info/ae/ae/unam_rstring_namespace.html

    Edited (to add details about ResEnv):

    The factory class is a class that you write, not IBM. Here’s an example for one:

    public class MyFactory implements javax.naming.ObjectFactory {
        @Override
        public Object getObjectInstance(Object object, Name name, Context context, Hashtable env) throws NamingException {
            MyConfig cfg = new MyConfig();
    
            for (Enumeration e = ((Reference) object).getAll(); e.hasMoreElements();) {
                RefAddr addr = (RefAddr) e.nextElement();
                String key = addr.getType();
                Object value = addr.getContent();
                cfg.put(key, value);
            }
        }
    }
    

    (We’re assuming that MyConfig is a simple class with get(String) and put(String, String) methods)

    Next, create a new Resource Environment Provider in WebSphere. For a Referenceable, put the fully-qualified class name of MyFactory as the “factory class” and the fully-qualified class name of MyConfig as the “class”.

    Next, add a Resource Environment entry. Give it a JNDI name, say myresources/test. Select the Referenceable from the dropdown box.

    Click “Custom Properties”, and add key-value pairs there.

    Save the WebSphere configuration, restart your server and try again. Issue a JNDI lookup to myresources/test, and you’ll get a MyConfig instance with all the custom properties you placed there.

    Let us know how it went. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I always found this rather annoying fact about applets, that they disappear if you
i dont want to do something illegal with it(e.g. vote continuously, in fact, somebody
I have this funny issue. I know this error message is found in a
I did such search, ` Comment.search aabbb ` and I want to get the
I have been searching for about a week now and found such pure AS3
Fact: I'm not that good with jQuery. Problem: I have a form containing dynamically
In fact, my question concerns an algorithm. I need to be able to attach
The fact that Delicious has two sets of API authentications one with username and
In fact I have been assigned with a task to secure my DLL, so
Consider a fact table of the form: CREATE TABLE Fact1 ( Dim1 int NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.