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

JTE JCasC export reults in FAILED TO EXPORT error - ClassCastException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: subversion-plugin
    • Labels:
      None
    • Environment:
      Jenkins: 2.293
      templating-engine: 2.2.2
    • Similar Issues:

      Description

      While the plugin works as expected, trying to export its JCasC configuration results in this error:

      FAILED TO EXPORT
      org.boozallen.plugins.jte.init.governance.config.ScmPipelineConfigurationProvider#scm: java.lang.ClassCastException: class [Lhudson.scm.SubversionSCM$ModuleLocation; cannot be cast to class hudson.scm.SubversionSCM$ModuleLocation ([Lhudson.scm.SubversionSCM$ModuleLocation; and hudson.scm.SubversionSCM$ModuleLocation are in unnamed module of loader hudson.ClassicPluginStrategy$AntClassLoader2 @7ccd4b7f)
      

      The JCasC yaml output includes the full exception stacktrace.

        templateGlobalConfig:
          tier:
            configurationProvider:
              scm:
                scm: |-
                  FAILED TO EXPORT
                  org.boozallen.plugins.jte.init.governance.config.ScmPipelineConfigurationProvider#scm: java.lang.ClassCastException: class [Lhudson.scm.SubversionSCM$ModuleLocation; cannot be cast to class hudson.scm.SubversionSCM$ModuleLocation ([Lhudson.scm.SubversionSCM$ModuleLocation; and hudson.scm.SubversionSCM$ModuleLocation are in unnamed module of loader hudson.ClassicPluginStrategy$AntClassLoader2 @7ccd4b7f)
                    at hudson.scm.SubversionSCM.<init>(SubversionSCM.java:377)
                  Caused: java.lang.reflect.InvocationTargetException
                    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
                    at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:308)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:282)
                    at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:282)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
                    at io.vavr.control.Option.map(Option.java:392)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
                    at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
                    at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
                    at io.jenkins.plugins.casc.BaseConfigurator.compare(BaseConfigurator.java:391)
                    at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:311)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:282)
                    at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:282)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
                    at io.vavr.control.Option.map(Option.java:392)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
                    at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
                    at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
                    at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
                    at io.jenkins.plugins.casc.BaseConfigurator.compare(BaseConfigurator.java:391)
                    at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:311)
                    at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
                    at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
                    at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:183)
                    at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:115)
                    at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.lambda$describe$3(GlobalConfigurationCategoryConfigurator.java:108)
                    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
                    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
                    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
                    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
                    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
                    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
                    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
                    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
                    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
                    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
                    at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:108)
                    at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:33)
            librarySources:
            - libraryProvider:
                scm:
                  scm: |-
                    FAILED TO EXPORT
                    org.boozallen.plugins.jte.init.governance.libs.ScmLibraryProvider#scm: java.lang.ClassCastException: class [Lhudson.scm.SubversionSCM$ModuleLocation; cannot be cast to class hudson.scm.SubversionSCM$ModuleLocation ([Lhudson.scm.SubversionSCM$ModuleLocation; and hudson.scm.SubversionSCM$ModuleLocation are in unnamed module of loader hudson.ClassicPluginStrategy$AntClassLoader2 @7ccd4b7f)
                      at hudson.scm.SubversionSCM.<init>(SubversionSCM.java:377)
                    Caused: java.lang.reflect.InvocationTargetException
                      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
                      at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:308)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:282)
                      at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:282)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
                      at io.vavr.control.Option.map(Option.java:392)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
                      at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
                      at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
                      at io.jenkins.plugins.casc.BaseConfigurator.compare(BaseConfigurator.java:391)
                      at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:311)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:282)
                      at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:282)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:107)
                      at io.vavr.control.Option.map(Option.java:392)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:107)
                      at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:55)
                      at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
                      at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
                      at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:316)
                      at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
                      at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:257)
                      at io.jenkins.plugins.casc.BaseConfigurator.compare(BaseConfigurator.java:391)
                      at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:311)
                      at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:328)
                      at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
                      at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:183)
                      at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:115)
                      at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.lambda$describe$3(GlobalConfigurationCategoryConfigurator.java:108)
                      at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
                      at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
                      at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
                      at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
                      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
                      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
                      at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
                      at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
                      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
                      at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
                      at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:108)
                      at io.jenkins.plugins.casc.impl.configurators.GlobalConfigurationCategoryConfigurator.describe(GlobalConfigurationCategoryConfigurator.java:33)
      

        Attachments

          Activity

          Hide
          sterrana Steven Terrana added a comment -

          hello, what version of the Subversion Plugin is installed?

          Show
          sterrana Steven Terrana added a comment - hello, what version of the Subversion Plugin is installed?
          Hide
          juliohm Julio Morimoto added a comment -

          Subversion plugin 2.14.1

          Show
          juliohm Julio Morimoto added a comment - Subversion plugin 2.14.1
          Hide
          sterrana Steven Terrana added a comment -

          After looking into this, it appears some JCasC support was added in https://github.com/jenkinsci/subversion-plugin/pull/229/files.

          I'm fairly sure that this is actually a bug in the Subversion Plugin.

          There is no code in JTE whatsoever that defines Subversion configurations - it loads it from the Subversion Plugin.

          Similarly, JCasC export is handled automatically for plugins that follow certain practices.

          Given that the field being configures works when exporting a git SCM, i know that the JTE part of JCasC in this use case is functioning.

          Please open an issue with the Subversion Plugin.

          Show
          sterrana Steven Terrana added a comment - After looking into this, it appears some JCasC support was added in https://github.com/jenkinsci/subversion-plugin/pull/229/files . I'm fairly sure that this is actually a bug in the Subversion Plugin. There is no code in JTE whatsoever that defines Subversion configurations - it loads it from the Subversion Plugin. Similarly, JCasC export is handled automatically for plugins that follow certain practices. Given that the field being configures works when exporting a git SCM, i know that the JTE part of JCasC in this use case is functioning. Please open an issue with the Subversion Plugin.
          Hide
          juliohm Julio Morimoto added a comment - - edited

          Thank you.

          Show
          juliohm Julio Morimoto added a comment - - edited Thank you.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            juliohm Julio Morimoto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: