jndi

JNDI Service provider for the file system

ぃ、小莉子 提交于 2020-01-01 05:09:06
问题 I was looking for the Java Naming and Directory Interface (JNDI) service provider for the file system. As far as I know, Oracle ships bundled with the JDK only service providers for RMI, DNS, LDAP and COS. It looks like Sun used to provide one, because my Google search returned a number of Web-sites and forums including Coderanch where people suggested downloading the file system SP from Sun's JNDI page, but that page now redirects to Java Technetwork's main page. Also, Oracle's JNDI page

How to get driver class name (not driver name) from jdbc connection

China☆狼群 提交于 2020-01-01 04:56:07
问题 I have a context.xml file in the below format <Context shallowOutput="true" path="/"> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name="jdbc/myDataSource" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" driverClassName="oracle.jdbc.driver.OracleDriver" username="OMITTED" password="OMITTED" url="OMITTED" maxActive="20" maxIdle="10" maxWait="-1"/> From this contex.xml I need to get my Driver CLASS name. Everytime I try like

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

谁说胖子不能爱 提交于 2019-12-31 12:59:48
问题 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 next step is try to see if I can port it out of WAS so that it can run on any other servlet container with a non-IBM JRE (I am trying: apache tomcat). Note that securing channels using SSL is a requirement. I prefer using JNDI. End Goal: To

How to configure JDBCRealm to obtain its DataSource from JNDI

拈花ヽ惹草 提交于 2019-12-31 12:49:47
问题 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 credentials in my source tree (for obvious reasons) and would prefer to use a Context defined DataSource via JNDI as I have for every other RDBMS I have used for any other purpose in every other servlet project I have developed. How do you

How to configure JDBCRealm to obtain its DataSource from JNDI

旧城冷巷雨未停 提交于 2019-12-31 12:49:05
问题 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 credentials in my source tree (for obvious reasons) and would prefer to use a Context defined DataSource via JNDI as I have for every other RDBMS I have used for any other purpose in every other servlet project I have developed. How do you

How to retrieve LDAP password via JNDI

倾然丶 夕夏残阳落幕 提交于 2019-12-30 05:09:11
问题 I am able to read the password stored in LDAP via JNDI. But the result is some gibberish characters. So how do i decrypt it? Below is my code: public static void main(String[] args) { String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory"; String MY_HOST = "ldap://KhooGP-Comp1:1389"; String MGR_DN = "cn=Directory Manager"; String MGR_PW = "password"; String MY_SEARCHBASE = "dc=QuizPortal"; String MY_FILTER = "uid=yiwei"; String MY_ATTRS[] = {"cn", "uid", "sn", "userpassword"}; //Identify service

Simple Application using JNDI and DataSource without Server, ServiceUnavailableException, ConnectException

醉酒当歌 提交于 2019-12-29 09:06:14
问题 I'm reading about JNDI and DataSource. https://www.journaldev.com/2509/java-datasource-jdbc-datasource-example https://www.journaldev.com/2513/tomcat-datasource-jndi-example-java https://www.baeldung.com/jndi Does it make sense to use JNDI without a server, e.g. Tomcat, JBoss, WAS? Is there some simple, standalone application that uses JNDI? I would like an example using both without a server. import java.rmi.Remote; import java.rmi.RemoteException; import java.rmi.registry.LocateRegistry;

ldap search is very slow

给你一囗甜甜゛ 提交于 2019-12-29 08:16:51
问题 I am using JNDI to connect to the LDAP active directory, and I want to search for users where the name contains the search string, so my search method is as follows: public static List<LDAPUser> searchContactsByName( ExtendedDirContext extendedDirContext, String name) { try { LdapContext ldapContext = extendedDirContext.getLdapContext(); String searchBaseStr = extendedDirContext.getSearchBase(); String sortKey = LDAPAttributes.NAME; ldapContext.setRequestControls(new Control[] { new

What's the default JNDI name of an EJB in Websphere Application Server 7 (WAS)?

一世执手 提交于 2019-12-29 06:54:14
问题 In the Administration COnsole of WAS 7, on the Applications > Application Types > WebSphere enterprise applications > application > EJB JNDI names section, I have a table with four columns : EJB Module (e.g. ProjectEJB.jar) EJB (e.g. BeanBO ) URI (e.g. ProjectEJB.jar, META-INF/ejb-jar.xml Target resource JNDI Name (with empty fields) Something like this : What's the jndi name of my LogWriter bean ? 回答1: Below you have table with default names. Each bean gets short and long form. You can

Unable to configure JNDI Read & Connect Timeout properties through Java VM options

空扰寡人 提交于 2019-12-25 17:21:49
问题 I have configured JNDI read & connect timeout properties through VM options as shown below: -Dcom.sun.jndi.ldap.connect.timeout=5000 -Dcom.sun.jndi.ldap.read.timeout=5000 But it is not working. JNDI read time out fails with below exception: javax.naming.NamingException: LDAP response read timed out, timeout used:-1ms. But if I configured these properties in JNDI environment properties as shown below: env.put("com.sun.jndi.ldap.read.timeout", "5000"); env.put("com.sun.jndi.ldap.connect.timeout