Questions tagged [jndi]

The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java software clients to discover and look up data and objects via a name.

The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java software clients to discover and look up data and objects via a name. Like all Java APIs that interface with host systems, JNDI is independent of the underlying implementation. Additionally, it specifies a service provider interface (SPI) that allows directory service implementations to be plugged into the framework. It may make use of a server, a flat file, or a database; the choice is up to the vendor.

For additional info check:

3073 questions
378
votes
10 answers

What is JNDI? What is its basic use? When is it used?

What is JNDI? What is its basic use? When is it used?
LetsSyncUp
  • 4,155
  • 4
  • 18
  • 15
178
votes
1 answer

Steps to make an existing JNDI HornetQ service as HA?

TL;DR What are the steps to configure a HA-JNDI service with a HornetQ setup? I believe the documentation is a little scattered. I have read through the docs here but doesn't seem to illustrate in detail. Longer version: So we have a HornetQ JMS…
gravetii
  • 9,273
  • 9
  • 56
  • 75
162
votes
8 answers

How to use JNDI DataSource provided by Tomcat in Spring?

It is said that in the Spring javadoc article about DriverManagerDataSource class, that this class is very simple and that it is recommended to use a JNDI DataSource provided by the container. Such a DataSource can be exposed as a DataSource bean…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
124
votes
3 answers

What does java:comp/env/ do?

I just spent too much time of my day trying to figure out some errors when hooking up some JNDI factory bean. The problem turned out to be that instead of this...
Danny
  • 3,670
  • 12
  • 36
  • 45
98
votes
4 answers

What is the purpose of JNDI

How can you realize the usage of JNDI , with an example if possible?
Ajay
  • 7,378
  • 18
  • 57
  • 75
90
votes
3 answers

what is java:comp/env?

what is meant by java:comp/env ? What does the look up like : Context envContext = (Context)initContext.lookup("java:comp/env"); do ? I understand that a look-up like : (DataSource)envContext.lookup("jdbc/MyDatasource") looks up for the name…
saplingPro
  • 20,769
  • 53
  • 137
  • 195
83
votes
13 answers

The meaning of NoInitialContextException error

I am writing a client for my EJB and when trying to execute it, I get the following exception : javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an …
Attilah
  • 17,632
  • 38
  • 139
  • 202
83
votes
5 answers

Should you set up database connection properties in server.xml or context.xml

I am trying to set up the database connection properties using JNDI for a Spring web application. I am considering two approaches as below: Approach 1: In your Spring configuration you may have something like:
user1016403
  • 12,151
  • 35
  • 108
  • 137
59
votes
8 answers

How to create JNDI context in Spring Boot with Embedded Tomcat Container

import org.apache.catalina.Context; import org.apache.catalina.deploy.ContextResource; import org.apache.catalina.startup.Tomcat; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import…
DaShaun
  • 3,722
  • 2
  • 27
  • 29
57
votes
12 answers

Cannot create JDBC driver of class ' ' for connect URL 'null' : I do not understand this exception

Why does it say null URL and gives a empty ' ' class in the exception when I have provided the database URL? I am trying to connect to a derby database via a servlet while using Tomcat. When the servlet gets run, I get the following…
Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
51
votes
4 answers

Code to list all the entries in jndi on remote machine

Can any one tell or point me to code to list all the jndi entries in a remote machine
Anand Sunderraman
  • 7,900
  • 31
  • 90
  • 150
47
votes
5 answers

Why use JNDI for data sources

Can anyone help explain why JNDI should be a preferred way to expose services such as a database / jms? The posts I run into all talk about the advantage of not having to load a specific driver manager, benifiting from connection pooling etc. but…
Kailash
  • 785
  • 1
  • 8
  • 17
44
votes
3 answers

Name [jdbc/mydb] is not bound in this Context

I see this question was raised several times already and I went through all of them. But I am still unable to fix my problem. Could anyone help me pinpoint what I am doing wrong? I get the following error message when I try to access database.jsp: …
lcazarre
  • 713
  • 3
  • 9
  • 15
37
votes
1 answer

What to put into jta-data-source of persistence.xml?

What value should I place into of my persistence.xml? In glassfish admin panel I created a datasource name "abcDS". In my jndi.properties (inside src/test/resources) I defined it like…
yegor256
  • 102,010
  • 123
  • 446
  • 597
32
votes
3 answers

How do a LDAP search/authenticate against this LDAP in Java

I am playing with LDAP and Java search. Here's my LDIF export with a simple organization version: 1 dn: dc=example,dc=com objectClass: organization objectClass: dcObject objectClass: top dc: example o: MyOrganization description: Test…
Satish
  • 6,457
  • 8
  • 43
  • 63
1
2 3
99 100