My website is not coming with styles in Publish Instance. | Community
Skip to main content
Level 2
May 19, 2020
Solved

My website is not coming with styles in Publish Instance.

  • May 19, 2020
  • 6 replies
  • 8150 views

Dear All,

I have just created a new training website in my local AEM 6.5.

 

It is coming fine in Author instance (http://localhost:4502/content/grs/en.html)

 

But it is not coming fine in my Publish Instance (http://localhost:4503/content/grs/en.html)

 

Can anybody help me on this , If I am missing anything. I have included my all clientlibs and categories.

 

My Simple code is in below github.

 

https://github.com/sunita197881/sunitaAEM65

 

Can anybody please help me on this ..

Thanks

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by leoberliant

You need to verify that all components and clientlibs are published from the author to the publish. You can even log in to AEM publish CRXDe and verify that they all exist.

If the above is completed and you still have an issue, try to force clientlibs to recompile:

https://helpx.adobe.com/ca/experience-manager/kb/How-to-force-a-recompilation-of-all-Sling-scripts-jsps-java-sightly-on-AEM-6-4.html

 

In case it still does not come as expected, you need to study log files and review the page in a browser dev tool.

 

6 replies

ArpitVarshney
Community Advisor
Community Advisor
May 19, 2020

Hi @sunitac93243435 

 

Can you share the error logs?

 

Also Could you please make sure:

  • Your author has been connected to publish instance or not?
  • Your code has been installed/replicated in publish instance and bundles are active?
  • Your content has been published successfully?

Regards,

Arpit Varshney

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 19, 2020

Hi @sunitac93243435,

Can you show me where does your client library live? is it here? Did you want to resolve https://github.com/sunita197881/sunitaAEM65/tree/master/ui.apps/src/main/content/jcr_root/apps/sunitaAEM65/clientlibs/clientlib-site ? 

I can see that you are missing allowProxy, If a client library is located under /apps, this property allows access to it via proxy servlet (change /apps/* to /etc.clientlibs/*) (documentation). For security purposes, we never want to expose /apps to the public, therefore the anonymous user does not have permission to accessing the clientlibrary from /apps path. /etc.clientlibs are accessible by anonymous.

 

File: https://github.com/sunita197881/sunitaAEM65/tree/master/ui.apps/src/main/content/jcr_root/apps/sunitaAEM65/clientlibs/clientlib-site 

 

 

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" allowProxy="{Boolean}true" jcr:primaryType="cq:ClientLibraryFolder" categories="[grs.site]" />

 

Once above have been configured, try accessing the client library at http://localhost:4502/etc.clientlibs/sunitaAEM65/clientlibs/clientlib-site.css  or http://localhost:4502/etc.clientlibs/sunitaAEM65/clientlibs/clientlib-site.js. If the client library can be resolved, then you have successfully enabled the allowProxy! Now about your page not resolving the correct styles; take a moment to view page source, try to find /etc.clientlibs/sunitaAEM65/clientlibs/clientlib-site.js or CSS, if the client library reference does not exist on the page, this means that your basepage component or editable template configuration, does not reference or include the "grs.site" clientlib category.

 

 

 

 

 

 

 

Level 3
May 19, 2020

When your code is deployed to vanilla instance:

1) Referred Template type is missing (its not present in codebase)

2) Event when corrected, In author also page css is not loading, please recheck if you have missed commiting required css related to page.

leoberliantAdobe EmployeeAccepted solution
Adobe Employee
May 19, 2020

You need to verify that all components and clientlibs are published from the author to the publish. You can even log in to AEM publish CRXDe and verify that they all exist.

If the above is completed and you still have an issue, try to force clientlibs to recompile:

https://helpx.adobe.com/ca/experience-manager/kb/How-to-force-a-recompilation-of-all-Sling-scripts-jsps-java-sightly-on-AEM-6-4.html

 

In case it still does not come as expected, you need to study log files and review the page in a browser dev tool.

 

ArpitVarshney
Community Advisor
Community Advisor
May 19, 2020

Hi @sunitac93243435 

One reason might be that If you are using an editable template then you should check if the anonymous user has read access to your template. If not the please give it.

 

Regards,

Arpit

Level 2
May 24, 2020

Dear All,

 

Thanks a lot for all of your suggestion..But still now I am not able to see the css and js in the publish instance.

 

I have done the below steps

 

1) added allowProxy for both clientlibs.base and clientlibs.site

2)  Rebuild Libraries for both author and publish by using below

http://localhost:4502/libs/granite/ui/content/dumplibs.rebuild.html?back=true

http://localhost:4503/libs/granite/ui/content/dumplibs.rebuild.html?back=true

3) I got the below log from publish instance

 

******************access.log*******************
127.0.0.1 - admin 24/May/2020:20:39:01 +0530 "GET /bin/receive?sling:authRequestLogin=1 HTTP/1.1" 200 32 "-" "Jakarta Commons-HttpClient/3.1"
0:0:0:0:0:0:0:1 - admin 24/May/2020:20:39:26 +0530 "GET /content/grs/en.html HTTP/1.1" 200 15409 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
127.0.0.1 - admin 24/May/2020:20:39:31 +0530 "GET /bin/receive?sling:authRequestLogin=1 HTTP/1.1" 200 32 "-" "Jakarta Commons-HttpClient/3.1"


************8Request Log**********************
24/May/2020:20:39:26 +0530 [688] -> GET /content/grs/en.html HTTP/1.1
24/May/2020:20:39:26 +0530 [688] <- 200 text/html 79ms
24/May/2020:20:39:31 +0530 [689] -> GET /bin/receive?sling:authRequestLogin=1 HTTP/1.1
24/May/2020:20:39:31 +0530 [689] <- 200 application/octet-stream 1ms

 

****************Error Log******************
24.05.2020 20:39:26.264 *WARN* [0:0:0:0:0:0:0:1 [1590332966226] GET /content/grs/en.html HTTP/1.1] com.day.cq.dam.core.impl.AssetImpl Asset ID for asset at /content/dam/grs/asset.jpg doesn't exist
24.05.2020 20:39:26.270 *WARN* [0:0:0:0:0:0:0:1 [1590332966226] GET /content/grs/en.html HTTP/1.1] com.day.cq.dam.core.impl.AssetImpl Asset ID for asset at /content/dam/grs/asset.jpg doesn't exist
24.05.2020 20:39:26.277 *WARN* [0:0:0:0:0:0:0:1 [1590332966226] GET /content/grs/en.html HTTP/1.1] com.day.cq.dam.core.impl.AssetImpl Asset ID for asset at /content/dam/grs/asset.jpg doesn't exist
24.05.2020 20:39:26.283 *WARN* [0:0:0:0:0:0:0:1 [1590332966226] GET /content/grs/en.html HTTP/1.1] com.day.cq.dam.core.impl.AssetImpl Asset ID for asset at /content/dam/grs/asset.jpg doesn't exist

 

 

4) Clear chrome browser cache and tested but with no luck

 

I have uploaded my packages under below github.

https://github.com/sunita197881/sunitaAEM65/tree/feature-sunitaAEM65Packages

 

 

 

BrianKasingli
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 25, 2020
Hello, can you provide us with the publish instances client library URL for CSS and JS. I want to have a look at the formatting. You can easily find the URL from "view source".