Failed to read candidate component class: file [%path%/TestEntity.class]; nested exception is java.lang.ArrayIndexOutOfBoundsException: 130

88 views
Skip to first unread message

Alex Barysevich via StackOverflow

unread,
May 31, 2014, 9:25:00 PM5/31/14
to google-appengin...@googlegroups.com

I'm trying to create simple Google App Engine + Spring + GPA tool. Everything seems fine until I try to start local dev server. My pom configuration:

 <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>  
      <groupId>org.datanucleus</groupId>  
      <artifactId>datanucleus-api-jpa</artifactId>  
      <version>${datanucleus.jpa.version}</version>  
    </dependency>  
    <dependency>  
      <groupId>org.datanucleus</groupId>  
      <artifactId>datanucleus-core</artifactId>  
      <version>${datanucleus.jpa.version}</version>  
    </dependency>  
    <dependency>  
      <groupId>com.google.appengine.orm</groupId>  
      <artifactId>datanucleus-appengine</artifactId>  
      <version>2.1.1</version>  
      <!-- Need to exclude the enhancer since it interfere with the enhancer plugin. -->  
    <!--   <exclusions>  
        <exclusion>  
          <groupId>org.datanucleus</groupId>  
          <artifactId>datanucleus-enhancer</artifactId>  
        </exclusion>  
      </exclusions>
       -->  
    </dependency>  
    <dependency>  
      <groupId>javax.jdo</groupId>  
      <artifactId>jdo-api</artifactId>  
      <version>3.0.1</version>  
    </dependency>  
    <dependency>  
      <groupId>org.apache.geronimo.specs</groupId>  
      <artifactId>geronimo-jpa_2.0_spec</artifactId>  
      <version>1.1</version>  
    </dependency>

    <!-- Test Dependencies -->
    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-testing</artifactId>
        <version>${appengine.target.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-api-stubs</artifactId>
        <version>${appengine.target.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <outputDirectory>target/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory> 

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <archiveClasses>true</archiveClasses>
                <webResources>
                    <!-- in order to interpolate version from pom into appengine-web.xml -->
                    <resource>
                        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                        <filtering>true</filtering>
                        <targetPath>WEB-INF</targetPath>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

        <plugin>  
          <groupId>org.datanucleus</groupId>  
          <artifactId>maven-datanucleus-plugin</artifactId>  
          <version>${datanucleus.jpa.version}</version>  

          <configuration>  
            <api>JPA</api>  
            <mappingIncludes>io.volat.logger.persistence.entities/*.class</mappingIncludes>  
            <verbose>true</verbose>  
          </configuration>  

          <dependencies>  
            <dependency>  
              <groupId>org.datanucleus</groupId>  
              <artifactId>datanucleus-core</artifactId>  
              <version>${datanucleus.jpa.version}</version>  
            </dependency>  
          </dependencies>  

          <executions>  
            <execution>     
              <phase>compile</phase>  
              <goals>  
                <goal>enhance</goal>  
              </goals>  
            </execution>  
          </executions>  
        </plugin>

    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.datanucleus
                                    </groupId>
                                    <artifactId>
                                        maven-datanucleus-plugin
                                    </artifactId>
                                    <versionRange>
                                        [${datanucleus.jpa.version},)
                                    </versionRange>
                                    <goals>
                                        <goal>enhance</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

Maven build successfully executes enhancing for TestEntity.class with the next output:

[INFO] --- maven-datanucleus-plugin:3.1.1:enhance (default) @ logger-war ---
Downloading: http://www.datanucleus.org/downloads/maven2/org/datanucleus/datanucleus-                    enhancer/maven-metadata.xml
Downloading: http://www.datanucleus.org/downloads/maven2/javax/jdo/jdo-api/maven-metadata.xml
Downloading: http://www.datanucleus.org/downloads/maven2/org/ow2/asm/asm/maven-metadata.xml
[INFO] DataNucleus Enhancer (version 3.1.1) : Enhancement of classes
DataNucleus Enhancer completed with success for 1 classes. Timings : input=342 ms, enhance=122 ms, total=464 ms. Consult the log for full details

[ERROR] --------------------
[ERROR]  Standard error from the DataNucleus tool + org.datanucleus.enhancer.DataNucleusEnhancer :
[ERROR] --------------------
[ERROR] May 31, 2014 5:13:37 PM org.datanucleus.enhancer.DataNucleusEnhancer <init>
INFO: DataNucleus Enhancer for API "JPA"
May 31, 2014 5:13:37 PM org.datanucleus.enhancer.DataNucleusEnhancer main
INFO: DataNucleus Enhancer (version 3.1.1) : Enhancement of classes
May 31, 2014 5:13:37 PM org.datanucleus.metadata.MetaDataManager loadFiles
WARNING: Metadata file -enhancerName not found in CLASSPATH
May 31, 2014 5:13:37 PM org.datanucleus.metadata.MetaDataManager loadFiles
WARNING: Metadata file ASM not found in CLASSPATH
May 31, 2014 5:13:37 PM org.datanucleus.enhancer.AbstractClassEnhancer save
INFO: Writing class file "/Users/abarysevich/backend/logger/logger-war/target/logger-war-1.0-    SNAPSHOT/WEB-INF/classes/io/volat/logger/persistence/entities/TestEntity.class" with enhanced     definition
May 31, 2014 5:13:38 PM org.datanucleus.enhancer.DataNucleusEnhancer addMessage
INFO: DataNucleus Enhancer completed with success for 1 classes. Timings : input=342 ms, enhance=122 ms, total=464 ms. Consult the log for full details

[ERROR] --------------------

But when I try to start my devserver it fails with the next error:

[INFO] SEVERE: Context initialization failed
[INFO] org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/abarysevich/backend/logger/logger-ear/target/logger-ear-1.0-SNAPSHOT/logger-war-1.0-SNAPSHOT.war/WEB-INF/classes/io/volat/logger/persistence/entities/TestEntity.class]; nested exception is java.lang.ArrayIndexOutOfBoundsException: 130

I've decompiled my enhanced persistence class TestEntity.class but couldn't find any errors there: everything looks good for me. I don't have any idea how with what can it be related. The answers that I found in the internet mostly about errors in the compiled file I I don't have any. Please, help me, somebody - I'm completely stuck :-(



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/23975966/failed-to-read-candidate-component-class-file-path-testentity-class-nested

Alex Barysevich via StackOverflow

unread,
Jun 1, 2014, 12:40:39 AM6/1/14
to google-appengin...@googlegroups.com

I've decompiled my enhanced persistence class TestEntity.class but couldn't find any errors there: everything looks good for me. I have no idea with what can it be related. The answers that I found in the internet mostly about errors in the compiled file I I don't have any. Please, help me, somebody - I'm completely stuck :-(

Alex Barysevich via StackOverflow

unread,
Jun 1, 2014, 1:35:34 AM6/1/14
to google-appengin...@googlegroups.com

I'm trying to create simple Google App Engine + Spring + JPA (datanucles) tool. Everything seems fine until I try to start local dev server. My pom configuration:

I've decompiled my enhanced persistence class TestEntity.class but couldn't find any errors there: everything looks good for me. Also same entity worked fine with this configuration: GAE + JPA (data nucles). In both cases build output (see above) is the same. So, I suggest that the problem might be narrowed to the Spring framework (in particular org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor class).

Reply all
Reply to author
Forward
0 new messages