Expand my Community achievements bar.

Component deletion triggers error message

Avatar

Level 4

Hello

Could you please tell me with such an error that appeared after applying the service package +6.5.4?

When deleting a component in author we're getting an error message (see attached image). The component also stays on the page until we do a manual refresh of the page. Deleting a component deletes it from the page without triggering a error message and without requiring a page refresh.

 

Steps to reproduce:

  1. Add a component to the page
  2. Delete it
  3. Notice the error message at the top of the page
  4. Notice the component isn't deleted
  5. Refresh the page
  6. Notice the component is deleted

Screenshot_1.png

 

Caused by: javax.jcr.InvalidItemStateException: This item [/content/............/global/templates/test-wd/jcr:content/parsys/panel/parsys/text_1467308130] does not exist anymore
	at org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate.checkAlive(ItemDelegate.java:86)
	at org.apache.jackrabbit.oak.jcr.session.operation.ItemOperation.checkPreconditions(ItemOperation.java:34)
	at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.prePerform(SessionDelegate.java:614)
	at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:204)
	at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:112)
	at org.apache.jackrabbit.oak.jcr.session.NodeImpl.hasProperty(NodeImpl.java:862)
	at org.apache.sling.jcr.resource.internal.JcrValueMap.read(JcrValueMap.java:332)
	... 154 common frames omitted

 

 

Very grateful in advance for any advice.

 

 

7 Replies

Avatar

Community Advisor

Hi @aliaksandr_hvozdzeu,

Assuming the inputs you shared on other thread for similar issue is same which is, 

  • The issue happens on author webserver after installing service pack (Not evident on local/application server)
    • Could you please clear the cache directories every time you install service package/hot fix/application package (In particular, /apps or /libs path)
    • Also, cross check you are not caching any content in author webserver. 

Avatar

Community Advisor

Hi @aliaksandr_hvozdzeu ,

      Did you added the listner to that component so that after deleting component it will auto refresh.

If listner not added then try adding it.

Kr,

Sanjay

Avatar

Level 4

One note. I see 500 request error in the POST delete request. 

Avatar

Level 4

Thanks all for your help. I fixed this issue. 

The problem was that in our class we were receiving an invalid resource from a request to delete a component.

It was enough to change from

Resource resource = request.getResource();

to

Resource resource = context.getRequest().getResource();

in extended 

ContentHandlerBasedTransformer