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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:25:47+00:00 2026-05-17T19:25:47+00:00

I have a webapp that uses JNDI to locate a datasource and a transaction

  • 0

I have a webapp that uses JNDI to locate a datasource and a transaction manager. I see from the Jetty documentation how to do this via the jetty-env.xml file. However it mentions that this file should be put into the WEB-INF directory.

Why would they suggest that JNDI resources be configured in a configuration file that is located inside my WAR? It makes no sense…I always thought of JNDI as a way to externalize configuration. Is there another place I can put this file on a Jetty server machine?

A follow up question: How about within my Maven WAR module…how should I deal with this file so that I can use the Maven jetty plugin for development, but not have the file end up in the WAR?

  • 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-17T19:25:47+00:00Added an answer on May 17, 2026 at 7:25 pm

    Is there another place I can put this file on a Jetty server machine?

    The official JNDI page puts it like this:

    There are 3 places in which you can
    define naming entries:

    1. jetty.xml
    2. WEB-INF/jetty-env.xml
    3. context xml file

    Naming entries defined in a
    jetty.xml file will generally be
    scoped at either the jvm level or the
    Server level. Naming entries in a
    jetty-env.xml file will generally be
    scoped to the webapp in which the file
    resides, although you are able to
    enter jvm or Server scopes if you
    wish, that is not really recommended.
    In most cases you will define all
    naming entries that you want visible
    to a particular Server instance, or to
    the jvm as a whole in a jetty.xml
    file. Entries in a context xml file
    will generally be scoped at the level
    of the webapp to which it applies,
    although once again, you can supply a
    less strict scoping level of Server or
    jvm if you want.

    Use jetty.xml to configure things “outside” the webapp.

    A follow up question: How about within my Maven WAR module…how should I deal with this file so that I can use the Maven jetty plugin for development, but not have the file end up in the WAR?

    Use the jettyConfig parameter of the Maven Jetty Plugin:

    jettyConfig Optional. The location of a jetty.xml file that will be applied in addition to any plugin configuration parameters. You might use it if you have other webapps, handlers etc to be deployed, or you have other jetty objects that cannot be configured from the plugin.

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

Sidebar

Related Questions

I have an img tag in my webapp that uses the onload handler to
I have a webapp that uses SpringMVC DispatcherServlet to load a WebApplicationContext. The Spring
I have a webapp that I am in the middle of doing some load/performance
I have a java webapp that has to be deployed on either Win or
I have a webapp development problem that I've developed one solution for, but am
I have a start of a webapp that I wrote without using the Object
i am building a webapp that will have notes fields all over the place,
Problem: We have a web app that calls some web services asynchronously (from the
I'm building a Webapp that uses OpenId to authenticate users, like Stackoverlfow does. There
I have Flex/AIR app that connects to a tomcat server via BlazeDS. I'm not

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.