[jboss-user] [JNDI and Naming] - Question on using JNDIBindingServiceMgr

Andrea Leoncini do-not-reply at jboss.com
Wed May 12 05:09:13 EDT 2010


Andrea Leoncini [http://community.jboss.org/people/andrea.leoncini] replied to the discussion

"Question on using JNDIBindingServiceMgr"

To view the discussion, visit: http://community.jboss.org/message/542520#542520

--------------------------------------------------------------
hi

I'm using jb 5, I have created a file named hostinfo-service.xml, it contains following xml:

<?xml version="1.0" encoding="UTF-8"?>
<mbean code="org.jboss.naming.JNDIBindingServiceMgr" name="jboss.apps:name=keygen">
    <attribute name="BindingsConfig" serialDataType="jbxb">
        <jndi:bindings xmlns:xs=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
                xmlns:jndi="urn:jboss:jndi-binding-service:1.0"
                xs:schemaLocation="urn:jboss:jndi-binding-service
                resource:jndi-binding-service_1_0.xsd">
            <jndi:binding name="bindproperty/address">
                <java:properties xmlns:java="urn:jboss:java-properties"
                        xmlns:xs=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
                        xs:schemaLocation="urn:jboss:java-properties
                        resource:java-properties_1_0.xsd">
                    <java:property>
                        <java:key>host.address</java:key>
                        <java:value>127.0.0.1</java:value>
                    </java:property>
                </java:properties>
            </jndi:binding>
        </jndi:bindings>
    </attribute>
</mbean>

but I can't use it: first of all when I put it in the deploy dir I don't see any kind of log as well as I touch (for example) mail-service.xml
second I get an exception (javax.naming.NameNotFoundException: address not bound) using:

     InitialContext ctx;
        Properties props = new Properties();
        try {
            ctx = new InitialContext();
            props =(Properties) ctx.lookup("bindproperty/address");
        } catch (NamingException e) {
            e.printStackTrace();
        }

is there something wrong?
any comment or suggestion?

TIA
andrea

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/542520#542520]

Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100512/bc97547c/attachment-0001.html 


More information about the jboss-user mailing list