ootbee-support-tools icon indicating copy to clipboard operation
ootbee-support-tools copied to clipboard

NullPointerException in CacheBackedChunkedList

Open Fikili opened this issue 1 year ago • 4 comments

BUG

Script executed from JS Console receives NPE. The script doesn't need to contain any Alfresco service. Example of the script:

for (var index = 0; index < 10000; index++) {
    print(index);
}

The issue can be reproduced around value index < 500.

The same script was implemented as common webscript and it runs fine.

Expected behavior

Script will be completed without any problem.

Actual behavior

NullPointerException is thrown.

Steps to reproduce the behavior

Run the script above.

Additional details (analysis so far, log statements, references, etc.)

alfresco.log

...
DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor.calls] [http-nio-8080-exec-8524] 1d12315a7ea92737b1f849a27a55db84.js End 1372 ms
DEBUG [org.orderofthebee.addons.support.tools.repo.jsconsole.ExecuteWebscript] [http-nio-8080-exec-8524] Caught exception; decorating with appropriate status template
java.lang.NullPointerException
	at org.orderofthebee.addons.support.tools.repo.jsconsole.CacheBackedChunkedList.get(CacheBackedChunkedList.java:81)
	at org.orderofthebee.addons.support.tools.repo.jsconsole.CacheBackedChunkedList.get(CacheBackedChunkedList.java:44)
	at java.base/java.util.AbstractList$Itr.next(AbstractList.java:371)
	at java.base/java.util.AbstractCollection.toArray(AbstractCollection.java:144)
	at java.base/java.util.ArrayList.<init>(ArrayList.java:179)
	at org.orderofthebee.addons.support.tools.repo.jsconsole.JavascriptConsoleScriptObject.getPrintOutput(JavascriptConsoleScriptObject.java:239)
	at org.orderofthebee.addons.support.tools.repo.jsconsole.ExecuteWebscript.executeScriptContent(ExecuteWebscript.java:445)
	at org.orderofthebee.addons.support.tools.repo.jsconsole.ExecuteWebscript.lambda$runWithTransactionIfNeeded$1(ExecuteWebscript.java:359)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338)
	at org.orderofthebee.addons.support.tools.repo.jsconsole.ExecuteWebscript.runWithTransactionIfNeeded(ExecuteWebscript.java:353)
	at org.orderofthebee.addons.support.tools.repo.jsconsole.ExecuteWebscript.lambda$runScriptWithTransactionAndAuthentication$0(ExecuteWebscript.java:326)
...

Tell us about your environment

  • Enterprise edition with ACS 7.2
  • 2 Alfresco nodes in cluster
  • LB between Alfresco and Share
  • Problem is visible only in PROD environment

Fikili avatar Feb 06 '24 20:02 Fikili