3 Replies Latest reply on Dec 23, 2009 5:56 AM by jaikiran

    Cannot read properties file after JBoss Republish

      Hello everyone,

      I have an EAR Application running on JBoss 5 AS. In one of the Beans I want to read data from properties file, that is stored in META-INF folder.

      URL url = this.getClass().getClassLoader().getResource("META-INF/bean.properties");
      System.out.println("URL FROM BEAN: " + url);

      After initial JBoss start works everything fine, but after republish ClassLoader.getResource(..) retrieves null. What does happen after republish? The properties file has not been moved or altered.

      How can I fix that? Does have anyone an idea?

      Thanks in advance.
      myklynysh
        • 1. Re: Cannot read properties file after JBoss Republish
          jaikiran
          How do you republish? Do you republish just the ejb jar or the entire .ear? Which exact version of JBoss AS-5?
          • 2. Re: Cannot read properties file after JBoss Republish

            I use JBoss 5.1.0.GA and my application is defined as ear with two jar inside: for beans und beanClients. In one of the jar in side the folder META-INF exists bean.properties file.

            If I change something unimportant in the bean like commets and do in Server View "republish", the cope snip with reading of URL of bean.properties file stops to work (returns null).

            • 3. Re: Cannot read properties file after JBoss Republish
              jaikiran

              myklynysh wrote:

               


              If I change something unimportant in the bean like commets and do in Server View "republish", the cope snip with reading of URL of bean.properties file stops to work (returns null).

              So you seem to be using some IDE to "replubish". I am not sure how the IDE handles the "republish". Which IDE do you use? Can you try to reproduce this issue without using the IDE? By just redeploying the application manually.