404 when access resource using /etc.clientlib proxy | Community
Skip to main content
New Participant
Sep 1, 2017 9:32 PM UTC
Solved

404 when access resource using /etc.clientlib proxy

I am getting a 404 error when trying to reference an image resource under a clientlib folder. According to the documentation, this should work. I am able to verify that the image can be opened using the /app path so I know that the ACL and path are correct.  It seems like there is something else interfering with the resolution of etc.clientlibs proxy.  Can anyone please give me some hints on what might be wrong? 

Client lib folder with allowproxy = true

/app/myproject/clientlibs/clientlib-base/

Image location:

/app/myproject/clientlibs/clientlib-base/images/1.png

URL 404 error:

/etc.clientlibs/myproject/clientlibs/clientlib-base/images/1.png

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
StanleyorAccepted solution
Level 3
Sep 4, 2017 8:04 AM UTC

I am experiencing the same problem without dispatcher. Using localhost:4503

04.09.2017 09:55:13.700 *INFO* [0:0:0:0:0:0:0:1 [1504511713699] GET /etc.clientlibs/project/components/translation-container/clientlibs/css/images/translation.svg HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.ClientLibraryProxyServlet Unable to proxy static resources at project/components/translation-container/clientlibs/css/images/translation.svg. Not allowed outside resources.

allowProxy on the translation-container component set to {Boolean}true

7 replies

Level 2
Apr 27, 2020 3:14 PM UTC
simsteve7
New Participant
Nov 24, 2017 3:18 PM UTC

I don't agree. Images and fonts referred by in the css can also live in the clientlibs for sure. Following AEM documentation resources within a clientlib (Using Client-Side Libraries)​ should also be accessible.

It's not clear in the documentation but I found out that com.adobe.granite.ui.clientlibs.impl.ClientLibraryProxyServlet only proxies resources under the folder resources/. Also subfolders can be used.

So /app/myproject/clientlibs/clientlib-base/images/1.png should move to /app/myproject/clientlibs/clientlib-base/resources/images/1.png

Translate
New Participant
Sep 6, 2017 10:38 PM UTC

Understood. I wouldn't normally put web asset under /app. However, that said, I still hope to see documentation updated on the proxy rule and the naming restriction for clientlib impl. It would have saved a lot of time figuring it out. And if the proxy rule is not currently configurable, I hope to see it become available in the future. It will give developers more implementation flexibility.

Translate
Level 3
Sep 5, 2017 9:27 PM UTC

With all do respect - clientlibs are only for CSS and Javascript code. They are don't have anything common with images or other static content so that is why it won't work as expected.

Translate
New Participant
Sep 5, 2017 8:46 PM UTC

We are not using dispatcher.  Stanleyor's finding matches what our finding too. The implementation restricts assets only in the folder named 'resources'.  Do you know if the Proxy rule is configurable and where to configure it?

Translate
StanleyorAccepted solution
Level 3
Sep 4, 2017 8:04 AM UTC

I am experiencing the same problem without dispatcher. Using localhost:4503

04.09.2017 09:55:13.700 *INFO* [0:0:0:0:0:0:0:1 [1504511713699] GET /etc.clientlibs/project/components/translation-container/clientlibs/css/images/translation.svg HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.ClientLibraryProxyServlet Unable to proxy static resources at project/components/translation-container/clientlibs/css/images/translation.svg. Not allowed outside resources.

allowProxy on the translation-container component set to {Boolean}true

Translate
Feike_Visser1
Employee
Sep 3, 2017 7:24 AM UTC

Is this via the dispatcher?

Translate