Jetty Logo
Version: 9.3.7.v20160115
Contact the core Jetty developers at

private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery

Using JNDI with Jetty Embedded

Setting up the Classpath
Example Code

Setting up the Classpath

In addition to the jars that you require for your application, and the jars needed for core Jetty, you will need to place the following jars onto your classpath:

If you are using transactions, you will also need the javax.transaction api. You can obtain this jar from the Jetty dependencies site.

If you wish to use mail, you will also need the javax.mail api and implementation. You can obtain this jar from the Jetty dependencies site. Note that this jar also requires the javax.activation classes, which you can also obtain from the Jetty dependencies site.

Example Code

Here is an example class that sets up some JNDI entries and deploys a webapp that references these JNDI entries in code. We'll use some mocked up classes for the transaction manager and the DataSource in this example for simplicity:

See an error or something missing? Contribute to this documentation at Github!(Generated: 2016-03-17)