2 Replies Latest reply on Oct 12, 2005 1:32 PM by bigre

    Custom JNDI Resource Factories

    anjelinio

      Hi, I'm trying to migrate a web app from Tomcat 5.0.25 onto JBoss 3.2

      On my original deployment, I had a custom JNDI resource, with a custom ResourceFactory class thaht initialized the instance.

      I configured that using server.xml with the following code snippet:

      <Resource name="messaging/MessageResolver" auth="Container" type="gr.talent.messaging.http.server.components.ResolverImpl"/>
      
       <ResourceParams name="messaging/MessageResolver">
       <parameter>
       <name>factory</name>
       <value>gr.talent.messaging.http.server.components.ResolverFactory</value>
       </parameter>
       <parameter>
       <!--
       Defines the directory under which all the channels will save their configuration
       files. The dir structure is of type <system dir>/<channel-name>/<channel-name>-config.xml
       -->
       <name>systemConfigPath</name>
       <value>/projects/dataman/res/server</value>
       </parameter>
      
       </ResourceParams>


      Then , I modified my web.xml file to include the following:

      <resource-env-ref>
       <description>
       Resolver for IHandler instances.
       </description>
      
       <resource-env-ref-name>
       messaging/MessageResolver
       </resource-env-ref-name>
      
       <resource-env-ref-type>
       gr.talent.messaging.http.server.components.ResolverImpl
       </resource-env-ref-type>
       </resource-env-ref>


      ... and that worked like a charm :]

      Unfortunately, now that I'm trying to deploy on JBoss I've not the slightest clue as to how to configure JBoss to achieve the same effect.

      Any pointers will be GREATLY appreciated !!!

      Cheers,
      Angel
      O:]

        • 1. Re: Custom JNDI Resource Factories
          genman


          There is a jboss-web.xml that you put this stuff into, which goes into xxx.war/META-INF. There should be a DTD you can look at someplace...

          • 2. Re: Custom JNDI Resource Factories
            bigre

            I am in the same boat here. We have an application deployed to Websphere in which we created "Resource Environment Provider" that is map at deployment time to the <resource-env-ref> in the web.xml.

            The DTD for jboss-web.xml is specifiying
            <resource-env-ref>
            <resource-env-ref-name></resource-env-ref-name>
            <jndi-name></jndi-name>
            </resource-env-ref>

            Where would I specify the parameter "systemConfigPath" in jboss-web.xml in the example below.

            My guess is that I need to create an xml file like I do for my datasources (oracle-ds.xml). Anyone has an example of such an XML file that could be used for a Custom Factory? It would really help.

            Thanks