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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:15:24+00:00 2026-05-10T16:15:24+00:00

When I try the following lookup in my code: Context initCtx = new InitialContext();

  • 0

When I try the following lookup in my code:

Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup('java:comp/env'); return (DataSource) envCtx.lookup('jdbc/mydb');  

I get the following exception:

java.sql.SQLException: QueryResults: Unable to initialize naming context:      Name java:comp is not bound in this Context at      com.onsitemanager.database.ThreadLocalConnection.getConnection     (ThreadLocalConnection.java:130) at          ... 

I installed embedded JBoss following the JBoss wiki instructions. And I configured Tomcat using the ‘Scanning every WAR by default’ deployment as specified in the configuration wiki page.

Quoting the config page:

JNDI

Embedded JBoss components like connection pooling, EJB, JPA, and transactions make extensive use of JNDI to publish services. Embedded JBoss overrides Tomcat’s JNDI implementation by layering itself on top of Tomcat’s JNDI instantiation. There are a few > reasons for this:

  1. To avoid having to declare each and every one of these services within server.xml
  2. To allow seemeless integration of the java:comp namespace between web apps and EJBs.
  3. Tomcat’s JNDI implementation has a few critical bugs in it that hamper some JBoss components ability to work
  4. We want to provide the option for you of remoting EJBs and other services that can > be remotely looked up

Anyone have any thoughts on how I can configure the JBoss naming service which according to the above quote is overriding Tomcat’s JNDI implementation so that I can do a lookup on java:comp/env?

FYI – My environment Tomcat 5.5.9, Seam 2.0.2sp, Embedded JBoss (Beta 3),

Note: I do have a -ds.xml file for my database connection properly setup and accessible on the class path per the instructions.

Also note: I have posted this question in embedded Jboss forum and seam user forum.

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

    Thanks for the response toolkit…. yes, I can access my datasource by going directly to java:jdbc/mydb, but I’m using an existing code base that connects via the ENC. Here’s some interesting info that I’ve found out ….

    1. The above code works with JBoss 4.2.2.GA and here’s the JNDI ctx parameters being used:
      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces: org.jboss.naming:org.jnp.interfaces

    2. The above code works with Tomcat 5.5.x and here’s the JNDI ctx parameters being used:
      java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory java.naming.factory.url.pkgs=org.apache.naming

    3. The above code fails with Embedded JBoss (Beta 3) in Tomcat 5.5.x with the above error message.
      java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory java.naming.factory.url.pkgs=org.apache.namingThe above code fails with the above error using JBoss Embedded in tomcat 5.5.x

    Anyone have any thoughts I what I need to do with configuring embedded JBoss JNDI configuration?

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

Sidebar

Ask A Question

Stats

  • Questions 133k
  • Answers 133k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You're probably only strace'ing a single thread. run strace with… May 12, 2026 at 6:37 am
  • Editorial Team
    Editorial Team added an answer Having no local repository would mean your classpath consisting almost… May 12, 2026 at 6:37 am
  • Editorial Team
    Editorial Team added an answer You need file access to the other server. You can… May 12, 2026 at 6:37 am

Related Questions

Thank you all for your help. A number of you posted (as I should
I'm working with a legacy WebLogic application that contains a web-service application and a
I'm having a bit of a problem with getting JBoss working across networks. As
I am working in a C# winforms project and I have a user control

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.