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

When connecting to TestLink, finding error ClassCastException

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • testlink-plugin
    • TestLink installed in Windows Server 2003

      Jenkins is deployed in apache tomcat 6.x in Redhat Linux server

      When connecting to TestLink from jenkins, the following error is coming.

      Started by user Admin
      Building on master in workspace /home/nabslink/.jenkins/jobs/Jenkins-TaskLink-Plugin-Example/workspace
      Preparing TestLink client API.
      Using TestLink URL: http://xenapdev001/testlink/lib/api/xmlrpc.php

      FATAL: java.util.HashMap cannot be cast to [Ljava.lang.Object;
      java.lang.ClassCastException: java.util.HashMap cannot be cast to [Ljava.lang.Object;
      at br.eti.kinoshita.testlinkjavaapi.util.Util.castToArray(Util.java:642)
      at br.eti.kinoshita.testlinkjavaapi.TestProjectService.getTestProjectByName(TestProjectService.java:111)
      at br.eti.kinoshita.testlinkjavaapi.TestLinkAPI.getTestProjectByName(TestLinkAPI.java:485)
      at hudson.plugins.testlink.TestLinkBuilder.getTestLinkSite(TestLinkBuilder.java:246)
      at hudson.plugins.testlink.TestLinkBuilder.perform(TestLinkBuilder.java:134)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:798)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
      at hudson.model.Run.execute(Run.java:1575)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:237)

          [JENKINS-17442] When connecting to TestLink, finding error ClassCastException

          Fred Beringer added a comment -

          I'm running into the same issue with a local install of Jenkins and TestLink. Configuration looks correct on my side:

          Preparing TestLink client API.
          Using TestLink URL: http://localhost/testlink/lib/api/xmlrpc.php

          FATAL: java.util.HashMap cannot be cast to [Ljava.lang.Object;
          java.lang.ClassCastException: java.util.HashMap cannot be cast to [Ljava.lang.Object;
          at br.eti.kinoshita.testlinkjavaapi.util.Util.castToArray(Util.java:642)
          at br.eti.kinoshita.testlinkjavaapi.TestProjectService.getTestProjectByName(TestProjectService.java:111)
          at br.eti.kinoshita.testlinkjavaapi.TestLinkAPI.getTestProjectByName(TestLinkAPI.java:485)
          at hudson.plugins.testlink.TestLinkBuilder.getTestLinkSite(TestLinkBuilder.java:246)
          at hudson.plugins.testlink.TestLinkBuilder.perform(TestLinkBuilder.java:134)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
          at hudson.model.Build$BuildExecution.build(Build.java:199)
          at hudson.model.Build$BuildExecution.doRun(Build.java:160)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
          at hudson.model.Run.execute(Run.java:1516)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:236)

          Fred Beringer added a comment - I'm running into the same issue with a local install of Jenkins and TestLink. Configuration looks correct on my side: Preparing TestLink client API. Using TestLink URL: http://localhost/testlink/lib/api/xmlrpc.php FATAL: java.util.HashMap cannot be cast to [Ljava.lang.Object; java.lang.ClassCastException: java.util.HashMap cannot be cast to [Ljava.lang.Object; at br.eti.kinoshita.testlinkjavaapi.util.Util.castToArray(Util.java:642) at br.eti.kinoshita.testlinkjavaapi.TestProjectService.getTestProjectByName(TestProjectService.java:111) at br.eti.kinoshita.testlinkjavaapi.TestLinkAPI.getTestProjectByName(TestLinkAPI.java:485) at hudson.plugins.testlink.TestLinkBuilder.getTestLinkSite(TestLinkBuilder.java:246) at hudson.plugins.testlink.TestLinkBuilder.perform(TestLinkBuilder.java:134) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1516) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236)

          Bruno P. Kinoshita added a comment - - edited

          Hello @Supratim,

          Sorry for the delay. I've been busy with other project/plug-ins and couldn't find a cycle to work on Jenkins, TestLink or on this plug-in. Sorry.

          Since last Wednesday I've been working on these tools, but first I had to release a 1.9.4 testlink-java-api version. Yesterday I released another version of the testlink-java-api, 1.9.5-0. Now I'm working on these issues for 1.9.5/1.9.6.

          Thanks for confirming this issue @Fred. I'll take a look on this. Looks like a simple mismatch between the parameters of the testlink-java-api used by the plug-in, and TestLink.

          BTW, let me say that today I'm extremely happy, to receive a comment in this plug-in by you. When I wrote this plug-in, the initial version, was highly influenced by your blog entries. I was working on a telecom company, as QA engineer for the first time, and faced the need to integrate my CI jobs with the Test Management team. Not knowing much about test management, your blog was one of the most important resources. So, thank you very much!!!

          Bruno P. Kinoshita added a comment - - edited Hello @Supratim, Sorry for the delay. I've been busy with other project/plug-ins and couldn't find a cycle to work on Jenkins, TestLink or on this plug-in. Sorry. Since last Wednesday I've been working on these tools, but first I had to release a 1.9.4 testlink-java-api version. Yesterday I released another version of the testlink-java-api, 1.9.5-0. Now I'm working on these issues for 1.9.5/1.9.6. Thanks for confirming this issue @Fred. I'll take a look on this. Looks like a simple mismatch between the parameters of the testlink-java-api used by the plug-in, and TestLink. BTW, let me say that today I'm extremely happy, to receive a comment in this plug-in by you. When I wrote this plug-in, the initial version, was highly influenced by your blog entries. I was working on a telecom company, as QA engineer for the first time, and faced the need to integrate my CI jobs with the Test Management team. Not knowing much about test management, your blog was one of the most important resources. So, thank you very much!!!

          Bruno P. Kinoshita added a comment - - edited

          Bug confirmed when using the plug-in with TestLlink 1.9.6. Apparently, TestLink XML-RPC method getTestProjectByName, which used to return an array, is now returning a map.

          Please see [1] to track the changes, but probably tomorrow (Saturday) it will be fixed in trunk, and a release is to be cut in the next days.

          Thanks!

          [1] https://github.com/kinow/testlink-java-api/issues/12

          Bruno P. Kinoshita added a comment - - edited Bug confirmed when using the plug-in with TestLlink 1.9.6. Apparently, TestLink XML-RPC method getTestProjectByName, which used to return an array, is now returning a map. Please see [1] to track the changes, but probably tomorrow (Saturday) it will be fixed in trunk, and a release is to be cut in the next days. Thanks! [1] https://github.com/kinow/testlink-java-api/issues/12

          Code changed in jenkins
          User: Bruno P. Kinoshita
          Path:
          pom.xml
          http://jenkins-ci.org/commit/testlink-plugin/b75daa2edbfdaf4cac83c90bf003f940bf4d917a
          Log:
          [FIXED JENKINS-17442] updated testlink-java-api to 1.9.6-0, which fixes the communication issue

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: pom.xml http://jenkins-ci.org/commit/testlink-plugin/b75daa2edbfdaf4cac83c90bf003f940bf4d917a Log: [FIXED JENKINS-17442] updated testlink-java-api to 1.9.6-0, which fixes the communication issue

          Fred Beringer added a comment -

          Hey Bruno, thanks for the quick fix! Need to find some time to test it this week.

          Happy to have influenced you one way or another But you're doing the real work here for the software testing community, so thanks for this!

          Fred

          Fred Beringer added a comment - Hey Bruno, thanks for the quick fix! Need to find some time to test it this week. Happy to have influenced you one way or another But you're doing the real work here for the software testing community, so thanks for this! Fred

          Hi Fred. I'll cut a new release with this fix included tomorrow, but it takes a few hours for the backend infrastructure to update the Jenkins update site.

          Let me know if you need anything in the meantime.

          Thanks!
          Bruno

          Bruno P. Kinoshita added a comment - Hi Fred. I'll cut a new release with this fix included tomorrow, but it takes a few hours for the backend infrastructure to update the Jenkins update site. Let me know if you need anything in the meantime. Thanks! Bruno

          Hi Bruno,

          I am new to TestLink plugin. I am not sure, how to implement the new change. I have upgraded the TestLink plugin in jenkins. Still the same issue. Can you please guide me in the same.

          Supratim Samanta added a comment - Hi Bruno, I am new to TestLink plugin. I am not sure, how to implement the new change. I have upgraded the TestLink plugin in jenkins. Still the same issue. Can you please guide me in the same.

          Hi @Supratim,

          When we commit our code to Jenkins repositories at GitHub, usually we include special tokens (JENKINS-9999, or [FIXED JENKINS-9999]. Jenkins has some backend jobs that read the commit log and resolve and stop the progress on the issues. Then the plug-in maintainer releases a new version and, once it's released, he/she closes the issues.

          I've just released Jenkins TestLink Plug-in 3.3, this new version includes the fix for this issue. Keep an eye on @jenkins_release and once you see TestLink Plug-in there, update your Jenkins instance and the issue should be gone.

          Let me know if that works, ok? Cheers, Bruno

          Bruno P. Kinoshita added a comment - Hi @Supratim, When we commit our code to Jenkins repositories at GitHub, usually we include special tokens ( JENKINS-9999 , or [FIXED JENKINS-9999] . Jenkins has some backend jobs that read the commit log and resolve and stop the progress on the issues. Then the plug-in maintainer releases a new version and, once it's released, he/she closes the issues. I've just released Jenkins TestLink Plug-in 3.3, this new version includes the fix for this issue. Keep an eye on @jenkins_release and once you see TestLink Plug-in there, update your Jenkins instance and the issue should be gone. Let me know if that works, ok? Cheers, Bruno

          Fixed in 3.3

          Bruno P. Kinoshita added a comment - Fixed in 3.3

          Thanks for the understanding. Really appreciate it.

          The release 3.3 is not available for update. When will it be available??

          Supratim Samanta added a comment - Thanks for the understanding. Really appreciate it. The release 3.3 is not available for update. When will it be available??

          Fred Beringer added a comment -

          Supratim, the new version is available in the update tab of your Jenkins instance. Playing with it as I type

          Fred Beringer added a comment - Supratim, the new version is available in the update tab of your Jenkins instance. Playing with it as I type

          No worries

          Maybe you have to click check for updates button, or manually install it.

          Check the plug-in Wiki page [1]. 3.3 is already the latest version.

          HTH,

          [1] https://wiki.jenkins-ci.org/display/JENKINS/TestLink+Plugin

          Bruno P. Kinoshita added a comment - No worries Maybe you have to click check for updates button, or manually install it. Check the plug-in Wiki page [1] . 3.3 is already the latest version. HTH, [1] https://wiki.jenkins-ci.org/display/JENKINS/TestLink+Plugin

          Hi Bruno,

          In a first time great job, I use your plugin for my projects, so thanks a lot!

          But I think the problem is not fixed with the 3.3 version. I fact i had to downgrade to the october version of your plugin to have the issue fixed .

          Thanks again for your job

          Jeanjean LaGuigne added a comment - Hi Bruno, In a first time great job, I use your plugin for my projects, so thanks a lot! But I think the problem is not fixed with the 3.3 version. I fact i had to downgrade to the october version of your plugin to have the issue fixed . Thanks again for your job

          Hi @Jeanjean!

          Thanks for the compliments

          Weird. Are you using TestLink 1.9.6 with Jenkins TestLink Plug-in 3.3?

          Thanks again!

          Bruno P. Kinoshita added a comment - Hi @Jeanjean! Thanks for the compliments Weird. Are you using TestLink 1.9.6 with Jenkins TestLink Plug-in 3.3? Thanks again!

          Ho no, I am using TestLink 1.9.5 and 1.9.2.
          There are some compatibility issues?

          Jeanjean LaGuigne added a comment - Ho no, I am using TestLink 1.9.5 and 1.9.2. There are some compatibility issues?

          Yup, check the compatibility matrix in the plug-in Wiki [1]

          Unfortunately you have to stick to a specific version of the plug-in, until you're able to update your TestLink instance.

          Reasons for not having compatibility between versions include:

          • Newer version of the plug-in may use new features in TestLink.
          • Methods changed/removed/etc in TestLink XML-RPC API (this was, by the way, what was causing this bug :=)
          • Bugs in the PHP XML-RPC API, or in the Java API (testlink-java-api)
          • My laziness (and lack of time) for hacking an extra abstraction layer for this

          Sorry for not being able to be of more help. If you're ok with it, I'll close the issue again, ok?

          Thanks!

          [1] https://wiki.jenkins-ci.org/display/JENKINS/TestLink+Plugin#TestLinkPlugin-CompatibilityMatrix

          Bruno P. Kinoshita added a comment - Yup, check the compatibility matrix in the plug-in Wiki [1] Unfortunately you have to stick to a specific version of the plug-in, until you're able to update your TestLink instance. Reasons for not having compatibility between versions include: Newer version of the plug-in may use new features in TestLink. Methods changed/removed/etc in TestLink XML-RPC API (this was, by the way, what was causing this bug :=) Bugs in the PHP XML-RPC API, or in the Java API (testlink-java-api) My laziness (and lack of time) for hacking an extra abstraction layer for this Sorry for not being able to be of more help. If you're ok with it, I'll close the issue again, ok? Thanks! [1] https://wiki.jenkins-ci.org/display/JENKINS/TestLink+Plugin#TestLinkPlugin-CompatibilityMatrix

          Ok, thanks for your fast answers!
          Of course we can close this issue ^^

          Jeanjean LaGuigne added a comment - Ok, thanks for your fast answers! Of course we can close this issue ^^

          Thanks for understanding!
          Let me know if you need anything else.

          Cheers, B

          Bruno P. Kinoshita added a comment - Thanks for understanding! Let me know if you need anything else. Cheers, B

          Yes I have a little thing to ask you ^^

          I wondered if it was possible to add test results in Notes under Testlink (especially a failure message of the testCase) for this I think we need to edit the file JUnitCaseClassNameResultSeeker.java (with the method "getJUnitNotes").

          But I don't know how, could you plz help me again ?

          Jeanjean LaGuigne added a comment - Yes I have a little thing to ask you ^^ I wondered if it was possible to add test results in Notes under Testlink (especially a failure message of the testCase) for this I think we need to edit the file JUnitCaseClassNameResultSeeker.java (with the method "getJUnitNotes"). But I don't know how, could you plz help me again ?

          No it's done!

          Cheers, Jeanjean

          Jeanjean LaGuigne added a comment - No it's done! Cheers, Jeanjean

          Was going to comment here, but glad you've already found the solution. Feel free to drop me a message or file new issues if you have any problem

          All the best, and have fun with the plug-in
          /B

          Bruno P. Kinoshita added a comment - Was going to comment here, but glad you've already found the solution. Feel free to drop me a message or file new issues if you have any problem All the best, and have fun with the plug-in /B

          TestLink is used a lot in entreprise. But when a tester needs to analyse 200 tests failed, it's not convenient to open 200 files ".xml". So what do you think to add this in your new release :

          JUnitCaseClassNameResultSeeker.java --> "getJUnitNotes(CaseResult testCase)" --> notes.append(testCase.getErrorStackTrace());

          Jeanjean LaGuigne added a comment - TestLink is used a lot in entreprise. But when a tester needs to analyse 200 tests failed, it's not convenient to open 200 files ".xml". So what do you think to add this in your new release : JUnitCaseClassNameResultSeeker.java --> "getJUnitNotes(CaseResult testCase)" --> notes.append(testCase.getErrorStackTrace());

          That's definitely doable could you file a new issue, and we'll move the discussion there. Maybe we can even include it in 3.4 (scheduled for this weekend or next week).

          Thanks!!!

          Bruno P. Kinoshita added a comment - That's definitely doable could you file a new issue, and we'll move the discussion there. Maybe we can even include it in 3.4 (scheduled for this weekend or next week). Thanks!!!

          Hi, I was not here last weekend, sorry!
          We could do this this week.

          Cheers!

          Jeanjean LaGuigne added a comment - Hi, I was not here last weekend, sorry! We could do this this week. Cheers!

            kinow Bruno P. Kinoshita
            supratim Supratim Samanta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: