2 Replies Latest reply on Sep 17, 2002 5:09 PM by madalin

    Please help! Petstore JNDI exception

    madalin

      Hi,

      I am trying to use the Petstore 1.1.2 in Jboss 3.0.0 with Tomcat environment. I think is something wrong with the JNDI settings, because when I am trying to read the xml screen definitions and mappings configuration from files, it is failing with a "ScreenFlowXmlDAO error: java.net.MalformedURLException: unknown protocol: jndi".

      The code is:

      String requestMappingsURL = null;
      try {
      requestMappingsURL = getServletContext().getResource("/WEB-INF/xml/requestmappings.xml").toString();
      } catch (java.net.MalformedURLException ex) {}

      and the value of requestMappingsURL is:

      "requestMappingsURL"= "jndi:/localhost/WEB-INF/xml/requestmappings.xml"

      Later when I am trying to use this string as URL is throwing the MalformedURLException....

      Please help:)
      It is simply killing me!!!!

        • 1. Re: Please help! Petstore JNDI exception
          faisalab

          I Know ....It gave me headache too .From what I gathered -for some reasons Jboss is no letting Tomcat load the xml files in WEB-INF(may be). What u have to do is to copy the xml files in WEB-INF\classes than u HAVE to use
          URL url = Thread.currentThread().getContextClassLoader().getResource(" .xml").IN get Resource put just the name of the xml file not the URL ex: getResource("mappings.xml")
          Good luck
          Faisal Abdallah

          • 2. Re: Please help! Petstore JNDI exception
            madalin

            Thank You. I fixed meantime, I found out that if You are not converting the URL to string and use only URL is working great.