DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10312>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10312

JNDI Resource Params are not being set

           Summary: JNDI Resource Params are not being set
           Product: Tomcat 4
           Version: 4.0.4 Final
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I've added a custom JNDI resource factory to the server.xml:

  <Resource auth="Container" 
    name="test" 
    type="com.ibm.test.Test" />
  <ResourceParams name="test">
    <parameter>
      <name>factory</name>
      <value>com.ibm.test.TestFactory</value>
    </parameter>
  </ResourceParams>

And I've added the appropriate lines to my web.xml:

  <resource-ref>
    <res-ref-name>test</res-ref-name>
    <res-type>com.ibm.test.Test</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>

Then, when I run my code:

  InitialContext ctx = new InitialContext();
  Test test = (Test)ctx.lookup("java:comp/env/test");

I get an error stating that the resource instance could not be created.  After 
digging through the code, I found the following problem:

In org.apache.naming.factory.ResourceFactory, the following code returns a null 
when it should return the value of the factory resource param.

  RefAddr factoryRefAddr = ref.get(Constants.FACTORY);

Digging in a bit further, it would appear as if the ResourceParams are not 
being properly set at all for resources in the server.xml.  While they appear 
to be parsed and digested well enough, they never seem to make it to the 
context.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to