jndi

Spring Boot - JNDI value lookup

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: @SpringBootApplication public class SampleTomcatJndiApplication { public static void main(String[] args) { SpringApplication.run(SampleTomcatJndiApplication.class, args); } @Bean public TomcatEmbeddedServletContainerFactory tomcatFactory() { return new TomcatEmbeddedServletContainerFactory() { @Override protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer( Tomcat tomcat) { tomcat.enableNaming(); return super.getTomcatEmbeddedServletContainer(tomcat); } @Override protected void postProcessContext(Context context) {

How to configure JNDI Realm with Tomcat 7 for PKI User Certificate Authentication?

匿名 (未验证) 提交于 2019-12-03 09:13:36
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: List, I have actually searched extensively on this topic and either a) I don't know how to configure something and/or b) I don't quite understand what a JNDI Realm actually is supposed to do. I am using Tomcat 7.0.32 with jdk 1.7.0_15. Here is what I want to do. I work with customers that use PKI User Certificates. The user certificates have a cn like "Joe Smith". What I need to be able to do is look up this CN in LDAP and get the users id, which may be something like "jsmith23", and populate the Principal user in the request header. The

Java EE 6 embedded glassfish embedded derby EJB unit test

六月ゝ 毕业季﹏ 提交于 2019-12-03 09:13:23
questing is about javaee6 with embedded glassfish and embedded derby jndi lookup for data source at the time of deployment before unit test is executed.... Please find the persistence.xml here... <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="mymodulePU" transaction-type="JTA"> <provider>org.eclipse.persistence.jpa.PersistenceProvider

How to lookup EJB using JNDI in WebSphere Liberty

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to perform a JNDI name search using Liberty Application Server.However, It is throwing me a dependency injection issue.Attached is my code I am getting the following Error: [ERROR ] SRVE0319E: For the [com.airline.controllers.FlightDetails] servlet, com.airline.controllers.FlightDetails servlet class was found, but a resource injection failure has occurred. CWNEN0030E: The server was unable to obtain an object instance for the java:comp/env/com.airline.controllers.FlightDetails/flightService reference. The exception message was:

jndi.properties in JBoss

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any way to configure JNDI so the lookup first checks localhost and if it doesn't find matching name it performs automatic discovery of other jndi servers? 回答1: My understanding of the documentation is that this is the default behavior when using clustering: 16.2.2. Client configuration The JNDI client needs to be aware of the HA-JNDI cluster. You can pass a list of JNDI servers (i.e., the nodes in the HA-JNDI cluster) to the java.naming.provider.url JNDI setting in the jndi.properties file. Each server node is identified by its IP

jboss jndi context is empty

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: An ejb-jar deployed to jboss 7 has a jdni binding "java:global/foo!IFoo". Jboss management console shows this binding. The jndi port is 1099 as by default. A client on jboss gets an object to that binding but a standalone client running on the same machine does not. Properties properties = new Properties (); properties . put ( "java.naming.factory.initial" , "org.jboss.as.naming.InitialContextFactory" ); properties . put ( "java.naming.factory.url.pkgs" , "org.jboss.naming:org.jnp.interfaces" ); properties . put ( "java.naming

How to store string values in context.xml

时光总嘲笑我的痴心妄想 提交于 2019-12-03 08:31:50
问题 I'd like to store connection URLs in a JNDI binding for my Tomcat application. Since Tomcat uses context.xml for JNDI resource defining, I need to figure out the propert way to store a String (or multiple strings for multiple connections) in context.xml . My reason for doing this is so that I can define different strings for different environments, and load them through JNDI. Usually, I see entries like so: <Context ...> <Resource name="someName" auth="Container" type=

Mysql not reconnecting with JNDI Tomcat 6

淺唱寂寞╮ 提交于 2019-12-03 07:54:14
问题 I am using JNDI with Tomcat6 to manage Mysql connections, my Catalina/domain.com/ROOT.xml has: <Resource name="jdbc/db" auth="Container" type="javax.sql.DataSource" username="db1" password="somepass" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/db?autoReconnect=true" maxActive="15" maxIdle="3" maxWait="5000" removeAbandoned="true" removeAbandonedTimeout="20" /> I though autoReconnect will do the job reconnecting to database but it does not, after about 8 hours of

Understanding JNDI

跟風遠走 提交于 2019-12-03 07:45:49
问题 JNDI is like a map on steroids right? I use a key to find references to objects. Also, what is InitialContext? I don't seem to get the idea. 回答1: Conceptually, JNDI is like System.getProperties() on steroids. System.getProperties() allows you to pass String parameters to your code from the command line. Similarly, JNDI allows you to configure arbitrary objects outside of your code (for example, in application server config files) and then use them in your code. In other words, it's an

javax.naming.NameNotFoundException

女生的网名这么多〃 提交于 2019-12-03 05:31:33
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 server javax.naming.NameNotFoundException: greetJndi not bound ( greetJndi is the jndi-name in jboss.xml file ) Is there any specific directory structure to deploy in JBoss? Thanks Pascal Thivent I am getting the error (...) javax.naming.NameNotFoundException: greetJndi not bound This means that nothing is bound to the jndi name greetJndi , very likely