jndi

How do I specify a server to get an EJB from?

↘锁芯ラ 提交于 2020-01-01 17:26:13
问题 In java EE, the way you get an EJB from a remote server is by looking it up in JNDI. The specification defines the JNDI name for a given bean type. However, this seems to be only if you want to get a bean off your local computer. I want to get the bean off a remote server, like most users would. How do I specify the server URL? Do I pass a map to the InitialContext constructor? Note: There is another question that is pretty much the same, but that has become out of date since the definition

How to Authenticate to LDAP using JNDI and Digest-MD5

╄→尐↘猪︶ㄣ 提交于 2020-01-01 16:51:10
问题 I'm trying to authenticate to my LDAP server using DIGEST-MD5 encryption. While using Simple encryption it works just fine, but I can't have the password sent over the network in plain-text, for obvious reasons. The strange thing is that while using Softerra LDAP Browser I can connect to the server using Digest-MD5, but through my Code I receive a range of errors. Here is a snippet of code from my LDAP authentication class where I try to set the security authentication etc before creating the

Spring Boot with JNDI Data Source

纵然是瞬间 提交于 2020-01-01 09:07:33
问题 I have a new Spring Boot web application that I want to connect to a JNDI data source (a MySQL database defined in Tomcat's context.xml). However when I attempt this, I always get the following exception; org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database url for database type NONE. If you want an embedded database please put a supported on on the classpath. This is despite my pom.xml containing the MySQL connector <?xml version="1.0" encoding="UTF-8"?

Is javax.naming.InitialContext ThreadSafe

点点圈 提交于 2020-01-01 08:35:20
问题 Currently I am use following code to lookup EJB3 sateless session beans for normal POJO class. (We are in JEE5 so we can not inject Stateless Session Beans in normal POJO class I have to use look up) import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.apache.log4j.Logger; public Object getEJB(String jndiName) { logger.debug("WEBSPHERE EJB Lookup : " + jndiName); String modifiedJndiName = ""; Hashtable<Object, Object> properties =

JDBC, JNDI Problem with tomcat 6.0.26

拈花ヽ惹草 提交于 2020-01-01 06:56:10
问题 Greetings, I am developing a webapp that requires setting up a DataSource with JNDI using Enterprise JDBC Classes.I am using the Netbeans 6.9 bundled tomcat (6.0.26 app) server with mysql 5.xx.The issue really is that I can still see the database values from a relation being displayed in my jsp page whereas during the tomcat initialization it says something like this: . . SEVERE: Servlet.service() for servlet jsp threw exception java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp

Spring as a JNDI provider?

主宰稳场 提交于 2020-01-01 06:13:09
问题 I would like to use Spring as a JNDI provider. This means that I would like to configure a bean in my Spring context, which can be accessed via JNDI. This would look something like this: <bean class="org.some.thing.here"> <property name="beans"> <map> <entry key="w/t/f"> <bean class="some.thing.Else"> // rest ommitted </bean> </entry> </map> </property> </bean> Then, in my application (lets say a Controller), I want to be able to grab this bean via: Context ctx = new InitialContext(); some

Spring as a JNDI provider?

∥☆過路亽.° 提交于 2020-01-01 06:12:20
问题 I would like to use Spring as a JNDI provider. This means that I would like to configure a bean in my Spring context, which can be accessed via JNDI. This would look something like this: <bean class="org.some.thing.here"> <property name="beans"> <map> <entry key="w/t/f"> <bean class="some.thing.Else"> // rest ommitted </bean> </entry> </map> </property> </bean> Then, in my application (lets say a Controller), I want to be able to grab this bean via: Context ctx = new InitialContext(); some

JndiException when using Hibernate 4.0 with Tomcat 7 when using persistence.xml

北战南征 提交于 2020-01-01 06:10:32
问题 I'm using Hibernate 4.0 with a JPA persistence.xml file on Tomcat 7. No Struts, just straight Hibernate with some Jersey services. Here is the exception I'm running into: Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [jdbc/MyDB] at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68) at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116) at org

JndiException when using Hibernate 4.0 with Tomcat 7 when using persistence.xml

為{幸葍}努か 提交于 2020-01-01 06:10:05
问题 I'm using Hibernate 4.0 with a JPA persistence.xml file on Tomcat 7. No Struts, just straight Hibernate with some Jersey services. Here is the exception I'm running into: Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [jdbc/MyDB] at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68) at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116) at org

Registering MySQL DataSource with JNDI for Hibernate

折月煮酒 提交于 2020-01-01 05:49:06
问题 I have hibernate which connect to database via JNDI datasource. My purpose: registry DataSource with JNDI to test DAO layer. Example Hibernate config <hibernate-configuration> <session-factory name="MySessionFactory"> <property name="hibernate.connection.datasource">java:jdbc/MysqlMyDS</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <!-- mappings .... -> </hibernate-configuration> Get SessionFactory in test class : Configuration cgf = new