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

  • Home
  • SEARCH
  • 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 7575129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:36:35+00:00 2026-05-30T16:36:35+00:00

Inside large java enterprise infrastructures I’ve experienced a pattern on how to access resources

  • 0

Inside large java enterprise infrastructures I’ve experienced a pattern on how to access resources from more than one JNDI server, eg different application servers each one serving a module of enterprise beans.

This pattern consists on the client explicitly instructing JNDI the server it expects to resolve a given resource through jndi provider url property.

To achieve it, the client sets up a given Naming Context for each different server it asks a resource.

I’ve wondered about a different and maybe more robust approach:
The client sets up an unique Initial Context which may connect to multiple JNDI servers.
Something like that:

    env.put (Context.PROVIDER_URL, "serverA:1100,serverB:1100,serverC:1100")

JNDI implementation itself should discover which service resolves a given resource based on a consistent naming schema.

Is this a viable and plausible approach?

  • 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-05-30T16:36:36+00:00Added an answer on May 30, 2026 at 4:36 pm

    The URL pattern you described (“serverA:1100,serverB:1100,serverC:1100”) is already accepted by some application servers InitialContext implementations, but is used to define LOAD BALANCE to reach initial contexts in a cluster!

    For example, if you use this URL in Weblogic Server, it will use a round-robin algorithm to retrieve an available initial context from the servers in the list. It will not use the logic that you described at the lookup time, but only to connect to the initial context.

    One alternative is to use Foreign JNDI Providers, that is a technique where you map external JNDI servers and components to an centralized one, and then you can use a consistent naming schema in the linking names (google “foreign JNDI provider” to find some information). Weblogic supports this feature too, like other servers maybe do.

    The service locator pattern can also be used to do this logic in the application layer.

    The specification does not define rules about the provider_url, just says that this property usage is defined by the initial context implementation. So it is plausible, but will not be intuitive once it is already used to define load balancing. Another problem is that Java EE specification does not guarantees anything about JNDI binding names for EJB components, so a poor JNDI implementation must not let you define the JNDI names.

    I think the best solution is to use foreign JNDI mapping or service locator.

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

Sidebar

Related Questions

I have one large div with one smaller div inside it. The smaller div
I have a Graph being drawn inside a UIScrollView . It's one large UIView
Currently I am using statement.executeQuery(qStr) in java to select a large amount of data
I created UIScrollView and added large image inside of the scrollview to scroll. My
I've got a routine that paints an insanely large graph inside a scroll pane.
We have a large offline process that updates the model I designed inside of
In Core java 1 I've read CAUTION: An ArrayList is far less efficient than
I've got this nasty problem where sending multiple, large messages in quick succession from
This is a design question rather than a Java-specific question, but I'm designing it
I am trying to look for specific phrase inside large text, but the phrase

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.