Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20070

Restore sax parser system property after XML parsing

      Checkstyle sets system property determining the sax parser implementation but doesn't clear it if it was not set. Any other plugin which uses xml parsers and doesn't have xerces on classpath will not work.

      Introduced in the 'Upgrade to digester 3' commit. I didn't check any other Static Analysis Collector plugins.

          [JENKINS-20070] Restore sax parser system property after XML parsing

          Ulli Hafner added a comment -

          I see. The dependency is inherited from the maven-plug-in. That is why the CAS plug-in does not have it on the classpath.

          I'm using the "original" Xerces version due to some class loading issues on slaves and containers when the JDK provided version could not be loaded.

          Ulli Hafner added a comment - I see. The dependency is inherited from the maven-plug-in. That is why the CAS plug-in does not have it on the classpath. I'm using the "original" Xerces version due to some class loading issues on slaves and containers when the JDK provided version could not be loaded.

          Franta Mejta added a comment -

          Well, even if all plugins have xerces, you should set the property to previous value (ie clear it) after use, right?

          Franta Mejta added a comment - Well, even if all plugins have xerces, you should set the property to previous value (ie clear it) after use, right?

          Ulli Hafner added a comment -

          Yes, of course, this is definitely a bug in my plug-in. I just wondered why Xerces is not found by other plug-ins since it is by default on my build path. (And it is also a bug in the another plug-in: it should also check the system property for an valid entry before using it like I'm doing it)

          Ulli Hafner added a comment - Yes, of course, this is definitely a bug in my plug-in. I just wondered why Xerces is not found by other plug-ins since it is by default on my build path. (And it is also a bug in the another plug-in: it should also check the system property for an valid entry before using it like I'm doing it)

          Franta Mejta added a comment -

          I'm not so sure about that. It's a system property so it should be set by the topmost component, right? That's Jenkins or jetty. If anyone needs to use different parser then he should use it directly and not override system settings. If there are any classloading issues on slaves then it should be fixed by Jenkins, no? (e.g. by using xerces system-wide)

          You see, I recently stumbled upon a similar thing. We had a servlet container (Tomcat) with several applications. One of them - for some reason - decided to disable caching (ehcache) by setting some system property. But it is a system property! It effectively disabled caching for all applications in the container. And that's why I think it's just bad.

          Franta Mejta added a comment - I'm not so sure about that. It's a system property so it should be set by the topmost component, right? That's Jenkins or jetty. If anyone needs to use different parser then he should use it directly and not override system settings. If there are any classloading issues on slaves then it should be fixed by Jenkins, no? (e.g. by using xerces system-wide) You see, I recently stumbled upon a similar thing. We had a servlet container (Tomcat) with several applications. One of them - for some reason - decided to disable caching (ehcache) by setting some system property. But it is a system property ! It effectively disabled caching for all applications in the container. And that's why I think it's just bad.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/util/SaxSetup.java
          http://jenkins-ci.org/commit/analysis-core-plugin/9c1db98e801ff2b0eb762b859ab7f5d13b6bd6c1
          Log:
          [ FIXED JENKINS-20070] Clear SAX system property afterwards.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/util/SaxSetup.java http://jenkins-ci.org/commit/analysis-core-plugin/9c1db98e801ff2b0eb762b859ab7f5d13b6bd6c1 Log: [ FIXED JENKINS-20070 ] Clear SAX system property afterwards.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/checkstyle/CheckStylePlugin.java
          http://jenkins-ci.org/commit/checkstyle-plugin/7c3d7feb48b885c48db99606b5443c45b63822f3
          Log:
          [ FIXED JENKINS-20070] Clear SAX system property afterwards.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/checkstyle/CheckStylePlugin.java http://jenkins-ci.org/commit/checkstyle-plugin/7c3d7feb48b885c48db99606b5443c45b63822f3 Log: [ FIXED JENKINS-20070 ] Clear SAX system property afterwards.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          plugin/src/main/java/hudson/plugins/findbugs/FindBugsPlugin.java
          plugin/src/main/java/hudson/plugins/findbugs/parser/FindBugsParser.java
          http://jenkins-ci.org/commit/findbugs-plugin/c28a39643bf8aff1178b91c5602ff95c3bcc6d7c
          Log:
          [ FIXED JENKINS-20070] Clear SAX system property afterwards.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: plugin/src/main/java/hudson/plugins/findbugs/FindBugsPlugin.java plugin/src/main/java/hudson/plugins/findbugs/parser/FindBugsParser.java http://jenkins-ci.org/commit/findbugs-plugin/c28a39643bf8aff1178b91c5602ff95c3bcc6d7c Log: [ FIXED JENKINS-20070 ] Clear SAX system property afterwards.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/dry/parser/DuplicationParserRegistry.java
          http://jenkins-ci.org/commit/dry-plugin/50667efb70835e1d89068bba917a68877ff575e5
          Log:
          [ FIXED JENKINS-20070] Clear SAX system property afterwards.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/dry/parser/DuplicationParserRegistry.java http://jenkins-ci.org/commit/dry-plugin/50667efb70835e1d89068bba917a68877ff575e5 Log: [ FIXED JENKINS-20070 ] Clear SAX system property afterwards.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/util/SaxSetup.java
          http://jenkins-ci.org/commit/analysis-core-plugin/b5457a8ecc62847e87aa28016de97255128c3c35
          Log:
          JENKINS-20070 Clear SAX system property afterwards.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/util/SaxSetup.java http://jenkins-ci.org/commit/analysis-core-plugin/b5457a8ecc62847e87aa28016de97255128c3c35 Log: JENKINS-20070 Clear SAX system property afterwards.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          plugin/src/test/java/hudson/plugins/findbugs/parser/FindBugsParserTest.java
          http://jenkins-ci.org/commit/findbugs-plugin/9dbc7313bfe3f624db6a6bcefdaa093ad618ddca
          Log:
          JENKINS-20070 Clear SAX system property afterwards.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: plugin/src/test/java/hudson/plugins/findbugs/parser/FindBugsParserTest.java http://jenkins-ci.org/commit/findbugs-plugin/9dbc7313bfe3f624db6a6bcefdaa093ad618ddca Log: JENKINS-20070 Clear SAX system property afterwards.

            drulli Ulli Hafner
            frantam Franta Mejta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: