5 Replies Latest reply on Dec 27, 2005 10:29 AM by janapoornavel

    Custom JNDI <resource> elements

    sumedh

      hi all,

      I've been doing this on Tomcat (5.5.4) standalone. I have a custom javax.naming.spi.ObjectFactory instance that I use to read custom elements in tomcat...

      for example...

      <Resource name="res/myConn"
      type="com.foo.bar.Conn"
      factory="com.foo.bar.ConnPool"
      customvar1="foo"
      customvar2="bar"/>

      So I have a class "ConnPool" which is an instance of ObjectFactory, it reads the above resource and returns me objects of type "Conn" using the "customvars". Is there any way to define such a resource and expose it to the application in JBoss?

      I'm using JBoss 4.0.2. I've already tried putting such resources in the Context.xml present in the Tomcat SAR, this doesn't seem to work though.
      I also put this resource in server.xml and get a "env" not bound exception from JBoss.

      Thanks for any help.

      Sumedh