6

sto usando Maven 3.2.3 con questa versione di JavaOttenere "In attesa di un fotogramma stackmap a destinazione del ramo" durante l'esecuzione di test di integrazione Maven

davea$ echo $JAVA_HOME 
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home 

Quando eseguo

mvn clean install 

ottengo errori come il nel mio test di integrazione di sotto ...

testFindSampleUsersByCodeAscByDefault(org.mainco.subco.user.service.SampleUserService2IT) Time elapsed: 2.204 sec <<< ERROR! 
java.lang.VerifyError: Expecting a stackmap frame at branch target 57 
Exception Details: 
    Location: 
    org/mainco/subco/user/service/SampleUserServiceImpl$ValueComparator.compare(Lorg/mainco/subco/user/domain/User;Lorg/mainco/subco/user/domain/User;)I @10: ifnull 
    Reason: 
    Expected stackmap frame at this location. 
    Bytecode: 
    0x0000000: 2ab4 001b 2bb9 002e 0200 c600 2f2a b400 
    0x0000010: 1b2b b900 2e02 00c0 0030 b600 34c6 001c 
    0x0000020: 2ab4 001b 2bb9 002e 0200 c000 30b6 0034 
    0x0000030: b600 39b6 003e a700 0512 404e 2ab4 001b 
    0x0000040: 2cb9 002e 0200 c600 2f2a b400 1b2c b900 
    0x0000050: 2e02 00c0 0030 b600 34c6 001c 2ab4 001b 
    0x0000060: 2cb9 002e 0200 c000 30b6 0034 b600 39b6 
    0x0000070: 003e a700 0512 403a 042d 1904 b600 4436 
    0x0000080: 0515 0599 0016 2d19 04b6 0044 2d19 04b6 
    0x0000090: 0044 b800 4a6c a700 0403 3606 1506 2ab4 
    0x00000a0: 0023 9900 0702 a700 0404 a000 0502 ac04 
    0x00000b0: ac          

    at org.mainco.subco.user.service.SampleUserServiceImpl.findSampleUsers(SampleUserServiceImpl.java:439) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) 
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) 
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) 
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 
    at com.sun.proxy.$Proxy98.findSampleUsers(Unknown Source) 
    at org.mainco.subco.user.service.SampleUserService2IT.testFindSampleUsersByCodeAscByDefault(SampleUserService2IT.java:215) 

Ecco come il mio plug-compilatore è configurato ...

  <profile> 
        <id>jdk-8</id> 
        <activation> 
          <jdk>1.8</jdk> 
        </activation> 
        <build> 
          <plugins> 
            <plugin> 
              <groupId>org.apache.maven.plugins</groupId> 
              <artifactId>maven-compiler-plugin</artifactId> 
              <version>3.1</version> 
              <configuration> 
                <source>1.8</source> 
                <target>1.8</target> 
                <compilerArgument>-proc:none</compilerArgument> 
                <fork>true</fork> 
              </configuration> 
              <executions> 
                <execution> 
                  <id>default-testCompile</id> 
                  <phase>test-compile</phase> 
                  <goals> 
                    <goal>testCompile</goal> 
                  </goals> 
                </execution> 
              </executions> 
            </plugin> 
          </plugins> 
        </build> 
      </profile> 

e qui è come il mio failsafe è configurato

    <plugin> 
          <groupId>org.apache.maven.plugins</groupId> 
          <artifactId>maven-failsafe-plugin</artifactId> 
          <version>2.18.1</version> 
          <configuration> 
            <reuseForks>true</reuseForks> 
            <argLine>-Xmx4096m -XX:MaxPermSize=512M -XX:-UseSplitVerifier ${itCoverageAgent}</argLine> 
            <skipTests>${skipAllTests}</skipTests> 
          </configuration> 
          <executions> 
            <execution> 
              <goals> 
                <goal>integration-test</goal> 
                <goal>verify</goal> 
              </goals> 
            </execution> 
          </executions> 
        </plugin> 

Tutte le idee come prevenire questi bizzarri “In attesa di un fotogramma stackmap a destinazione del ramo” errori che sto vedendo?

Edit:

Sto usando questi dependnecies (come ipotizzato dai commenti che si trattava di problemi):

[INFO] +- org.springframework:spring-aop:jar:3.2.11.RELEASE:compile 
... 
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.6:compile 
[INFO] +- org.aspectj:aspectjrt:jar:1.8.6:compile 
+1

Maven non ha nulla a che fare con il tuo problema. C'è uno strumento di elaborazione bytecode nel tuo ambiente che è incompatibile con le recenti caratteristiche del bytecode, mentre "recente" significa "diversi anni", ma prima di Java 8, l'opzione '-XX: -UseSplitVerifier', che stai usando, ha aiutato a ignorare questi i problemi. I primi sospettati sono il framework AOP e l'agente di copertura. Il primo tentativo dovrebbe essere quello di aggiornare tutto. – Holger

+0

Ho rimosso l'opzione $ {itCoverageAGent} (non ho modificato nulla) e sto usando Spring AOP 3.2.11.RELEASE e aspectj-weaver 1.8.6 (latest). Non è un'opzione per aggiornare Spring AOP. Stai dicendo che questa versione di Spring AOP è incompatibile con Java 8? – Dave

+0

Non conosco queste librerie in dettaglio. Tutto ciò che ho detto è che uno di loro deve essere la causa. Una rapida ricerca ha rivelato http://stackoverflow.com/a/27556298/2711488; forse questo aiuta – Holger

risposta

7

Ho avuto questo stesso problema quando mi sono trasferito a JDK 8. Codice costruito bene, ho appena ricevuto questi errori durante l'esecuzione dei test unitari. Vedo che stai utilizzando -XX:-UseSplitVerifier, che non ha funzionato neanche per me. Avevo trovato una breve descrizione da qualche parte che invece di usare -XX:-UseSplitVerifier con JDK 8, dovrei usare -noverify. Ho fatto un tentativo e ha funzionato per me.

Spero che questo aiuti.

+0

dove hai impostato -noverify? L'ho impostato come MAVEN_OPTS ma non funziona per me – dev