Re: JNDI InitialContext

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Sep 04 2003 - 16:19:41 EDT

  • Next message: Tore Halset: "rtrim()"

    On Thursday, September 4, 2003, at 02:44 AM, Mario Linke wrote:
    > Hi,
    >
    > i want use Cayenne with JNDI in the WebSphere Application Server.
    > I must do:
    >
    > Hashtable env = new Hashtable();
    > env.put (Context.INITIAL_CONTEXT_FACTORY, "...");
    > env.put (Context.PROVIDER_URL, "..");
    > Context context = new InitialContext (env);
    >
    > Where can i configuration the Properties:
    > - INITIAL_CONTEXT_FACTORY and
    > - PROVIDER_URL
    >
    > Thanks, Mario.

    Hmm... I never had to explicitly set those so far, since the two JNDI
    environments that I used (Tomcat and SunOne) did not require extra
    properties. Browsing the docs, it looks like you can easily implement a
    workaround. Per JNDI docs you can set these two properties as system
    properties, and they should be picked up when the default constructor
    of InitialContext is called by Cayenne. E.g.:

    System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "...");
    System.setProperty(Context.PROVIDER_URL, "..");

    Let me know how this worked. If it didn't, I can add a quick patch in
    the upcoming RC2 that would set JNDI InitialContext properties in a
    static fashion.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Sep 04 2003 - 16:18:03 EDT