Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1487

ClassCastException in Eclipse 4.4.1

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0-RC1
    • Fix Version/s: 2.4.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux, Eclipse 4.4.1.M20140829-0500, Oracle JDK 1.7.0_55

      Description

      problem

      When trying to use IvyDE within Eclipse 4.4.1 the following Exception happens which renders IvyDE unusable:

      An internal error occurred during: "IvyDE resolve".
      
      java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String
      	at org.apache.ivy.core.settings.IvySettings.addAllVariables(IvySettings.java:610)
      	at org.apache.ivy.core.settings.IvySettings.addAllVariables(IvySettings.java:604)
      	at org.apache.ivy.core.settings.IvySettings.addSystemProperties(IvySettings.java:308)
      	at org.apache.ivy.core.settings.IvySettings.<init>(IvySettings.java:303)
      	at org.apache.ivy.core.settings.IvySettings.<init>(IvySettings.java:222)
      	at org.apache.ivyde.internal.eclipse.CachedIvy.createIvySettings(CachedIvy.java:235)
      	at org.apache.ivyde.internal.eclipse.CachedIvy.getIvyFromFile(CachedIvy.java:200)
      	at org.apache.ivyde.internal.eclipse.CachedIvy.doGetIvy(CachedIvy.java:163)
      	at org.apache.ivyde.internal.eclipse.CachedIvy.getIvy(CachedIvy.java:124)
      	at org.apache.ivyde.internal.eclipse.resolve.IvyResolveJob.doRun(IvyResolveJob.java:145)
      	at org.apache.ivyde.internal.eclipse.resolve.IvyResolveJob.run(IvyResolveJob.java:85)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      
      

        Issue Links

          Activity

          Hide
          Willian Willian Constâncio da Silva added a comment - - edited

          This happens even in the trunk version of IvyDE and Eclipse:

          java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String
          	at org.apache.ivy.core.settings.IvySettings.addAllVariables(IvySettings.java:610)
          	at org.apache.ivy.core.settings.IvySettings.addAllVariables(IvySettings.java:604)
          	at org.apache.ivy.core.settings.IvySettings.addSystemProperties(IvySettings.java:308)
          	at org.apache.ivy.core.settings.IvySettings.<init>(IvySettings.java:303)
          	at org.apache.ivy.core.settings.IvySettings.<init>(IvySettings.java:222)
          	at org.apache.ivyde.internal.eclipse.workspaceresolver.WorkspaceIvySettings.<init>(WorkspaceIvySettings.java:30)
          	at org.apache.ivyde.internal.eclipse.CachedIvy.createIvySettings(CachedIvy.java:226)
          	at org.apache.ivyde.internal.eclipse.CachedIvy.getIvyFromFile(CachedIvy.java:200)
          	at org.apache.ivyde.internal.eclipse.CachedIvy.doGetIvy(CachedIvy.java:163)
          	at org.apache.ivyde.internal.eclipse.CachedIvy.getIvy(CachedIvy.java:124)
          	at org.apache.ivyde.internal.eclipse.CachedIvy.getCachedIvy(CachedIvy.java:102)
          	at org.apache.ivyde.internal.eclipse.ui.menu.IvyMenuContributionItem.getContributionItems(IvyMenuContributionItem.java:171)
          	at org.eclipse.ui.actions.CompoundContributionItem.getContributionItemsToFill(CompoundContributionItem.java:89)
          	...
          

          Environment:
          Windows 7 64 bits
          Eclipse Mars I20140918-0330
          Apache Ivy 2.5.0.alpha_20140513011703
          Apache IvyDE 2.3.0.beta1-201405042018-hudson-287
          Oracle JDK 1.7.0_45

          Show
          Willian Willian Constâncio da Silva added a comment - - edited This happens even in the trunk version of IvyDE and Eclipse: java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang. String at org.apache.ivy.core.settings.IvySettings.addAllVariables(IvySettings.java:610) at org.apache.ivy.core.settings.IvySettings.addAllVariables(IvySettings.java:604) at org.apache.ivy.core.settings.IvySettings.addSystemProperties(IvySettings.java:308) at org.apache.ivy.core.settings.IvySettings.<init>(IvySettings.java:303) at org.apache.ivy.core.settings.IvySettings.<init>(IvySettings.java:222) at org.apache.ivyde.internal.eclipse.workspaceresolver.WorkspaceIvySettings.<init>(WorkspaceIvySettings.java:30) at org.apache.ivyde.internal.eclipse.CachedIvy.createIvySettings(CachedIvy.java:226) at org.apache.ivyde.internal.eclipse.CachedIvy.getIvyFromFile(CachedIvy.java:200) at org.apache.ivyde.internal.eclipse.CachedIvy.doGetIvy(CachedIvy.java:163) at org.apache.ivyde.internal.eclipse.CachedIvy.getIvy(CachedIvy.java:124) at org.apache.ivyde.internal.eclipse.CachedIvy.getCachedIvy(CachedIvy.java:102) at org.apache.ivyde.internal.eclipse.ui.menu.IvyMenuContributionItem.getContributionItems(IvyMenuContributionItem.java:171) at org.eclipse.ui.actions.CompoundContributionItem.getContributionItemsToFill(CompoundContributionItem.java:89) ... Environment: Windows 7 64 bits Eclipse Mars I20140918-0330 Apache Ivy 2.5.0.alpha_20140513011703 Apache IvyDE 2.3.0.beta1-201405042018-hudson-287 Oracle JDK 1.7.0_45
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user cpfeiffer opened a pull request:

          https://github.com/apache/ant-ivy/pull/1

          IVYDE-372: fix ClassCastException: System properties may not be strings

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/cpfeiffer/ant-ivy IVYDE-372_fix_ClassCastException

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/ant-ivy/pull/1.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #1


          commit eee80f1dc70abca1861019235626781d624e0b66
          Author: Carsten Pfeiffer <carsten.pfeiffer@gebit.de>
          Date: 2014-09-24T08:23:19Z

          IVYDE-372: fix ClassCastException: System properties may not be strings


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user cpfeiffer opened a pull request: https://github.com/apache/ant-ivy/pull/1 IVYDE-372 : fix ClassCastException: System properties may not be strings You can merge this pull request into a Git repository by running: $ git pull https://github.com/cpfeiffer/ant-ivy IVYDE-372 _fix_ClassCastException Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ant-ivy/pull/1.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1 commit eee80f1dc70abca1861019235626781d624e0b66 Author: Carsten Pfeiffer <carsten.pfeiffer@gebit.de> Date: 2014-09-24T08:23:19Z IVYDE-372 : fix ClassCastException: System properties may not be strings
          Hide
          garydgregory Gary Gregory added a comment -

          This still happens with the official 4.4.1 version that came out today.

          Show
          garydgregory Gary Gregory added a comment - This still happens with the official 4.4.1 version that came out today.
          Hide
          rschuetz Ronny Schütz added a comment -

          I saw that there is a fixed Ivy 2.5.0 alpha available on Jenkins. Would it be possible to build and publish a fixed 2.4.0-RC version as well?

          Show
          rschuetz Ronny Schütz added a comment - I saw that there is a fixed Ivy 2.5.0 alpha available on Jenkins. Would it be possible to build and publish a fixed 2.4.0-RC version as well?
          Hide
          garydgregory Gary Gregory added a comment -

          Yes, how do I get this fix in my Eclipse 4.4.1 set up?

          Show
          garydgregory Gary Gregory added a comment - Yes, how do I get this fix in my Eclipse 4.4.1 set up?
          Hide
          garydgregory Gary Gregory added a comment - - edited

          Wait a sec, when I look here:

          https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java

          I still see:

              public synchronized void addAllVariables(Map variables, boolean overwrite) {
                  for (Iterator iter = variables.keySet().iterator(); iter.hasNext();) {
                      String key = (String) iter.next();
                      String val = (String) variables.get(key);
                      setVariable(key, val, overwrite);
                  }
              }
          

          So the patch https://github.com/apache/ant-ivy/pull/1.patch has not been applied.

          Has a fix been made elsewhere?

          What am I missing?

          Show
          garydgregory Gary Gregory added a comment - - edited Wait a sec, when I look here: https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java I still see: public synchronized void addAllVariables(Map variables, boolean overwrite) { for (Iterator iter = variables.keySet().iterator(); iter.hasNext();) { String key = ( String ) iter.next(); String val = ( String ) variables.get(key); setVariable(key, val, overwrite); } } So the patch https://github.com/apache/ant-ivy/pull/1.patch has not been applied. Has a fix been made elsewhere? What am I missing?
          Hide
          chrjohn Christoph John added a comment -

          One is an SVN repo, the other one is a Github repo. But I do not know from which repo releases are built.

          Show
          chrjohn Christoph John added a comment - One is an SVN repo, the other one is a Github repo. But I do not know from which repo releases are built.
          Hide
          garydgregory Gary Gregory added a comment - - edited

          Ah, I see https://git-wip-us.apache.org/repos/asf?p=ant-ivy.git;a=summary

          but the Ivy web site still refers to Svn!

          So, the fix is in Git, cool.

          What do we need now?

          A release of Ivy 2.4.0-rc2, followed by an IvyDE 2.?-rc? release that depends on 2.4.0-rc2?

          Which would mean the fix has to be ported to the 2.4.x branch?

          Show
          garydgregory Gary Gregory added a comment - - edited Ah, I see https://git-wip-us.apache.org/repos/asf?p=ant-ivy.git;a=summary but the Ivy web site still refers to Svn! So, the fix is in Git, cool. What do we need now? A release of Ivy 2.4.0-rc2, followed by an IvyDE 2.?-rc? release that depends on 2.4.0-rc2? Which would mean the fix has to be ported to the 2.4.x branch?
          Hide
          hibou Nicolas Lalevée added a comment -

          We recently switched from svn to git. Some doc may indeed not be up to date.

          I think this bug is critical enough to get fixed in Ivy 2.4. I'm not sure when this will get out, this will be our first release from git.

          Note that we don't need a release of IvyDE for this bug, just a release of Ivy.

          If you're impatient, there is an automatic build of an Eclipse updatesite which contains the trunk versions of both Ivy and IvyDE:
          https://builds.apache.org/job/IvyDE-updatesite/
          These are not official release though.

          Show
          hibou Nicolas Lalevée added a comment - We recently switched from svn to git. Some doc may indeed not be up to date. I think this bug is critical enough to get fixed in Ivy 2.4. I'm not sure when this will get out, this will be our first release from git. Note that we don't need a release of IvyDE for this bug, just a release of Ivy. If you're impatient, there is an automatic build of an Eclipse updatesite which contains the trunk versions of both Ivy and IvyDE: https://builds.apache.org/job/IvyDE-updatesite/ These are not official release though.
          Show
          garydgregory Gary Gregory added a comment - The URL for the Eclipse update site is https://builds.apache.org/job/IvyDE-updatesite/lastSuccessfulBuild/artifact/trunk/build/
          Hide
          reinhapa Patrick Reinhart added a comment -

          Will this be fixed on the 2.4 version also?

          Show
          reinhapa Patrick Reinhart added a comment - Will this be fixed on the 2.4 version also?
          Hide
          kkolinko Konstantin Kolinko added a comment -

          For reference, the bug in Eclipse IDE 4.4.1 Equinox component that is the root cause is
          https://bugs.eclipse.org/bugs/show_bug.cgi?id=445122

          In my opinion Eclipse 4.4.1 (Luna SR1) is unusable, because a number of components were broken by that bug. IvyDE is just one of them. I will wait for 4.4.2 (SR2).

          Show
          kkolinko Konstantin Kolinko added a comment - For reference, the bug in Eclipse IDE 4.4.1 Equinox component that is the root cause is https://bugs.eclipse.org/bugs/show_bug.cgi?id=445122 In my opinion Eclipse 4.4.1 (Luna SR1) is unusable, because a number of components were broken by that bug. IvyDE is just one of them. I will wait for 4.4.2 (SR2).
          Hide
          tinusaan Tinus Aamand Norstved added a comment -

          Updating to Ivy 2.5.0 alpha (from the trunk site mentioned above) seemed to do the trick.

          Installed software:
          Apache Ivy 2.5.0.alpha_20140928001438
          Apache IvyDE 2.3.0.beta1-201409280037-hudson-296
          Spring Tool Suite 3.6.2.201410091308-RELEASE-e44 (Eclipse 4.4.1)

          Show
          tinusaan Tinus Aamand Norstved added a comment - Updating to Ivy 2.5.0 alpha (from the trunk site mentioned above) seemed to do the trick. Installed software: Apache Ivy 2.5.0.alpha_20140928001438 Apache IvyDE 2.3.0.beta1-201409280037-hudson-296 Spring Tool Suite 3.6.2.201410091308-RELEASE-e44 (Eclipse 4.4.1)
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user cpfeiffer closed the pull request at:

          https://github.com/apache/ant-ivy/pull/1

          Show
          githubbot ASF GitHub Bot added a comment - Github user cpfeiffer closed the pull request at: https://github.com/apache/ant-ivy/pull/1
          Show
          githubbot ASF GitHub Bot added a comment - Github user cpfeiffer commented on the pull request: https://github.com/apache/ant-ivy/pull/1#issuecomment-59255988 Already merged as https://github.com/apache/ant-ivy/commit/81fec3193ad12a0f78eb021c4a1548484595860b
          Hide
          awm Aram Mirzadeh added a comment -

          This is marked as resolved, but I ran into this, this morning pulling from the update site. Is there a nightly build that I can use to test this?

          Show
          awm Aram Mirzadeh added a comment - This is marked as resolved, but I ran into this, this morning pulling from the update site. Is there a nightly build that I can use to test this?
          Hide
          hibou Nicolas Lalevée added a comment -

          Ivy 2.4.0 has just been released today, and the fix is included. You should retry from the official updatesite.

          Show
          hibou Nicolas Lalevée added a comment - Ivy 2.4.0 has just been released today, and the fix is included. You should retry from the official updatesite.

            People

            • Assignee:
              hibou Nicolas Lalevée
              Reporter:
              chrjohn Christoph John
            • Votes:
              5 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development