Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Please help in below issue.

Avatar

Level 7

1.Created file @^test.docx in assets.

akshaybhujbale_1-1664514169802.png

2. After hitting querybuilder api for 

akshaybhujbale_2-1664514268127.png

3. Why it showing different path for above asset?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@akshaybhujbale If you will look into stack trace you will see that it fails during java.net.URI object creation. Looking into documentation of URI, you can see following information:

URISyntaxException - If the given string violates RFC 2396, as augmented by the above deviations


Going into RFC 2396https://www.rfc-editor.org/rfc/rfc2396, section 2.4.3 is what you probably looking for, as it clearly list disallowed characters with proper reasoning. So this is potentially list of character that could be problematic from Query Builder Debugger tool perspective.

rfc.png

In case this is not enough, you can always create simple piece of code that will create URI object and at the same time examine if creation of URI object will fail or not.

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @akshaybhujbale,

The root cause of behavior you have described, is a fact that in name of one of the asset - @^test.docx - you are using invalid character from URI perspective. Most likely you can see below error in the log:

org.apache.sling.xss.impl.XSSAPIImpl Invalid URI.
java.net.URISyntaxException: Illegal character in path at index 25: /content/dam/aem_folder/@^test.docx

In other words Query Builder Debugger tool is not able to generate proper link to @^test.docx resource.

In general character that cause the issue is ^ - please have a look into RFC 2396 - https://www.rfc-editor.org/rfc/rfc2396 - which describe URI specification including allowed and restricted characters.

Avatar

Level 7

Hi @lukasz-m  Thank you so much 

Please let me know what are the invalid characters for which Query Builder Debugger tool is not able to generate proper link.

Avatar

Correct answer by
Community Advisor

@akshaybhujbale If you will look into stack trace you will see that it fails during java.net.URI object creation. Looking into documentation of URI, you can see following information:

URISyntaxException - If the given string violates RFC 2396, as augmented by the above deviations


Going into RFC 2396https://www.rfc-editor.org/rfc/rfc2396, section 2.4.3 is what you probably looking for, as it clearly list disallowed characters with proper reasoning. So this is potentially list of character that could be problematic from Query Builder Debugger tool perspective.

rfc.png

In case this is not enough, you can always create simple piece of code that will create URI object and at the same time examine if creation of URI object will fail or not.