4 Replies Latest reply on Feb 4, 2008 1:02 PM by reind

    Only 1 messages.properties files loaded in 2 WARs

    reind

      I have an EAR that contains 2 WARs. I have different messages.properties for each WAR. I've not been able to get them both to work. The message bundle first accessed seems to apply to both WARs.

      In other words, if I go to localhost:8080/a/ then the messages from a.war/WEB-INF/classes/messages.properties work. Then when I go to localhost:8080/b/ the messages for 'a' still work, but those for 'b' don't. If I access b first the situation is reversed.

      I've created a simple app that demonstrates this problem.

      I started with the registration example and then:

      1) Created two copies of the war
      2) Added WEB-INF/classes/messages.properties to each war (with different key=value pairs)
      3) Added #{messages['a']} #{messages['b']} to register.xhtml

      Wonder what's going wrong?

        • 1. Re: Only 1 messages.properties files loaded in 2 WARs
          reind

          In case this helps someone else...

          If I remove jboss-app.xml from app.ear/META-INF/ then the messages.properties file in each WAR is loaded for the appropriate context.

          With jboss-app.xml included, only one of the messages.properties files is loaded, the others are ignored.

          I'm not certain whether it is better to include jboss-app.xml or not on an app server with only a single seam application.

          • 2. Re: Only 1 messages.properties files loaded in 2 WARs
            pmuir

            what does jboss-app.xml contain in your case?

            • 3. Re: Only 1 messages.properties files loaded in 2 WARs
              reind

              pete:
              I've used the jboss-app.xml from the Registration example. I've since merged all messages into 1 properties file, which works for my project, but I've looked into it further in the hopes that it'll be of some use.

              I've created a JIRA bug and sample application:

              example app A:

              <jboss-app>
               <loader-repository>
               seam.jboss.org:loader=seam-registration
               </loader-repository>
              </jboss-app>


              example app B:
              <jboss-app>
               <loader-repository>
               seam.jboss.org:loader=zseam-registration
               </loader-repository>
              </jboss-app>
              (note "z" in 2nd loader name)

              A)
              2 Seam EARs are deployed
              with jboss-app.xml
              - only 1 messages.properties file works

              B)
              2 Seam EARs are deployed
              without jboss-app.xml
              - only 1 messages.properties file works

              C)
              1 Seam EARs is deployed
              with jboss-app.xml
              - both messages.properties files works

              D)
              1 Seam EARs is deployed
              with jboss-app.xml
              - both messages.properties files works

              n.b. This only affects one of the two EARs that are deployed.

              • 4. Re: Only 1 messages.properties files loaded in 2 WARs
                reind