Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

[AEM 6.2] Component Satisfied but not Active

Avatar

Level 2

Hi,

I create a simple component, it extends EventListener

@Componentpublic class SyncListener implements EventListener {private final Logger LOGGER = LoggerFactory.getLogger(SyncListener.class);     // if comment this 2 line, the component works fine@Reference    //*1    private SlingRepository repository; //*2     //private Session session;private ObservationManager observationManager;@Override    public void onEvent(EventIterator eventIterator) {LOGGER.info("*** Event OK ***"); }@Activate    protected void activate(ComponentContext context) throws Exception {      LOGGER.info("*** Listener started ***"); }@Deactivate    protected void deactivate(ComponentContext componentContext) {LOGGER.info("*** Listener stopped ***");    } }

 

In OSGI console the status of component is satisfied, but not active. If comment *1 and *2 the component will be started normally.

In error.log i can se this error:

 

Expecting a stackmap frame at branch target 13
Exception Details:
  Location:
    my/package/SyncListener.unbindRepository(Lorg/apache/sling/jcr/api/SlingRepository;)V @5: if_acmpne
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: 2ab4 0039 2ba6 0008 2a01 b500 39b1     
)
java.lang.VerifyError: Expecting a stackmap frame at branch target 13
Exception Details:
  Location:
    my/package/SyncListener.unbindRepository(Lorg/apache/sling/jcr/api/SlingRepository;)V @5: if_acmpne
  Reason:
    Expected stackmap frame at this location.

...

...

...

 

What could be the problem?

 

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Level 2

I found a workaround.

If I run the instance with jvm param --noverify it work fine. I would like to understand what is causing the problem...

Thanks

View solution in original post

4 Replies

Avatar

Employee

are you running the same java version? you dev-environment and where you run AEM?

Avatar

Level 2

I'using java 1.8.

I'm running a Dev instance (java -Xmx2048m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar aem-author-p4502.jar) in localhost.

Avatar

Level 9

First & Foremost, In your event listener, I can see @Service annotation is missing at the class level. i would say kindly correct it.

Secondly, make sure you have correct java importers. Sometimes it happens in eclipse if you have multiple jars in your class path. And avoid using deprecated API.

Avatar

Correct answer by
Level 2

I found a workaround.

If I run the instance with jvm param --noverify it work fine. I would like to understand what is causing the problem...

Thanks