users@glassfish.java.net

How to do simple JNDI String bindings?

From: <glassfish_at_javadesktop.org>
Date: Wed, 12 Nov 2008 01:27:36 PST

Hi,

recently I wanted to encourage the switch from JBoss to Glassfish for an internal server that hosts openCMS, a content management system. For configuration, you can create JNDI bindings in JBoss that the application can read out. I know that you can also do the same inside an ear file, but it's not how our system is setup at the moment.

In JBoss you can "just" deploy something similar to this, to create these entries in JNDI:

<mbean code="org.jboss.naming.JNDIBindingServiceMgr"
        name="company.config:name=core">
        <attribute name="BindingsConfig" serialDataType="jbxb">
                <jndi:bindings
                        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:jndi="urn:jboss:jndi-binding-service:1.0"
                        xs:schemaLocation="urn:jboss:jndi-binding-service:1.0 resource:jndi-binding-service_1_0.xsd">
                        <jndi:binding name="company/ldap/ldapServerName">
                                <jndi:value trim="true">ci.company.local:389</jndi:value>
                        </jndi:binding>
                </jndi:bindings>
        </attribute>
</mbean>

How can you do the same in Glassfish? With asadmin you have the create-jndi-resource, but as far as I can tell, you can only create bindings for JMS Topics and Queues. So how can you add simple configuration Strings to JNDI?

Thanks for your help,
Andreas
[Message sent by forum member 'aebbert' (aebbert)]

http://forums.java.net/jive/thread.jspa?messageID=316228