Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-28076

Indexer ArrayIndexOutOfBounds

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 4.19.1.Final, 4.21.0.AM1
    • 4.21.1.AM1
    • cdi
    • None
    • Sprint #209 Oct 2021
    • ---
    • ---

    Description

      The CDI indexer fails with an exception (eclipse shows build error dialog). As a result the EL content assist is not working anymore in the affected projects.

      This exception is an ArrayIndexOutOfBounds exception and it happens in any CDI enabled project for me right now. See stacktrace below.

       

      This happens for me now with Eclipse 2021/06 and 2021/09 and I tried 4.19.1 and 4.21.0.AM1 (but from what I've seen both jboss update sites provide the same version for CDI). openjdk11 is used to start eclipse (also tried the shipped hotspot jre) and my projects are built with openjdk11. OS is Fedora 34.

       The jboss tools worked flawless for me for a while now (9 month+?) with several eclipse versions.

       

      I think this exception started with some maven dependency updates.

      Updated ticket: We use a base product which ships several dependencies, and after looking into it and see what changed, I was able to identify the "one" dependency which breaks the CDI build.

       

      Guava was updated:

      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>30.1.1-jre</version> // works
      </dependency>
      

      Not working anymore:

      <dependency> 
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId> 
        <version>31.0-jre</version> // not working anymore, same with 31.0.1-jre 
      </dependency>
      

       

      !ENTRY org.eclipse.core.resources 4 75 2021-10-05 05:04:39.789
      !MESSAGE Errors occurred during the build.
      !SUBENTRY 1 org.jboss.tools.cdi.core 4 75 2021-10-05 05:04:39.789
      !MESSAGE Errors running builder 'CDI (Contexts and Dependency Injection) Builder' on project 'MyProject'.
      !STACK 0
      java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
              at org.jboss.jandex.Indexer.updateTypeTarget(Indexer.java:705)
              at org.jboss.jandex.Indexer.updateTypeTargets(Indexer.java:489)
              at org.jboss.jandex.Indexer.index(Indexer.java:1459)
              at org.jboss.tools.common.core.jandex.JandexUtil.createJarIndex(JandexUtil.java:56)
              at org.jboss.tools.common.core.jandex.JandexUtil.hasAnnotation(JandexUtil.java:104)
              at org.jboss.tools.cdi.internal.core.scanner.lib.BeanArchiveDetector.hasAnnotatedBeans(BeanArchiveDetector.java:276)
              at org.jboss.tools.cdi.internal.core.scanner.lib.BeanArchiveDetector.resolve(BeanArchiveDetector.java:203)
              at org.jboss.tools.cdi.internal.core.scanner.lib.ClassPathMonitor.detectBeanModule(ClassPathMonitor.java:150)
              at org.jboss.tools.cdi.internal.core.scanner.lib.ClassPathMonitor.process(ClassPathMonitor.java:106)
              at org.jboss.tools.cdi.core.CDICoreBuilder.build(CDICoreBuilder.java:215)
              at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853)
              at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
              at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232)
              at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:281)
              at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:334)
              at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
              at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:337)
              at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:389)
              at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:410)
              at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160)
              at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:251)
              at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
      
      

      Attachments

        Activity

          People

            jmaury@redhat.com Jeff MAURY
            tza.at tom zauner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: