Issue
- When accessing adaptive media URL's over public IP eg: http://Public_IP:8080/o/adaptive-media/image/35333/Thumbnail-300x300/url.png?t=1588749467134, the page gets redirected to the home page. While accessing the adaptive media URLs using localhost, 127.0.0.1, Server_IP, Private_IP its working fine.
-
Steps to reproduce:
- Start the server of the vanilla instance
- Ref here, How to view and construct an adaptive media URL for a document
- For testing purpose, enabled debug level for com.liferay.portal.servlet.filters.authverifier and com.liferay.adaptive.media.web.internal.servlet.filter
- Hit the adaptive media URL using public IP. Example: [http://PUBLIC_IP:PORT/ o/adaptive-media/image/35333/Thumbnail-300x300/url.png]
- Observed behavior: The reported issue persists with adaptive media URL but the document URL is working fine.
- In the log, the below error has thrown
ERROR [http-nio-8080-exec-10][TrashEntryServiceImpl:114] com.liferay.portal.kernel.exception.SystemException: Couldn't initialize a SAX driver to create an XMLReader
com.liferay.portal.kernel.exception.SystemException: Couldn't initialize a SAX driver to create an XMLReader
at com.liferay.portal.store.s3.S3Store.transform(S3Store.java:902)
at com.liferay.po
Environment
- Liferay DXP 7.2 vanilla setup with S3 integration
Resolution
- To resolve this issue, a SAXParser should be defined manually to fix the SAXParser errors while working with S3Store.
-
Step 1:
-
If you are using an app server like Apache Tomcat, then the below property should be included in a
system-ext.properties
file and place it under /WEB-INF/classes/ in the Liferay DXP installation’s classpath. Restart the server.
-
If you are using an app server like Apache Tomcat, then the below property should be included in a
org.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser
-
Step 2:
- Open the dev-tools console in the browser
- Navigate to the Network tab,
- Check the Disable cache box, and reloading the adaptive media URL directly, the image could be reached.
Additional Information