Search code examples
serverjbossglassfishredhatwildfly-10

How to add custom JNDI resources into wildfly-10 similar like <custom-resource> of glassfish server?


This is the code which is use to add custom resources in glassfish server but my requirement is to achieve this in wildfly-10 server but i don't know how to do it,so please help me with this

<custom-resource
factory-class="org.glassfish.resources.custom.factory.PropertiesFactory" res- 
type="java.util.Properties" jndi-name="docdokuplm.config">
<property name="codebase" value="http://localhost:9001"></property>
<property name="vaultPath" value="/var/lib/docdoku"></property>
</custom-resource>
<custom-resource 
factory-class="org.glassfish.resources.custom.factory.PropertiesFactory" res- 
type="java.util.Properties" jndi-name="auth.config">
<property name="basic.header.enabled" value="true"></property>
<property name="session.enabled" value="true"></property>
<property name="jwt.key" value="singh20111995"></property>
<property name="jwt.enabled" value="true"></property>
</custom-resource>

Solution

  • <subsystem xmlns="urn:jboss:domain:naming:2.0">
            <bindings>
                <object-factory name="java:/docdokuplm.config" module="net.flexoptix.jbossTools" class="net.flexoptix.jbossTools.PropertiesFactory">
                    <environment>
                        <property name="vaultPath" value="/var/lib/docdoku"/>
                        <property name="codebase" value="http://localhost:8080"/>
                    </environment>
                </object-factory>
    

    you can add subsystem to add custom JNDI in wildfly.