Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM 6.3 upgrade issue: WCmUse / WCMUsePojo mocking in Junit

Avatar

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ravitejakolla
Level 1

14-05-2018

Seeing the below java.lang.VerifyError after upgrading from 6.2 to 6.3

Java versions used:

1.8.0_151 and 1.8.0_77

Tried using uber jar dependency as below as apis and later as obfuscated-apis:

<groupId>com.adobe.aem</groupId>

  <artifactId>uber-jar</artifactId>

  <version>6.3.0</version>

  <classifier>obfuscated-apis</classifier>

  <scope>provided</scope>

<groupId>com.adobe.aem</groupId>

  <artifactId>uber-jar</artifactId>

  <version>6.3.0</version>

  <classifier>apis</classifier>

Error Log:

Running com.page.comp.ComponentTest

Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.66 sec <<< FAILURE! - in com.amex.page.comp.ComponentTest

com.amex.page.comp.ComponentTest  Time elapsed: 0.193 sec  <<< ERROR!

java.lang.VerifyError: Constructor must call super() or this() before return

Exception Details:

  Location:

    com/adobe/cq/sightly/WCMUsePojo.<init>()V @1: return

  Reason:

    Error exists in the bytecode

  Bytecode:

    0x0000000: 2ab1                                  

  at java.lang.Class.getDeclaredConstructors0(Native Method)

  at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)

  at java.lang.Class.getDeclaredConstructors(Class.java:2020)

  at org.mockito.internal.util.reflection.FieldInitializer$ParameterizedConstructorInstantiator.biggestConstructor(FieldInitializer.java:265)

  at org.mockito.internal.util.reflection.FieldInitializer$ParameterizedConstructorInstantiator.instantiate(FieldInitializer.java:235)

  at org.mockito.internal.util.reflection.FieldInitializer.acquireFieldInstance(FieldInitializer.java:123)

  at org.mockito.internal.util.reflection.FieldInitializer.initialize(FieldInitializer.java:85)

  at org.mockito.internal.configuration.injection.ConstructorInjection.processInjection(ConstructorInjection.java:52)

  at org.mockito.internal.configuration.injection.MockInjectionStrategy.process(MockInjectionStrategy.java:68)

  at org.mockito.internal.configuration.injection.MockInjectionStrategy.relayProcessToNextStrategy(MockInjectionStrategy.java:89)

  at org.mockito.internal.configuration.injection.MockInjectionStrategy.process(MockInjectionStrategy.java:71)

  at org.mockito.internal.configuration.injection.MockInjection$OngoingMockInjection.apply(MockInjection.java:92)

  at org.mockito.internal.configuration.DefaultInjectionEngine.injectMocksOnFields(DefaultInjectionEngine.java:20)

  at org.mockito.internal.configuration.InjectingAnnotationEngine.injectMocks(InjectingAnnotationEngine.java:100)

  at org.powermock.api.mockito.internal.configuration.PowerMockitoInjectingAnnotationEngine.process(PowerMockitoInjectingAnnotationEngine.java:35)

  at org.powermock.api.extension.listener.AnnotationEnabler.injectSpiesAndInjectToSetters(AnnotationEnabler.java:60)

  at org.powermock.api.extension.listener.AnnotationEnabler.beforeTestMethod(AnnotationEnabler.java:55)

  at org.powermock.tests.utils.impl.PowerMockTestNotifierImpl.notifyBeforeTestMethod(PowerMockTestNotifierImpl.java:90)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:292)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTestInSuper(PowerMockJUnit47RunnerDelegateImpl.java:127)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit47RunnerDelegateImpl$PowerMockJUnit47MethodRunner.executeTest(PowerMockJUnit47RunnerDelegateImpl.java:82)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:282)

  at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:86)

  at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:207)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:146)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:120)

  at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:33)

  at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:45)

  at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:122)

  at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:104)

  at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)

  at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:53)

  at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)

  at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)

  at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)

​Thanks for your help in advance!

Replies

Avatar

Avatar
Validate 1
Level 4
Rima_Mittal
Level 4

Likes

30 likes

Total Posts

82 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
Rima_Mittal
Level 4

Likes

30 likes

Total Posts

82 posts

Correct Reply

17 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Rima_Mittal
Level 4

14-05-2018

can you try starting AEM with a -noverify option and see if it helps?

Please refer Keep Calm and Code It.: java.lang.VerifyError: Bad method call from inside of a branch .

Thanks

Rima Mittal

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

14-05-2018

Could be some sort of upgrade bug. See if you can build an AEM Maven 12 on your instance -- Creating an Adobe Experience Manager 6.3 Project using Adobe Maven Archetype 12

Avatar

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ravitejakolla
Level 1

14-05-2018

Its working fine when I'm using 6.2 jar.

<groupId>com.adobe.aem</groupId>

  <artifactId>uber-jar</artifactId>

  <version>6.2.0</version>

  <classifier>obfuscated-apis</classifier>

Can you help me understand what goings on.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

14-05-2018

Have you placed both of these in the Main POM file?

<dependency>

               <groupId>com.adobe.aem</groupId>

               <artifactId>uber-jar</artifactId>

               <version>6.3.0</version>

               <!-- for AEM6.1 use this version     : <version>6.1.0</version> -->

               <!-- for AEM6.1 SP1 use this version : <version>6.1.0-SP1-B0001</version> -->

               <!-- for AEM6.1 SP2 use this version : <version>6.1.0-SP2</version> -->

               <!-- for AEM6.2 use this version     : <version>6.2.0</version> -->

               <classifier>obfuscated-apis</classifier>

               <scope>provided</scope>

           </dependency>

            

           <dependency>

               <groupId>org.apache.geronimo.specs</groupId>

               <artifactId>geronimo-atinject_1.0_spec</artifactId>

               <version>1.0</version>

               <scope>provided</scope>

           </dependency>

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

14-05-2018

Bytecode verification issues are not tied to the Java code itself, but rather to the JVM. Either you hit a JVM bug or you might have hardware issues. Can you reproduce this problem on a different machine?

Jörg

Avatar

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ravitejakolla
Level 1

14-05-2018

Yes, I tried this but the same error. Let me know If you want me to share any more details.

Avatar

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ravitejakolla
Level 1

14-05-2018

Yes, we are seeing same issue on couple of machines including jenkins build.

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

14-05-2018

I found java - Constructor must call super() or this() before return in method - Stack Overflow  which can potentially explain it. You are using a mocking framework which manipulates bytecode ...

Jörg

Avatar

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
ravitejakolla
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
ravitejakolla
Level 1

17-05-2018

Hi Jorg Hoh,


Thank you for the update.

I was able to build the project in another machine, but can you give me some high level context what would be the reason when we say hard ware issues.