Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

My website is not coming with styles in Publish Instance.

Avatar

Level 2

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

 

1 Accepted Solution

Avatar

Correct answer by
Employee

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-j...

 

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

 

View solution in original post

9 Replies

Avatar

Community Advisor

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

Avatar

Community Advisor

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/sunit... ? 

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/sun... 

 

 

<?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.

 

 

 

 

 

 

 

Avatar

Level 4

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.

Avatar

Correct answer by
Employee

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-j...

 

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

 

Avatar

Community Advisor

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

Avatar

Level 2

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

 

 

 

Avatar

Community Advisor
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".

Avatar

Level 2

Hi Brian...Are you referring to below Publish URL from "view source"?

 

1)   view-source:http://localhost:4503/content/grs/en.html

2) View source of Publish instance

<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>English</title>


<meta name="template" content="content-page"/>

<meta property="og:title" content="English"/>
<meta property="og:url" content="http://localhost:4503/content/grs/en.html"/>
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="Training Site"/>
<meta property="og:image" content="http://localhost:4503/content/grs/en.thumb.800.480.png?ck="/>

<link rel="stylesheet" href="/etc.clientlibs/sunitaAEM65/clientlibs/clientlib-base.css" type="text/css">

</head>
<body class="page basicpage">



<div id="fb-root"></div>


<script type="text/javascript" src="/etc.clientlibs/core/wcm/components/page/v2/page/clientlibs/site/sharing.js"></script>



<div class="root responsivegrid">

3) Publish clientlib-site.css

http://localhost:4503/etc.clientlibs/sunitaAEM65/clientlibs/clientlib-site.css

 

Note That , if you will open my github (https://github.com/sunita197881/sunitaAEM65/tree/feature-sunitaAEM65Packages) , you can download both app and content package and can install in your local.

Avatar

Employee
GitHub package contains a default site with one page peg a language tree only... I deployed packages, replicate both packages via a Package Manager, and activated /content/grs/en.html. en.html locks alike on the author and publish