Expand my Community achievements bar.

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

PageManager.create(...) causes java.lang.StringIndexOutOfBoundsException error in error.log

Avatar

Level 1

Hi,

I create set of pages automatically in my AEM6 bundle using create(String parentPath, String pageName, String template, String title) method of PageManager interface. The results is good - the required pages get created, however I see lots of error messages (which are not related to my code) in error.log during the page creation. Stack trace:

23.06.2015 10:14:17.734 *ERROR* [Adobe Granite Offloading job cloner queue processor] com.adobe.granite.offloading.impl.OffloadingJobCloner String index out of range: -1

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1911)
    at com.adobe.granite.offloading.impl.util.OffloadingUtil.getJobPathFromJobId(OffloadingUtil.java:119)
    at com.adobe.granite.offloading.impl.util.OffloadingResourceUtil.getJobResourceFromJobNotification(OffloadingResourceUtil.java:96)
    at com.adobe.granite.offloading.impl.OffloadingJobCloner.processEvent(OffloadingJobCloner.java:171)
    at com.adobe.granite.offloading.impl.OffloadingJobCloner.access$200(OffloadingJobCloner.java:74)
    at com.adobe.granite.offloading.impl.OffloadingJobCloner$1.run(OffloadingJobCloner.java:151)
    at java.lang.Thread.run(Thread.java:744)

 

Any idea how to get rid of this nasty error?

Thanks,

Jiri

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

In the first line of the exception you can also see the name of thread which has executed the code and failed:

23.06.2015 10:14:17.734 *ERROR* [Adobe Granite Offloading job cloner queue processor] com.adobe.granite.offloading.impl.OffloadingJobCloner String index out of range: -1

In your case it's related to Job Offloading. I don't know if you create your pages inside a Sling job or not, but given this stack trace I don't think, that these 2 aspects are related. Which version of AEM are you using? What is the version number of the bundle "com.adobe.granite.offloading.core"?

kind regards;
Jörg

View solution in original post

3 Replies

Avatar

Level 10

I am trying to recreate your work - are you following a doc or is this a custom implementation? 

Avatar

Correct answer by
Employee Advisor

Hi,

In the first line of the exception you can also see the name of thread which has executed the code and failed:

23.06.2015 10:14:17.734 *ERROR* [Adobe Granite Offloading job cloner queue processor] com.adobe.granite.offloading.impl.OffloadingJobCloner String index out of range: -1

In your case it's related to Job Offloading. I don't know if you create your pages inside a Sling job or not, but given this stack trace I don't think, that these 2 aspects are related. Which version of AEM are you using? What is the version number of the bundle "com.adobe.granite.offloading.core"?

kind regards;
Jörg

Avatar

Level 1

Thanks, It's a custom implementation. I'm running it on AEM6.0 with sp2 installed.

Adobe Granite Offloading Core com.adobe.granite.offloading.core
         
Symbolic Namecom.adobe.granite.offloading.core
Version1.0.16