Friday, December 13, 2019

How to Fix HTTP 404 when clicking Oracle APEX's Top Apps Links under ORDS

Fixing Problem on clicking links under Top Apps (RFC 7230 and RFC 3986 violations)



Recently, I setup the Oracle APEX ORDS on Tomcat and encountered the problem.




You might encounter an error similar to the following when clicking any links under Top Apps
Message Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986


After checking it is caused by the | character appearing in URL Query.

The problem is originated by an illegal character "|" appearing in APEX URL Query String. To solve it, we need to modify the Tomcat to accept such special query character.



Solution : Add the relaxedQueryChars option to the connector and restart tomcat

(some tomcat server.xml is located at /opt/tomcat/conf or /usr/local/tomcat/conf... , depending on your tomcat home directory during installation, mine is under /opt/tomcat/latest/conf...)
# vi /opt/tomcat/latest/conf/server.xml
Add the red line
   
               connectionTimeout="20000"
               relaxedQueryChars="|"
               redirectPort="8443" />


Then restart your tomcat server
# systemctl tomcat restart








Hope nobody struggles on this any more !!!