2 Replies Latest reply on May 2, 2007 4:16 AM by seany123

    Properties not visible to WebApp

    seany123

      Hi,

      I'm having a little trouble getting my app to resolve properties. This is compounded by the fact that the properties are loaded by a 3rd party library out of my control.

      My code layout is as follows:

      EAR [
      ...common.jar
      ...webapp.war
      ...ejb.jar
      ...library1.jar
      ...library2.jar
      ... (other libraries)
      ...Properties.xml
      ]

      The problem is that the webapp is using library1.jar (implicitly) to load Properties.xml but cannot "see" it. If I place Properties.xml in webapp.war (under WEB-INF/classes) it loads.

      Is there a setting etc I can use in either jboss-app.xml or jboss-web.xml (or something else) to allow the webapp.war to "see" these properties files?


      many thanks,

      Sean

      
      
      


        • 1. Re: Properties not visible to WebApp
          amit_despande

          Hi,
          Actually your problem is because of class loaders as your war file will have different class loader allocated by tomcat so you will not be able to load your properties file from outside of war file.
          the file jboss-service.xml residing in jbossweb-tomcat55.sar\META-INF contains two different options as

          "<attribute name="Java2ClassLoadingCompliance">false</attribute>"

          and
          "<attribute name="UseJBossWebLoader">false</attribute>"

          if you make these values to true then it will tell the jboss that war won't be having different class loaders anymore. But making these values to true is not a good practice

          regards
          Amit

          • 2. Re: Properties not visible to WebApp
            seany123

            Hi amit_despande,

            Thank you for your response, -your suggestion did the trick!

            thanks,

            Seam