Expand my Community achievements bar.

Domain mapping- Issues

Avatar

Level 3

Hi everyone,

I am currently struggling to understand how to correctly have my domain mapped on an AEM publish instance. I have an Amazon EC2 instance running Tomcat Linux and have the proper security/network permissions setup. I can connect to my AEM instance with the provided domain Amazon generates, BUT am having issues mapping that incoming domain in AEM.

The content path I want to visit is /content/mysite/index.html. I created the following Sling mapping in etc/http/:

sling:match                          '<awsdomain>.4503'

sling:internalRedirect         'content/mysite/index.html'. 

The redirect does happen, BUT then I start getting the following errors from any of the Javascript files I have "<Javascript file> failed because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.". When I remove the mapping and access /content/mysite/index.html, there are no such errors. I am at a loss at what is wrong.

Side note: I noticed that when a default AEM publish instance is installed the Day CQ Root Mapping configuration is set to "content.html". And this automatically redirects to the outdoor geometrixx website despite there being no specific mappings in etc/http. It was not listed in the 'cheatsheet' sticky post in this forum, and I wonder how it is even working and if its related to my current issue.

Thank you,

Ali



 

5 Replies

Avatar

Level 3

Can anyone confirm at least if the sling:mapping is set up correctly to achieve my goal?

Avatar

Level 10

The sling mapping looks fine as per the AEM dics here: https://docs.adobe.com/docs/en/aem/6-1/deploy/configuring/resource-mapping.html. I have never heard of the other issue.i will check with support.

Avatar

Level 3

Thanks Scott! And aniruddhak, I have used Firefox and Chrome.

I may have stumbled upon what is wrong. I found this post when I was looking for potential problems with Jetty serving incorrect MIME types. http://stackoverflow.com/questions/15852443/why-is-jetty-serving-css-with-text-html-content-type

It seemed like the default servlet/servletContext was being bypassed for some reason with my mapping. I then went to system/console/configMgr and looked up the Apache Felix Jetty Based Http Service. Sure enough there was the following field with a "/" value.


 

I am not a DevOps expert, but I am going to continue researching the Servlet issue. Any other ideas/comments are appreciated.

Avatar

Level 3

It is Servlet related, in terms of which is decided on by Sling. The mapping I described above produces the following request log for the css file. Note how the servlet used is DefaultGetServlet and how slingRequestPathInfo is incorrect( putting the path to the Page resource, labeling the extension as 'htmletc', and the suffix).
 

0 (2016-08-24 22:29:37) TIMER_START{Request Processing} 0 (2016-08-24 22:29:37) COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message> 0 (2016-08-24 22:29:37) LOG Method=GET, PathInfo=/etc/designs/dashboardangular/coredashboard.css 0 (2016-08-24 22:29:37) TIMER_START{ResourceResolution} 0 (2016-08-24 22:29:37) TIMER_END{0,ResourceResolution} URI=/etc/designs/dashboardangular/coredashboard.css resolves to Resource=JcrNodeResource, type=cq:Page, superType=null, path=/content/dashboardangular/index 0 (2016-08-24 22:29:37) LOG Resource Path Info: SlingRequestPathInfo: path='/content/dashboardangular/index', selectorString='null', extension='htmletc', suffix='/designs/dashboardangular/coredashboard.css' 0 (2016-08-24 22:29:37) TIMER_START{ServletResolution} 0 (2016-08-24 22:29:37) TIMER_START{resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/dashboardangular/index)} 0 (2016-08-24 22:29:37) TIMER_END{0,resolveServlet(JcrNodeResource, type=cq:Page, superType=null, path=/content/dashboardangular/index)} Using servlet org.apache.sling.servlets.get.DefaultGetServlet 0 (2016-08-24 22:29:37) TIMER_END{0,ServletResolution} URI=/etc/designs/dashboardangular/coredashboard.css handled by Servlet=org.apache.sling.servlets.get.DefaultGetServlet

 

When I access the site directly or use another mapping, the following request log is produced. Note how it is the HtmlLibraryServlet now and the correct SlingRequestPathInfo is being relayed.

 

0 (2016-08-24 22:31:22) TIMER_START{Request Processing} 0 (2016-08-24 22:31:22) COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message> 0 (2016-08-24 22:31:22) LOG Method=GET, PathInfo=/etc/designs/dashboardangular/coredashboard.css 0 (2016-08-24 22:31:22) TIMER_START{ResourceResolution} 5 (2016-08-24 22:31:22) TIMER_END{5,ResourceResolution} URI=/etc/designs/dashboardangular/coredashboard.css resolves to Resource=JcrNodeResource, type=cq:ClientLibraryFolder, superType=null, path=/etc/designs/dashboardangular/coredashboard 5 (2016-08-24 22:31:22) LOG Resource Path Info: SlingRequestPathInfo: path='/etc/designs/dashboardangular/coredashboard', selectorString='null', extension='css', suffix='null' 5 (2016-08-24 22:31:22) TIMER_START{ServletResolution} 5 (2016-08-24 22:31:22) TIMER_START{resolveServlet(JcrNodeResource, type=cq:ClientLibraryFolder, superType=null, path=/etc/designs/dashboardangular/coredashboard)} 5 (2016-08-24 22:31:22) TIMER_END{0,resolveServlet(JcrNodeResource, type=cq:ClientLibraryFolder, superType=null, path=/etc/designs/dashboardangular/coredashboard)} Using servlet com.day.cq.widget.impl.HtmlLibraryServlet 5 (2016-08-24 22:31:22) TIMER_END{0,ServletResolution} URI=/etc/designs/dashboardangular/coredashboard.css handled by Servlet=com.day.cq.widget.impl.HtmlLibraryServlet

No idea why the distinction happens

Avatar

Level 2

in which browser you are tyring,can you try in Firefox