Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

No able to access file located in /etc/test folder

snehag07
Level 2
Level 2

Hi,

I am using AEM 6.3 version.

I am trying to access file componentId.jsp located in /etc/test folder from /apps/myWebsite, but I am getting file not found error.

I checked the permissions, it is present.

Could you please suggest?

I was able to do it in AEM 6.2 version.

1 Accepted Solution
smacdonald2008
Correct answer by
Level 10
Level 10

Yes - it no longer works in 6.3.

View solution in original post

0 Replies
susheel
Level 5
Level 5

Hi Sneha,

How are you trying to access? Can you post you code here.

Post your errors as well if you find any.    

snehag07
Level 2
Level 2

/apps/myWebsite/components/testComponent.jsp

<%@include file="/libs/foundation/global.jsp"%>

<%@include file="/etc/test/componentId.jsp"%>

<some code>

/etc/test/componentId.jsp

<%@include file="/libs/foundation/global.jsp"%>

<some code>

I am getting

org.apache.sling.scripting.jsp.jasper.JasperException : /apps/myWebsite/components/testComponent.jsp File "/etc/test/componentId.jsp" not found

susheel
Level 5
Level 5

Are you trying this from admin user ?    

smacdonald2008
Level 10
Level 10

Have you tried other files in other JCR locations. Try ruling out this issue is only applicable to this location.

snehag07
Level 2
Level 2

I tried to include <%@include file="/libs/foundation/global.jsp"%>

It is loading properly, with no error

smacdonald2008
Level 10
Level 10

I will try this on my end - see if this occurs!

susheel
Level 5
Level 5

Even I tried it gives not found error for some reason in 6.3.

smacdonald2008
Level 10
Level 10

I was able to reproduce under etc. However - i put the JSP under apps and it worked:

appsView.png

Veena_Vikram
Community Advisor
Community Advisor

Yes. Under etc, files are not getting included. Not sure if this is any kind of restriction. I don't see any files other than clienlibs in etc too.

snehag07
Level 2
Level 2

I  also tried the same, putting jsp under /apps works.

But can you please suggest on the files in /etc, is there any restriction?

Due to due, we will need to do changes in current implementation.

susheel
Level 5
Level 5

Hi Sneha,

Its better to move out JSP out of etc and place it apps.

Move out and do a search and replace of references.

snehag07
Level 2
Level 2

Thank you all for your comments.

I will make the changes accordingly.

Can we say that it is a limitation in AEM 6.3?

As i already mentioned, in previous versions i was able to access jsp file from /etc folder

smacdonald2008
Correct answer by
Level 10
Level 10

Yes - it no longer works in 6.3.

View solution in original post

susheel
Level 5
Level 5

I have checked it in 6.3, it doesn't work there as well. Also etc is not right place for jsp's anyhow.

Veena_Vikram
Community Advisor
Community Advisor

I agree with susheel and scott. Together you have to keep in mind that ultimately you have to let go off JSPs. It should have been high time you rewrote everything to Touch UI and sightly.

susheel
Level 5
Level 5

I agree with Veena. Its better to move on to sightly rather than working on JSP's anymore.

Sightly(HTL) separates out the back end logics to java or javascript use api and front end is just to read the properties, loop the properties and display it. It looks more clean and manageable.

Jörg_Hoh
Employee
Employee

Hi,

That might be the result of the introduction of a service user into the resource resolving process. In earlier versions the sling script resolver used an admin session, and you were able to include files from the complete repository. Now it is using a service user which can read only on /apps and /libs.  That means that you have to place your rendering scripts (JSP, HTL) in /apps and /libs.

That's for security reasons. And I would not change the permissions of that service user!

Jörg