SonarQube Eclipse
  1. SonarQube Eclipse

ArrayIndexOutOfBoundException when associating project with sonar


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


      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(
      at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(
      at org.eclipse.core.internal.runtime.AdapterManager.loadAdapter(
      at org.sonar.ide.eclipse.ui.util.PlatformUtils.adapt(
      at org.eclipse.core.internal.resources.Resource$2.visit(
      at org.eclipse.core.internal.resources.Resource$1.visitElement(
      at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(
      at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(
      at org.eclipse.core.internal.resources.Resource.accept(
      at org.eclipse.core.internal.resources.Resource.accept(
      at org.eclipse.core.internal.resources.Resource.accept(

      Stack trace when performing local analysis:

      java.lang.RuntimeException: java.lang.NullPointerException
      at org.sonar.batch.components.RemoteProfileLoader.load(
      at org.sonar.batch.ProfileProvider.provide(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      at java.lang.reflect.Method.invoke(
      at org.picocontainer.injectors.MethodInjector.invokeMethod(
      at org.picocontainer.injectors.MethodInjector.access$000(
      at org.picocontainer.injectors.MethodInjector$
      at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(
      at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(
      at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(
      at org.picocontainer.injectors.Reinjector.reinject(
      at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(
      at org.picocontainer.DefaultPicoContainer.getInstance(
      at org.picocontainer.DefaultPicoContainer.getComponent(
      at org.picocontainer.DefaultPicoContainer.getComponent(
      at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(
      at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(
      at org.picocontainer.injectors.SingleMemberInjector.getParameter(
      at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(
      at org.picocontainer.injectors.ConstructorInjector$
      at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(
      at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(
      at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(
      at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(
      at org.picocontainer.behaviors.Stored.getComponentInstance(
      at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(
      at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(
      at org.picocontainer.DefaultPicoContainer.startAdapters(
      at org.picocontainer.DefaultPicoContainer.start(
      at org.sonar.batch.Module.start(
      at org.sonar.batch.ProjectModule.start(
      at org.sonar.batch.SonarEclipseRuntime.analyse(
      Caused by: java.lang.NullPointerException
      at org.sonar.batch.components.RemoteProfileLoader.load(
      ... 35 more


        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.

        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.


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


            • Created: