jndi

Code to list all the entries in jndi on remote machine

Can any one tell or point me to code to list all the jndi entries in a remote machine ...

Get Active Directory connection through glassfish jndi resource

Hello, I'm trying to get an LDAP-Connection with the attributes provided by a glassfish custom-resource. My jndi settings: Resourcetype: javax.naming.directory.Directory Factory-Class: com.sun.jndi.ldap.LdapCtxFactory Parameters: java.naming.security.credentials = myPassword java.naming.security.principal = cn=ldapUser,ou=myOrganizat...

Correct way to make datasources/resources a deploy-time setting

I have a web-app that requires two settings: A JDBC datasource A string token I desperately want to be able to deploy one .war to various different containers (jetty,tomcat,gf3 minimum) and configure these settings at application level within the container. My code does this: InitialContext ctx = new InitialContext(); Context envCt...

Accessing MySQL datasource bean in Spring

I am trying to create a datasource bean for MySQL from within my Spring project (in springtoolsuite), and I want to access the MySQL JNDI (run by JBoss application server). My Bean declaration <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton" > <property name="jndiName" value="java:/MySqlDS...

How to get specific errors when using ppolicy in LDAP from Java using JNDI

I'm using JNDI for authentication in a web app. On the OpenLDAP side I'm using ppolicy to (for example) block a user's account after three failed log in attempts. My problem is that I need specific error messages (e.g. "Account locked") to let the user know what was the specific problem but right now I'm just getting an exception when ...

How can I obtain port binding information at runtime? (JBoss 5.1)

Basically what I want to do is to obtain the port number on which JBoss is listening for HTTP requests (the one that is normally 8080). I came upon this article, which sounds promising, but unfortunately some of the links are broken and I cannot figure out the part: ManagementView managementView = getManagementView(); // via JNDI looku...

ordering of multiple jndi.properties on classpath

I have a jboss web service that is getting the wrong initial context. I want it to use the java.naming.factory.initial from the jndi.properties in the services root directory and not the one in jboss jndi.properties which is the NamingContextFactory. In the ant build file I put the jndi.properties in the classpath and made sure it copi...

Oracle Weblogic JNDI Datasource set Default Auto Commit

Hi. In my J2ee web application I am using a datasource accessed stored in the weblogic server and accessed through jndi. In normal datasource bean declaration there is a property defaultAutoCommit which can be set to false. Is there a similar property or is there a way to set something like this when using datasource in JNDI. Because cur...

How do you setup JNDI for GWT (2.0) Hosted Mode?

How do you setup a JNDI server on GWT's hosted mode (they seem to use an embedded Jetty server)? ...

Java & Tomcat: SQL JDBC/JNDI Exceptions

I am deploying a webapp from eclipse to tomcat. I am having an issue with my application and JNDI lookups. When the app tries to load the JNDI resource I am this stacktrace: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.Con...

JBoss EJB Bean not bound

Hi, I have the following error Exception in thread "main" javax.naming.NameNotFoundException: CounterBean not bound trying to access an EJB JAR CounterBean.jar deployed on JBoss5 from a client application outside the Application Server. From the Jboss log, it looks like it does not have a global JNDI name? Is this ok? What have I ...

Hibernate SessionFactory: how to configure JNDI in Tomcat?

that's how the session factory should be gotten: protected SessionFactory getSessionFactory() { try { return (SessionFactory) new InitialContext() .lookup("SessionFactory"); } catch (Exception e) { } } Please provide a simple solution for Tomcat6 to be able to get Sessi...

How to make use of jndi in a stand-alone (non-managed) application?

How to make use of jndi in a stand-alone (non-managed) application? App and Tomcat6 are on the same machine. Can we get something through jndi lookup when the server is running, but when the app is not running under this tomcat server? ...

db2 jdbc driver does not release table locks

situation: We have a web service running on tomcat accessing DB2 database on AS400, we are using JTOPEN drivers for JNDI connections handled by tomcat. For handling transactions and access to database we are using Spring. For each select system takes JDBC connection from JNDI (i.e. from connection pool), does selection, and in the end ...

Tomcat JNDI: managed stack of objects

I have a class class ObjFactory { MyObject getObject() {...} void returnObject() {...} } How can we configure Tomcat so that it would provide this factory through JNDI and manages this factory? Say, one web app should get access to this factory and it must exist only 1 factory in Tomcat, every copy of a web app references the same ...

Why bind hibernate SessionFactory to a JNDI resource?

In my current adventure of learning hibernate and setting it up to use an appserver's connection pool, most examples and resources out there point you in the direction of binding the SessionFactory to a JNDI resource in your appserver in the process. I wondering what the benefit of this is? Since the you can access a the connection pool...

Lookup of remote interface is not getting recognised in JBoss

The following code is used by IPMBaseBean.class for accessing remote interface . Object obj = iniCtx.lookup("java:/comp/env/ejb/ODIControllerSessionEJB"); In jboss-web.xml jndi-name is refered as below <ejb-ref-name>ejb/ODIControllerSessionEJB</ejb-ref-name> <jndi-name>jnp://vwhq5275.whq.ual.com:6200/ODIControllerSessionEJB</jndi-na...

Can I make a WAR depend on a JNDI entry in JBoss 5.1?

Hi. As part of an upgrade from JBoss 4.0.4 to 5.1, I am trying to get a WAR to deploy after an EAR is successfully deployed. JBoss 5.x does not support PrefixDeploymentSorter like 4.x did, which means that I have to use <depends> in the WAR's jboss-web.xml. It seems I cannot depend on the EAR itself, so I pick the last deployed EJB in...

How do I lookup a JNDI Datasource from outside a web container?

I have the following environment set up: Java 1.5 Sun Application Server 8.2 Oracle 10 XE Struts 2 Hibernate I'm interested to know how I can write code for a Java client (i.e. outside of a web application) that can reference the JNDI datasource provided by the application server. The ports for the Sun Application Server are all at ...

How to connect to MS Access 2007, from Java on a mac

I'm looking for a way to connect to a MS Access 2007 database from Java. I don't believe the ODBC way is available to me as I'm writing on a mac and will be pushing this product to Linux. The HXTT drivers also do not work with 2007. Is there a way, a tutorial, an example, etc that accomplishes this? Setting the connection as a JNDI Data...