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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:03:16+00:00 2026-05-25T14:03:16+00:00

Tomcat6 keeps ignoring my META-INF/context.xml. I keep getting Name tt is not bound in

  • 0

Tomcat6 keeps ignoring my META-INF/context.xml. I keep getting “Name tt is not bound in this Context” when I try to look up “tt” (please see ‘details’).

When I put the content of META-INF/context.xml inside the ‘context’ tag in server.xml, it works. I’ve also checked that $Tomcat-base/Catalina/localhost is empty, so my META-INF/context.xml is not overridden.


details:

Tomcat version: 6.0.10

Here’s my Webroot structure:

Webroot
       |-META-INF
       |      |-context.xml
       |
       |-WEB-INF
             |-web.xml

Content of context.xml:

<Context>
    <Environment name="tt" value="this is a string" type="java.lang.String"></Environment>
</Context>

Context tag of this webroot in server.xml:

<Context path="/test" docBase="E:\javaProjects\TestProject\Webroot" reloadable="true"></Context>

The way I look up for “tt”:

...
Context ic = new InitialContext();
Context ec = (Context) ic.lookup("java:comp/env");
String str = (String) ec.lookup("tt");
System.out.println("str is "+str);

The error I get:

javax.naming.NameNotFoundException: Name tt is not bound in this context
  • 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-25T14:03:17+00:00Added an answer on May 25, 2026 at 2:03 pm

    I’ve got your code working IF I delete the <Context> from the server.xml and define it only in the META-INF/context.xml

    It doesn’t work when the <Context> is defined in both places.

    Secondly, change your type to String, instead of Integer

    <Environment name="tt" value="this is a string" type="java.lang.String"></Environment>
    </Context>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to keep Tomcat's context.xml file out of my WAR file's META-INF directory
Tomcat documentation says: The locations for Context Descriptors are; $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml $CATALINA_HOME/webapps/[webappname]/META-INF/context.xml On my server,
I keep getting this error: java.lang.NoClassDefFoundError: org/apache/lucene/index/memory/MemoryIndex Is there any way i can go
I am following this example . I keep getting this error whenever calling upon
I'm running tomcat6 on centos 6, keeps getting the following error in the log
I keep getting a PermGen error on my Tomcat 6 server. I know what
I keep getting a : HibernateException: No CurrentSessionContext configured! in my code. The only
I encounter this problem : I have a django (python) server that serve XML
I keep getting a NoSuchBeanDefinitionException in my service layer and I have no idea
I was following this tutorial on Tomcat and Jersey, but when I try to

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.