SonarQube Eclipse
  1. SonarQube Eclipse
  2. SONARIDE-304

ArrayIndexOutOfBoundException when associating project with sonar

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Labels:
      None
    • Environment:
      Eclipse 3.7
      Mac OS 10.7.4
      Sonar 3.0.1
    • Number of attachments :
      0

      Description

      Whenever I try to associate a project with Sonar (right click project -> configure -> associate with sonar -> select project, type in GroupId, type in ArtifactId -> Finish), I get an error dialog that says:

      'Retrieve sonar org.sonar.ide.eclipse.core.sonarProblem' has encountered a problem. 2

      The error log gives me the stack trace pasted in at the bottom. Note that this might be an unexpected manifestation of an earlier problem. As far as I can tell, almost nothing seems to work as advertised. When setting up the initial Sonar configuration, I can add our server, but the "Test connection" button always gives me "Unable to connect." There is no indication of why, and I don't know where to look to see if something additional is logged. However, I don't have any issues connecting to our sonar server anywhere else, and in fact, if I then try and associate a project with the sonar server, in spite of the error shown in the stack trace below, I am able to right click the project and see Sonar in the context menu, and from there "Open in sonar server" works! Unfortunately, not much else does. If I try Analyse... -> Locally I get yet another error (shown at the very bottom). Perhaps I'm missing something basic? Are there logs somewhere to get more information?

      Stack trace when connecting project to sonar:

      java.lang.ArrayIndexOutOfBoundsException: 2
      at org.sonar.ide.eclipse.internal.jdt.JavaElementsAdapterFactory.getAdapter(JavaElementsAdapterFactory.java:71)
      at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:326)
      at org.eclipse.core.internal.runtime.AdapterManager.loadAdapter(AdapterManager.java:356)
      at org.sonar.ide.eclipse.ui.util.PlatformUtils.adapt(PlatformUtils.java:59)
      at org.sonar.ide.eclipse.internal.ui.jobs.RefreshAllViolationsJob.visit(RefreshAllViolationsJob.java:85)
      at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:106)
      at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:65)
      at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
      at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
      at org.eclipse.core.internal.resources.Resource.accept(Resource.java:75)
      at org.eclipse.core.internal.resources.Resource.accept(Resource.java:104)
      at org.eclipse.core.internal.resources.Resource.accept(Resource.java:88)
      at org.sonar.ide.eclipse.internal.ui.jobs.AbstractRefreshModelJob.run(AbstractRefreshModelJob.java:71)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

      Stack trace when performing local analysis:

      java.lang.RuntimeException: java.lang.NullPointerException
      at org.sonar.batch.components.RemoteProfileLoader.load(RemoteProfileLoader.java:64)
      at org.sonar.batch.ProfileProvider.provide(ProfileProvider.java:36)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:142)
      at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:38)
      at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:126)
      at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:274)
      at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:133)
      at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
      at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
      at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
      at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:689)
      at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:638)
      at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:627)
      at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:105)
      at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
      at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:76)
      at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:286)
      at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:312)
      at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:274)
      at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:341)
      at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
      at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
      at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
      at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1014)
      at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1006)
      at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:983)
      at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:746)
      at org.sonar.batch.Module.start(Module.java:88)
      at org.sonar.batch.ProjectModule.start(ProjectModule.java:107)
      at org.sonar.batch.SonarEclipseRuntime.analyse(SonarEclipseRuntime.java:41)
      at org.sonar.ide.eclipse.core.jobs.AnalyseProjectJob.run(AnalyseProjectJob.java:107)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      Caused by: java.lang.NullPointerException
      at org.sonar.batch.components.RemoteProfileLoader.load(RemoteProfileLoader.java:53)
      ... 35 more

        Activity

        Hide
        David Gageot added a comment -

        Didn't manage to reproduce them problem.
        Did however improve the code to avoid the ArrayIndexOutOfBoundException in case the resource key is not valid.

        Show
        David Gageot added a comment - Didn't manage to reproduce them problem. Did however improve the code to avoid the ArrayIndexOutOfBoundException in case the resource key is not valid.

          People

          • Assignee:
            Freddy Mallet
            Reporter:
            Steven Mark McCraw
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: