access JRUN jndi environment vaiables from coldfusion (java)

Posted by jake on Stack Overflow See other posts from Stack Overflow or by jake
Published on 2010-03-31T14:36:13Z Indexed on 2010/06/14 19:32 UTC
Read the original article Hit count: 274

Filed under:
|
|

I want to put some instance specific configuration information in JNDI. I looked at the information here: http://www.adobe.com/support/jrun/working_jrun/jrun4_jndi_and_j2ee_enc/jrun4_jndi_and_j2ee_enc03.html

I have added this node to the web.xml:

<env-entry>
  <description>Administrator e-mail address</description>
  <env-entry-name>adminemail</env-entry-name>
  <env-entry-value>[email protected]</env-entry-value>
  <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

In coldfusion I have tried several different approaches to querying the data:

<cfset ctx = createobject("java","javax.naming.InitialContext") >

<cfset val = ctx.lookup("java:comp/env") >

That lookup returns a jrun.naming.JRunNamingContext. If i preform a lookup on ctx for the specific binding I am adding I get an error.

<cfset val = ctx.lookup("java:comp/env/adminemail") >
No such binding: adminemail 

Preforming a listBindings returns an empty jrun.naming.JRunNamingEnumeration.

<cfset val = ctx.listBindings("java:comp/env") >

I only want to put a string value (probably several) into the ENC (or any JNDI directory at this point).

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about jndi