Skip to main content
Level 2
Oct 16, 2015 2:27 AM UTC
Solved

AEM 5.6.1 currentPage object is null on publish server.

Hi,

I hope you can help.

We are currently in the middle of upgrading from 5.4 to 5.6.1 and its all gone quite smoothly with the testing in the authoring environment. However, when the components are deployed to the publish server there are a lot of exceptions thrown. On referring back to the code all the lines in question seem to be using currentPage in some way.

Has anybody had an experience like this? Or know why currentPage appears to be null.

Regards

Damian.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Feike_Visser1
Feike_Visser1Accepted solution
Adobe Employee
Oct 16, 2015 2:27 AM UTC

Yes, getTemplate() shouldn't be used anymore on publish since 5.5...

use getProperties().get("cq:template","")

6 replies

DPMAuthor
Level 2
Oct 16, 2015 2:27 AM UTC

Ahh, I see its down to being an anonymous user which explains why it works in auth.

 

Thanks alot guys.

Translate
Sham_HC
Level 10
Oct 16, 2015 2:27 AM UTC

That is the cause & agree with Feike.  http://blogs.adobe.com/livecycle/2012/06/developers-faq-on-cq5-5.html

Translate
DPMAuthor
Level 2
Oct 16, 2015 2:27 AM UTC

Thanks, I'll update that. It does work in our auth environment though, and there is the other issue so I'm not sure it's the root cause.

Translate
Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
Oct 16, 2015 2:27 AM UTC

Yes, getTemplate() shouldn't be used anymore on publish since 5.5...

use getProperties().get("cq:template","")

Translate
DPMAuthor
Level 2
Oct 16, 2015 2:27 AM UTC

Yes, it seems to complain about that in most cases. However it does seem to complain about pageHelper.getClasses(currentPage). Which is why i moved my investigation from templates to the currentPage object.

Translate
Feike_Visser1
Adobe Employee
Adobe Employee
Oct 16, 2015 2:27 AM UTC

Are you using getTemplate()?

Translate