jndi

How and Where to add JNDI for Hibernate?

匆匆过客 提交于 2019-12-04 19:43:44
问题 I need the code to add JNDI name to achive connection pooling in hibernate. I have configured the connetion pooling in Jboss server with the JNDI name as "EmployeeDB" How to configure it in hibernate.cfg.xml ?? Plez give me the code for hibernate.cfg.xml if i am using Hibernate 4 Final release. 回答1: The datasource JDNI name configured in the Jboss server is specified by the properties hibernate.connection.datasource . The basic hibernate.cfg.xml should look like : <?xml version='1.0' encoding

Godaddy JNDI Problem---Cannot create JDBC driver of class '' for connect URL 'null'

牧云@^-^@ 提交于 2019-12-04 19:18:30
I have a website hosted at Godaddy where I use JNDI to manage DB connections. Godaddy is using Tomcat 5.5.27 with JDK 1.5. I am also using the same versions locally. JNDI works fine at my local development environment, but when I run it at Godaddy, I get the following exception message: Cannot create JDBC driver of class '' for connect URL 'null' I have placed everything correctly in Godaddy server as in my local system. Here is the context.xml <?xml version="1.0" encoding="UTF-8"?> <Context> <!-- Specify a JDBC datasource --> <Resource name="jdbc/interviewzone" auth="Container" type="javax

Context specific JNDI parameters problem in tomcat 6

痴心易碎 提交于 2019-12-04 18:48:48
问题 I am having trouble using JNDI when two or more applications are deployed on Tomcat 6. Consider the following scenario: I have 2 webapps, where each web.xml contains one JNDI parameter. web.xml webapp A: <env-entry> <env-entry-name>testEntry</env-entry-name> <env-entry-value>value A</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry> web.xml webapp B: <env-entry> <env-entry-name>testEntry</env-entry-name> <env-entry-value>value B</env-entry-value> <env-entry-type

Jetty: adding <resource-env-ref> programmatically

落爺英雄遲暮 提交于 2019-12-04 18:23:58
I have a standalone application with embedded Jetty and Wicket. I'd like to use CDI for injection. So I've found http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#d0e5286 and now I'm trying to add this programatically, but it's quite complex. How do I code that? Other sources I've found are: http://osdir.com/ml/java.jetty.support/2007-02/msg00198.html http://docs.codehaus.org/display/JETTY/JNDI So far I have: Server server = new Server( 8080 ); Context ctx = new Context( server, "/", Context.NO_SECURITY | Context.SESSIONS ); try { //BeanManager new org.mortbay.jetty.plus

Where is class weblogic.jndi.WLInitialContextFactory?

ε祈祈猫儿з 提交于 2019-12-04 17:35:12
问题 when trying to execute my jar file I get an exception: javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory] I guess this is some kind of missing library on the classpath. Can anyone tell me which jar-file is missing? I can't find the class weblogic.jndi.WLInitialContextFactory anywhere... Thanks! P.S.: I already have weblogic 10.0 jar included. 回答1:

Publishing EJB's local interface in weblogic

笑着哭i 提交于 2019-12-04 17:33:41
is there a way to lookup an EJB in weblogic if it implements only local interface? If I use this @Remote public interface TestSessionRemote { public void businessMethod(); } @Stateless(mappedName = "A") public class TestSessionBean implements TestSessionRemote { public void businessMethod() { } } the EJB can be looked up using this name: "A#" + TestSessionRemote.class.getName() If I change the annotation for TestSessionRemote from @Remote to @Local the EJB disappears from JNDI. Is there a way around this? EDIT: I was working with Weblogic 10.3.x (aka 11g) at that time. No, it is not possible.

How to obtain JNDI data source for JPA/JTA DAO integration test?

别等时光非礼了梦想. 提交于 2019-12-04 16:06:58
I have a JPA application that has specified JTA transactions in persistence.xml. For whatever reason, I have found that when using JTA, you MUST specify a JNDI data source within persistence.xml as well. This is fine, unless you are trying to go integration testing outside a container and JNDI is not available. My questions are: a) is there anyway to inject a jdbc datasource into my JTA transaction manager? b) if not, how do a handle a JNDI lookup during integration testing? Edit: The error I get when firing up the integration test is: Caused by: org.springframework......

How to Authenticate to LDAP using JNDI and Digest-MD5

为君一笑 提交于 2019-12-04 15:43:32
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 initial context. Hashtable env = new Hashtable(11); env.put(Context.SECURITY_AUTHENTICATION, "DIGEST

How do you configure a JNDI datasource in Grails 3.x?

╄→гoц情女王★ 提交于 2019-12-04 15:10:27
Grails 3 (3.0.9) app is failing to start on a TC server where another 2 Grails 2 apps using each its JNDI datasource are running fine. It seems that replicating my Grails 2 JNDI settings in Grails 3 is not working (I left everything else default and specified driverClassName, dbCreate and jndiName for my prod datasource settings). The application has no problem connecting to the MySQL database straight through JDBC. Only JNDI makes it crash with the below exception (fragment)... ERROR grails.boot.GrailsApp - Application startup failed org.springframework.beans.factory.BeanCreationException:

Externalizing tomcat jdbc connection pool information for different environments

孤者浪人 提交于 2019-12-04 15:01:21
Greetings, I'm looking for a good solution for externalizing the JNDI connection pool information in context.xml of a war so that as the application moves from dev to QA to prod, the war file won't need to be recompiled. Ideally the url, driver, username and password would be variablized and then populated by means of a properties file that would customized for each environment. If this isn't possible, are there other suggestions on how to handle moving a war across environments without recompiling for a target environment? Maven provides profiles this requires a build targeted at a specific