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
Solved! Go to Solution.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
are you running the same java version? you dev-environment and where you run AEM?
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
First & Foremost, In your event listener, I can see @Service annotation is missing at the class level.
Secondly, make sure you have correct
Views
Replies
Total Likes
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
Views
Replies
Total Likes