0 Replies Latest reply on Jul 28, 2004 5:22 PM by Jay Choi

    registering my own object to JNDI service..

    Jay Choi Newbie

      Hi, all..

      What I am trying to is that I want my class called PageMethodStaticXMLData which reads a xml file and to be used by all process, etc SessionBeans, Servlets..

      I created PageMethodStaticXMLData class to read and parse a xml data which is just a static lookup information and then trying to registered as a resource in ejb-jar.xml as the following:

      <resource-env-ref>
      <resource-env-ref-name>staticXMLData</resource-env-ref-name>
      <resource-env-ref-type>com.etn.data.PageMethodStaticXMLData</resource-env-ref-type>
      </resource-env-ref>
      


      then from a session bean trying to look it up as the following:
      Context initial = new InitialContext();
      PageMethodStaticXMLData data = (PageMethodStaticXMLData)initial.lookup("java:/staticXMLData");
      


      during the runtime, I get this message when the above code executed:
      javax.naming.NameNotFoundException: staticXMLData not bound
      


      So I am wondering if it is not possible to registered a custom class as a JNDI resource to be shared by SessionBeans & servlets or not..
      If it is possible, where did I go wrong here..??

      Thanks very much..