Legacy Knowledge Base
Published Jun. 30, 2025

"Invalid character found in the request target" logs and causing a bad request state

Written By

Giulianna Munoa

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.
Note: please note that Liferay has renamed its Liferay Experience Could offerings to Liferay SaaS (formerly LXC) and Liferay PaaS (formerly LXC-SM).

Issue

  • Trying to access an URL that contains special characters the page fails to load showing a HTTP Status 400 - Bad Request Tomcat page.
  • Also the following logs can be found:
java.lang.IllegalArgumentException: Invalid character found in the request target [/<CLIENT URL CONTAINING SPECIAL CHARACTER>]. 
The valid characters are defined in RFC 7230 and RFC 3986 at
org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:494) at
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:271) at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891) at
org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1703) at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at
org.apache.tomcat.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1190) at
org.apache.tomcat.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:634) at
org.apache.tomcat.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:612) at
java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127) at
java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219) at
java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at
java.base/java.lang.Thread.run(Thread.java:829)

 

Environment

  • Liferay PaaS 7.3+

Resolution

  • This happens because client is using special characters that aren’t supported by default.
  • In order to change the parser config we need to modify the server.xml file and add the following:
relaxadoPathChars="[]|"
relaxadoQueryChars="[]|{}^\`"<>"
  • For Liferay PaaS you can find this file in $REPO/liferay/configs/$ENVIRONMENT/tomcat/conf/server.xml and deploy it to make the change.

Additional Information

 

 

Did this article resolve your issue ?

Legacy Knowledge Base