jndi

How do Migrate Java, Spring Project to use JNDI datasources

喜你入骨 提交于 2020-01-22 03:26:05
问题 I have a Java project that runs from the command line. It is using Spring. At the current time my project is mySQL. Use can see from the config.xml below <bean id="mysqldataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="mysqldataSource.url" /> <property name="username" value="mysqldataSource.username" /> <property name="password" value="mysqldataSource.password" /> <

LDAP OperationNotSupportedException : error code 53 - WILL_NOT_PERFORM [duplicate]

感情迁移 提交于 2020-01-20 08:46:11
问题 This question already has answers here : How do I resolve “WILL_NOT_PERFORM” MS AD reply when trying to change password in scala w/ the unboundid LDAP SDK? (3 answers) Closed 2 years ago . when I create a user using JNDI to communicate to active directory , I am now getting LDAP Error 53 (WILL_NOT_PERFORM) . I'm trying set password for the created user. Also I've disabled the 'User must change password at next logon' option. attrs.put("unicodePwd", "\"Test123\"".getBytes("UTF-16LE") ); String

LDAP OperationNotSupportedException : error code 53 - WILL_NOT_PERFORM [duplicate]

荒凉一梦 提交于 2020-01-20 08:44:07
问题 This question already has answers here : How do I resolve “WILL_NOT_PERFORM” MS AD reply when trying to change password in scala w/ the unboundid LDAP SDK? (3 answers) Closed 2 years ago . when I create a user using JNDI to communicate to active directory , I am now getting LDAP Error 53 (WILL_NOT_PERFORM) . I'm trying set password for the created user. Also I've disabled the 'User must change password at next logon' option. attrs.put("unicodePwd", "\"Test123\"".getBytes("UTF-16LE") ); String

How to specify portable jndi datsource lookup in grails

孤街浪徒 提交于 2020-01-17 05:45:20
问题 I know JNDI lookup in grails is as simple as datasource { jndiName = "java:comp/env/myDataSource" } this works great on Tomcat. On other containers (WebLogic, JBOSS, etc.) the jndiName for the same thing would be just myDataSource . The question is how do I configure this to be generic and portable so that the code does not need to be changed based on the deploy target? 回答1: You might be able to key off a system property that you know will be set when running in Tomcat and not set anywhere

Obtaining initial context from remote client

一笑奈何 提交于 2020-01-17 05:21:07
问题 Please see the code below: Context ctx = null; ctx=new InitialContext(); TestEJBRemote t = (TestEJBRemote) ctx.lookup("java:global/EJBTest/EJBTest-ejb/TestEJB"); System.out.println(t.getName("Ian")); The output is what I expect i.e. Hello Ian. The code above assumes that the client is installed on the same computer as the Glassfish instance. How do I get the same result from a remote application client. I have tried this: Context ic = new InitialContext(); TestEJBRemote t = (TestEJBRemote) ic

Tomcat配置JNDI数据源

守給你的承諾、 提交于 2020-01-17 03:30:54
经过3个多小时的努力,配置JNDI数据源(主要是通过DBCP连接池)终于搞定~ 还是Tomcat官方的说明好,不过全是英文的,大概还看得懂. 百度上那么花花绿绿的太多了,一个也没成功!... 本例使用的数据库为Ms SQL Server 2000,对于其它数据库只是修改一下相应的参数即可, 服务器是Tomcat5.5, 与之间的版本配置连接池最简便 自己总结了一下,希望起到一个抛砖引玉的作用 总结: 第一步: 将驱动程序(jar包)放到tomcat安装目录下的common\lib文件夹下 第二步: 在Tomcat的webapps目录随便创建一个工程目录,例如myjdbc。在myjdbc目录下创建META-INF目录,在此目录下创建一个context.xml文件,里面的内容如下: <?xml version="1.0" encoding="UTF-8"?> <Context> <Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="sa" password="" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc

Testing ServiceLocator using JUnit

不问归期 提交于 2020-01-16 16:59:04
问题 This is a follow up question to my previous question. I am trying to write test case for my ServiceLocator class but it gives me the following error: com/iplanet/ias/admin/common/ASException java.lang.NoClassDefFoundError: com/iplanet/ias/admin/common/ASException at java.lang.ClassLoader.defineClass1(Native Method) My test case: public void testServiceLocator () throws UivException, NamingException { DataSource ds = ServiceLocator.getInstance().getDataSource("jdbc/RSRC/my/mydb"); //I have not

Testing ServiceLocator using JUnit

隐身守侯 提交于 2020-01-16 16:58:08
问题 This is a follow up question to my previous question. I am trying to write test case for my ServiceLocator class but it gives me the following error: com/iplanet/ias/admin/common/ASException java.lang.NoClassDefFoundError: com/iplanet/ias/admin/common/ASException at java.lang.ClassLoader.defineClass1(Native Method) My test case: public void testServiceLocator () throws UivException, NamingException { DataSource ds = ServiceLocator.getInstance().getDataSource("jdbc/RSRC/my/mydb"); //I have not

problem with JNDI

眉间皱痕 提交于 2020-01-16 04:46:06
问题 I have code which uses JNDI.The code snippet as as follows: EntityManager createEM(String JNDI ){ EntityManager em = null; try{ InitialContext ic = new InitialContext(); em = (EntityManager) ic.lookup(JNDI); return em; } catch (Exception ex){ LOG.Error("error in creating em"); ex.printStackTrace(); } } Now i get error .The control enters catch block. javax.naming.NameNotFoundException: Name comp/env/persistence not found in context "java:". [12/28/10 15:51:07:086 GMT+05:30] 00000081 SystemErr

Changing embedded Tomcat from v6 to v7 causes InitialContext lookup to fail

给你一囗甜甜゛ 提交于 2020-01-15 12:47:06
问题 I'm using JUnit test cases to exercise my web service using embedded Tomcat. Under Tomcat 6 everything was working fine, but when I switched my project to Tomcat 7 I'm coming unstuck. The test code to setup the embedded Tomcat server is as follows: Tomcat 6 Embedded container = new Embedded(); container.setCatalinaHome("C:\\Program Files\\Apache Software Foundation\\Tomcat 7.0.11"); container.setRealm(new MemoryRealm()); container.setName("Catalina"); Engine engine = container.createEngine();