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 639727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:52:29+00:00 2026-05-13T20:52:29+00:00

I have a jboss web service that is getting the wrong initial context. I

  • 0

I have a jboss web service that is getting the wrong initial context. I want it to use the java.naming.factory.initial from the jndi.properties in the services root directory and not the one in jboss jndi.properties which is the NamingContextFactory. In the ant build file I put the jndi.properties in the classpath and made sure it copies over to the archive, but the service still gets the NamingContextFactory instead. How can I tell which jndi.properties gets used so that the factory gets set correctly?

The unfortunate situation is that I have a third party jar I must use that expects its initial context factory to be the one specified in its packaged jndi.properties file, but when I run this in jboss it gets NamingContextFactory. I can’t change the jboss jndi.properties file without everything breaking.

  • 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-13T20:52:29+00:00Added an answer on May 13, 2026 at 8:52 pm

    If you have multiple jndi.properties files in the root of the classpath, then InitialContext will make some attempt to merge the two, but which one wins is more or less a matter of chance.

    If you want to make sure, then InitialContext has a constructor that takes a Hashtable of properties, where you can specify them explicitly. That would be preferable to implicit loading via jndi.properties, in this case. You can always load your target jndi.properties into a Properties object (which is a subclass of Hashtable), and pass that to the constructor.

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

Sidebar

Related Questions

At present I have a TestNG project that calls a JBoss RESTEasy web service.
Using jboss-esb 5.1.0.GA I have a web service that an EJB that I have
I have a .Net web service client that consumes a Java web service. When
I have a web service WebService1 that is deployed on JBoss (4.2.3.GA). WebService1 's
Under JBoss 4.0.1SP1, I have a servlet that makes multiple, concurrent calls to web
I am hosting a Java web service on a AIX unix box using JBoss.
I want to provide a Java-based Web Service, but I don't require the features
I have an EJB3 bean deployed as a web service in JBoss 4.2.2. In
We have our web services written in Java running on JBoss. Our website is
I am developing a Web Service solution that is hosted inside a JBoss 4.2.3

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.