Wednesday, September 07, 2011

JNDI binding in JBoss

How to get a JNDI name in a DSdotXML file (-ds.xml) with a matching application reference in JBoss. Thanks to Ketan, who is awesome!

I had big problems getting this to work. I wrote about in the Adobe LiveCycle Developers Google Group: Problem with JNDI binding in JBoss (LiveCycle turnkey) and on StackOverflow: Problem with JNDI binding in JBoss (LiveCycle turnkey), but it was my friend Ketan who pointed out the solution.

I needed a jboss-web.xml:

<?xml version="1.0" encoding="UTF-8"?>

And changed the original web.xml to have:

   <description>DB Connection</description>

Which matches rmb-ds.xml

      <check-valid-connection-sql>SELECT 1 FROM sysobjects</check-valid-connection-sql>
      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
         <type-mapping>MS SQLSERVER2000</type-mapping>