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
19
votes
2 answers

Java LDAP Authentication using username and password

I have a working code snippet by which i can authenticate a user by dn and password. My requirement is that the user will be entering his username(sAMAccountName) and I want to authenticate using sAMAccountName and password. How can I modify this…
Andromeda
  • 12,659
  • 20
  • 77
  • 103
19
votes
4 answers

Unit Testing Dilemma: Using a JNDI data source without running JBoss or Spring

Problem Statement I want to be able to run junit tests on methods that connect to a database. Current setup Eclipse Java EE IDE – Java code is using no framework. The developers (me included) want more robust testing of current legacy code BEFORE…
Laura
  • 525
  • 1
  • 4
  • 12
18
votes
6 answers

how to accept self-signed certificates for JNDI/LDAP connections?

I need to connect to an LDAP directory over SSL. In non-production environments, we use self-signed certificates which, of course, fails to validate with: javax.naming.CommunicationException: simple bind failed: ldapserver:636 [Root exception is…
wishihadabettername
  • 14,231
  • 21
  • 68
  • 85
18
votes
2 answers

How can i config module and application name for JNDI Lookups

In EJB 3.1 JNDI Lookups can be made with different Lookup-Names: java:global[/]//! java:global[/]//
Michael W.
  • 531
  • 2
  • 7
  • 17
18
votes
8 answers

What is faster: JDBC or JNDI?

I have two options to configure my application database connection - one is using JDBC, another one is using JNDI. What will be the best option in terms of how fast those connection types work with the database. I understand those are two different…
altern
  • 5,829
  • 5
  • 44
  • 72
17
votes
4 answers

How to setup multiple data sources with Spring and JPA

In our application, we want to set multiple data source with Spring and JPA. Hence we have created 2 entityManagerFactory, 2 data source and 2 transaction- manager. web.xml /WEB-INF/a_spring.xml /WEB-INF/b_spring.xml …
Hoo
  • 1,806
  • 7
  • 33
  • 66
16
votes
3 answers

Cannot create JDBC driver of class '' for connect URL 'null'

I'm using Tomcat 7.0.12 and receiving this error whenever I attmept to access a JNDI datasource connecting to a postgresql db via a .jsp page in a webapp called 'ROOT': SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw…
MuffinMan
  • 889
  • 1
  • 8
  • 28
16
votes
2 answers

JNDI with Active Directory PartialResultException

I am basically walking the LDAP tree in Active Directory. At each level I query for "(objectClass=*)". When I do this on the root eg "dc=example,dc=com" I get the exception below. This works fine on our other LDAP instances. For some reason only on…
startoftext
  • 3,846
  • 7
  • 40
  • 49
16
votes
4 answers

How to configure JDBCRealm to obtain its DataSource from JNDI

How do you use a JDBCRealm to handle authenticating and authorizing users in servlets? The only example I can find is to create the DataSource in web.xml (such as Authentication against database using shiro 1.2.1). I do not want to include database…
Recurse
  • 3,557
  • 1
  • 23
  • 36
15
votes
2 answers

JNDI path Tomcat vs. Jboss

I have DataSource which is configured on Tomcat 6 in context.xml as MyDataSource. And I'm fetching it the following way: DataSource dataSource; try { dataSource = (DataSource) new…
danny.lesnik
  • 18,479
  • 29
  • 135
  • 200
15
votes
4 answers

Out of container JNDI data source

I would like to configure a DataSource using JNDI in a Java SE app. What is the best way to do this? So far, I've come across 2 projects: Apache Naming. The project page has a specific example for configuring a data source, but it looks like the…
nikita
  • 266
  • 3
  • 8
14
votes
2 answers

Connection pooling in Spark Java framework

Java Spark framework uses embedded Jetty as as web server. Jetty supports connection pooling with tools such as HikariCP and provides configuration options in XML files. However, according to these posts, Spark does allow to configure Jetty. There…
Jan Bodnar
  • 10,969
  • 6
  • 68
  • 77
14
votes
2 answers

javax.naming.NameNotFoundException

I am running an example of ejb using JBoss5 Container. I am using an example from here(Part one). In the example I deployed bean in JBoss and an application in Tomcat(to acces the bean from JBoss). I am getting the error in the screen of tomcat…
sjain
  • 1,635
  • 9
  • 25
  • 35
14
votes
1 answer

Spring Configuration for JMS (Websphere MQ - SSL, Tomcat, JNDI, Non IBM JRE)

Background: I have a relatively old application that uses Websphere MQ for messaging. It runs on WAS (Websphere Application Server) and uses MDBs (Message Driven Beans). I was successfully able to replace all MDBs using Spring Integration - JMS. My…
code4kix
  • 3,937
  • 5
  • 29
  • 44
14
votes
6 answers

Configure Multiple DataSource in Spring Boot with JNDI

I want to manage multiple DataSource using your Application Servers built-in features and access it using JNDI. I am using Spring boot with Spring JPA data. I am able to configure the application.properties for single…
Manu
  • 1,379
  • 6
  • 24
  • 53