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

How can I use a pluging(developed in higher version) in a lower version of Jenkins.

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Major Major
    • other
    • Jenkins ver. 1.629
      Windows 7
      Firefox 38.4
      JDK 1.8
      Maven 3.3.3

      Hi Team,

      I have build a plugin in Jenkins for automated deployment to DataPower. I developed the plugin using the below environment.
      Jenkins ver. 1.631
      Windows 7
      Firefox 38.4
      JDK 1.8
      Maven 3.3.3

      Now I an trying to install the plugin in below environment.
      Jenkins ver. 1.629
      Mac 10.10.5
      Firefox 38.4
      JDK 1.8
      Maven 3.3.3

      The plugin get installed, but while I try to add the details in the plugin, like DataPower URL, user credential e.t.c and save it, Jenkins give the below error:

      A problem occurred while processing the request. Please check our bug tracker to see if a similar problem has already been reported. If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem. If you think this is a new issue, please file a new issue. When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins. The users list might be also useful in understanding what has happened.
      Stack trace

      javax.servlet.ServletException: java.lang.NullPointerException
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:123)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
      at testjenkins.dp_soma.debug(dp_soma.java:731)
      at testjenkins.dp_soma$DescriptorImpl.dumpProps(dp_soma.java:664)
      at testjenkins.dp_soma$DescriptorImpl.configure(dp_soma.java:654)
      at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:2931)
      at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:2894)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      ... 60 more

          [JENKINS-31872] How can I use a pluging(developed in higher version) in a lower version of Jenkins.

          Oleg Nenashev added a comment -

          Hi,

          Jenkins plugins are not designed for such use-case.
          If you want to use the plugin on 1.629, the best way is to update the core specification in your plugin's POM file.
          It's possible to manually install the plugin on your own risk, but it's not a recommended practice.

          BTW it's a bug in your plugin from what I see:

          Caused by: java.lang.NullPointerException
          at testjenkins.dp_soma.debug(dp_soma.java:731)
          at testjenkins.dp_soma$DescriptorImpl.dumpProps(dp_soma.java:664)
          at testjenkins.dp_soma$DescriptorImpl.configure(dp_soma.java:654)
          at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:2931)
          at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:2894)
          

          Oleg Nenashev added a comment - Hi, Jenkins plugins are not designed for such use-case. If you want to use the plugin on 1.629, the best way is to update the core specification in your plugin's POM file. It's possible to manually install the plugin on your own risk, but it's not a recommended practice. BTW it's a bug in your plugin from what I see: Caused by: java.lang.NullPointerException at testjenkins.dp_soma.debug(dp_soma.java:731) at testjenkins.dp_soma$DescriptorImpl.dumpProps(dp_soma.java:664) at testjenkins.dp_soma$DescriptorImpl.configure(dp_soma.java:654) at jenkins.model.Jenkins.configureDescriptor(Jenkins.java:2931) at jenkins.model.Jenkins.doConfigSubmit(Jenkins.java:2894)

          Below is the content of my POM file. I have tried editing it and added the older version as well. But still it is giving the same error.
          Could you help me identify any missing element here?

          <?xml version="1.0" encoding="UTF-8"?>
          <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
          <modelVersion>4.0.0</modelVersion>

          <parent>
          <groupId>org.jenkins-ci.plugins</groupId>
          <artifactId>plugin</artifactId>
          <!-- Baseline Jenkins version you use to build and test the plugin. Users must have this version or newer to run. -->
          <version>1.580.1</version>
          <relativePath/>
          </parent>
          <groupId>deploy</groupId>
          <artifactId>Datapower_Deploy</artifactId>
          <version>3.3</version>
          <packaging>hpi</packaging>

          <build>
          <directory>target</directory>
          <outputDirectory>target/classes</outputDirectory>
          <finalName>${project.artifactId}-${project.version}</finalName>
          <testOutputDirectory>target/test-classes</testOutputDirectory>
          <sourceDirectory>src/main/java</sourceDirectory>
          <resources>
          <resource>
          <directory>src/main/resources</directory>
          </resource>
          </resources>

          <plugins>
          <plugin>
          <groupId>org.jenkins-ci.tools</groupId>
          <artifactId>maven-hpi-plugin</artifactId>
          <extensions>true</extensions>
          <configuration>
          <compatibleSinceVersion>1.0</compatibleSinceVersion>
          </configuration>
          </plugin>
          </plugins>

          </build>

          <name>DataPower_Deploy</name>
          <description>Continuous Integration for DataPower</description>
          <url>https://wiki.jenkins-ci.org/display/JENKINS/DataPower+Plugin</url>
          <licenses>
          <license>
          <name>MIT License</name>
          <url>http://opensource.org/licenses/MIT</url>
          </license>
          </licenses>
          <!-- If you want this to appear on the wiki page: -->
          <developers>
          <developer>
          <id>saptarshimandal</id>
          <name>Saptarshi Mandal</name>
          <email>saptarshimandal@aol.in</email>
          </developer>
          </developers>

          <!-- Assuming you want to host on @jenkinsci:
          <scm>
          <connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
          <developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
          <url>http://github.com/jenkinsci/${project.artifactId}-plugin</url>
          </scm>
          -->
          <repositories>
          <repository>
          <id>repo.jenkins-ci.org</id>
          <url>http://repo.jenkins-ci.org/public/</url>
          </repository>
          </repositories>
          <pluginRepositories>
          <pluginRepository>
          <id>repo.jenkins-ci.org</id>
          <url>http://repo.jenkins-ci.org/public/</url>
          </pluginRepository>
          </pluginRepositories>
          <!-- If you want to depend on other plugins:
          <dependencies>
          <dependency>
          <groupId>org.jenkins-ci.plugins</groupId>
          <artifactId>credentials</artifactId>
          <version>1.9.4</version>
          </dependency>
          </dependencies>
          -->

          </project>

          SAPTARSHI MANDAL added a comment - Below is the content of my POM file. I have tried editing it and added the older version as well. But still it is giving the same error. Could you help me identify any missing element here? <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.jenkins-ci.plugins</groupId> <artifactId>plugin</artifactId> <!-- Baseline Jenkins version you use to build and test the plugin. Users must have this version or newer to run. --> <version>1.580.1</version> <relativePath/> </parent> <groupId>deploy</groupId> <artifactId>Datapower_Deploy</artifactId> <version>3.3</version> <packaging>hpi</packaging> <build> <directory>target</directory> <outputDirectory>target/classes</outputDirectory> <finalName>${project.artifactId}-${project.version}</finalName> <testOutputDirectory>target/test-classes</testOutputDirectory> <sourceDirectory>src/main/java</sourceDirectory> <resources> <resource> <directory>src/main/resources</directory> </resource> </resources> <plugins> <plugin> <groupId>org.jenkins-ci.tools</groupId> <artifactId>maven-hpi-plugin</artifactId> <extensions>true</extensions> <configuration> <compatibleSinceVersion>1.0</compatibleSinceVersion> </configuration> </plugin> </plugins> </build> <name>DataPower_Deploy</name> <description>Continuous Integration for DataPower</description> <url> https://wiki.jenkins-ci.org/display/JENKINS/DataPower+Plugin </url> <licenses> <license> <name>MIT License</name> <url> http://opensource.org/licenses/MIT </url> </license> </licenses> <!-- If you want this to appear on the wiki page: --> <developers> <developer> <id>saptarshimandal</id> <name>Saptarshi Mandal</name> <email>saptarshimandal@aol.in</email> </developer> </developers> <!-- Assuming you want to host on @jenkinsci: <scm> <connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection> <developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection> <url> http://github.com/jenkinsci/$ {project.artifactId}-plugin</url> </scm> --> <repositories> <repository> <id>repo.jenkins-ci.org</id> <url> http://repo.jenkins-ci.org/public/ </url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>repo.jenkins-ci.org</id> <url> http://repo.jenkins-ci.org/public/ </url> </pluginRepository> </pluginRepositories> <!-- If you want to depend on other plugins: <dependencies> <dependency> <groupId>org.jenkins-ci.plugins</groupId> <artifactId>credentials</artifactId> <version>1.9.4</version> </dependency> </dependencies> --> </project>

          Oleg Nenashev added a comment -

          I recommend to debug your plugin and to see what happens there.
          I doubt it's a Jenkins issue.

          If you publish the source codes somewhere like GitHub, I can check what happens there

          Oleg Nenashev added a comment - I recommend to debug your plugin and to see what happens there. I doubt it's a Jenkins issue. If you publish the source codes somewhere like GitHub, I can check what happens there

          If it is a problem with the plugin, then it should fail everywhere.
          It runs perfectly in Jenkins ver. 1.631. Really wired why it is not running in Jenkins ver. 1.629.

          SAPTARSHI MANDAL added a comment - If it is a problem with the plugin, then it should fail everywhere. It runs perfectly in Jenkins ver. 1.631. Really wired why it is not running in Jenkins ver. 1.629.

          Oleg Nenashev added a comment -

          Sorry, I cannot propose anything without a code. No info to analyze

          Oleg Nenashev added a comment - Sorry, I cannot propose anything without a code. No info to analyze

          SAPTARSHI MANDAL added a comment - Here is the code: https://github.com/saptarshimandal/do_soma/blob/master/dp_soma.java

          Hi Oleg,

          Is there any update on it?

          Cheers,
          Saptarshi

          SAPTARSHI MANDAL added a comment - Hi Oleg, Is there any update on it? Cheers, Saptarshi

          Oleg Nenashev added a comment -

          In your code logStream is not being initialized from what I see.
          Closing the issue as it's not related to Jenkins open-source plugins

          Oleg Nenashev added a comment - In your code logStream is not being initialized from what I see. Closing the issue as it's not related to Jenkins open-source plugins

            oleg_nenashev Oleg Nenashev
            saptarshimandal SAPTARSHI MANDAL
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: