0 Replies Latest reply on Dec 12, 2006 4:53 PM by todd.nash

    Accessing a java.net.url resource from JNDI

    todd.nash

      I am trying to deploy an existing application that runs on Websphere currently, to JBoss 4.0.4.ga. I am having a problem getting a url resource (java.net.url) to show up in JNDI so it can be accessed from an ejb.

      The purpose is to access a properties file from an ejb. The JNDI allows us to define the location of the properties file at deployment time.

      Any ideas on why the url resource reference doesn't show up? It doesn't show up in the JNDI tree and I get a namenotfound exception when I try to locate it in JNDI

      Here is my jboss.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC
      "-//JBoss//DTD JBOSS 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">

      <enterprise-beans>
      . . .

      <ejb-name>ReportDaemonSB</ejb-name> <local-jndi-name>ejb/ReportDaemonSBLocalHome</local-jndi-name>
      <resource-ref>
      <res-ref-name>url/globalProperties</res-ref-name>
      <jndi-name>url/eRegGlobalProperties</jndi-name>
      </resource-ref>

      </enterprise-beans>

      <resource-managers>
      <resource-manager>
      <res-name>url/globalProperties</res-name> <res-url>file:////c:/projects/testproject/global.properties</res-url>
      </resource-manager>
      </resource-managers>