7 Replies Latest reply on Aug 18, 2004 11:55 AM by Ben Wang

    XML parsing problem with JBossCache

    fredrikoe Newbie

      Hi!

      I'm trying to run JBossCache 1.0 on Tomcat 4.0.6 but I get the following error message when executing PropertyConfigurator.config().

      The Tomcat log:

      INFO PropertyConfigurator.configure > configure(): attribute size: 11
      DEBUG PropertyConfigurator.configure > setting attribute TransactionManagerLookupClass to org.jboss.cache.DummyTransactionManagerLookup
      DEBUG PropertyConfigurator.configure > setting attribute IsolationLevel to REPEATABLE_READ
      DEBUG PropertyConfigurator.configure > setting attribute CacheMode to LOCAL
      DEBUG PropertyConfigurator.configure > setting attribute ClusterName to TreeCache-Cluster
      DEBUG PropertyConfigurator.getSubElementObject > getSubElementObject(): element object. Does not exist for config

      The Java exception:

      Caused by: java.lang.IllegalArgumentException:
      at java.beans.PropertyEditorSupport.setAsText(PropertyEditorSupport.java:138)
      at org.jboss.cache.PropertyConfigurator.configure(PropertyConfigurator.java:232)
      at org.jboss.cache.PropertyConfigurator.configure(PropertyConfigurator.java:140)


      I get the same error when using local-service.xml and replSync-service.xml.

      Does anyone have an idea what the problem is?

      Thanks.

      / Fredrik

        • 1. Re: XML parsing problem with JBossCache
          Ben Wang Master

          Hi,

          This error shows up during the parsing of the clusterConfig due to the element is empty. Have you modified your xml files at all? The other question is whether the xml files run during standalone mode (i.e., outside Tomcat).

          BTW, the handling of sub-element config is not fool proof now so I will make a note of it and enhance it next. :-)

          -Ben

          • 2. Re: XML parsing problem with JBossCache
            fredrikoe Newbie

            Thanks for the quick reply.

            I know it looks like the element is empty but I've tried with all the configuration files provided (for example local-service.xml) without modifying anything. So, the XML files should be correct.

            If I remove the whole
            tag
            I don't get this error but of course another one due to incomplete configuration. So it looks like that there is something strange inside this tag. But still, the XML file should be correct...

            / Fredrik

            • 3. Re: XML parsing problem with JBossCache
              mounikap Newbie

              Hi All,

              I am encountering same problem. Also bwang00, what do you mean by this "The other question is whether the xml files run during standalone mode "

              thanks in advance for the reply,
              Mounika

              • 4. Re: XML parsing problem with JBossCache
                Ben Wang Master

                What I meant was that can you run "build.bat run.demo" from the jboss-cache that you have downloaded? If you can, then tree cache is started correctly in standalone mode.

                Hope this help,

                -Ben

                • 5. Re: XML parsing problem with JBossCache
                  hanson lu Newbie

                  I also encountered the problem when i was testing TreeCache. My testing program is just java standalone under solaris.

                  Reason: It seems related to xerces xml parser.when i remove the xerces.jar from classpath. My test program run ok. I don't why?

                  Try remove the xerces.jar from your tomcat or your classpath.

                  • 6. Re: XML parsing problem with JBossCache
                    JEROME PICARD Newbie

                    Hi All,

                    I hade the same problem. The problem was in the org.jboss.cache.PropertyConfigurator class.

                    If you look the getSubElementObject function, you will see a mistake in the conditional test.

                    Indeed, the equality test between two String should never be with "=" sign but with the equals method.

                    this is the line :

                    if(node.getNodeType() == Node.ELEMENT_NODE &&
                     ((Element)node).getTagName() == SUB_ATTR) {
                     return (Element)node;
                     }



                    Also, if you replace with this, that's work.

                    if(node.getNodeType() == Node.ELEMENT_NODE && SUB_ATTR.equals( ((Element)node).getTagName()) ) {
                     return (Element)node;
                     }


                    With this fix, TreeCache starts correctly in standalone and application server mode.

                    Regards,

                    Jerome.


                    • 7. Re: XML parsing problem with JBossCache
                      Ben Wang Master

                      Jerome,

                      Good catch!! I will incorporate your fix into upcoming 1.1 release.

                      Thanks a lot,

                      -Ben