ThymeLeaf, SAX Parser and WebLogic 10.3.5

Using ThymeLeaf on WebLogic 10.3.5 I was getting the following warning message.

[code lang=”java”] WARN : org.thymeleaf.templateparser.xmlsax.XhtmlAndHtml5NonValidatingSAXTemplateParser - [THYMELEAF] The SAX Parser implementation being used ("weblogic.xml.jaxp.RegistrySAXParser") does not implement the "reset" operation. This will force Thymeleaf to re-create parser instances each time they are needed for parsing templates, which is more costly. Enabling template cache is recommended, and also using a parser library which implements "reset" such as xerces version 2.9.1 or newer. [/code]

Pretty self explanatory, so how did I go about fixing this.

Added the following to pom.xml [code lang=”xml” title=”pom.xml”] <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.9.1</version> </dependency> <dependency> <groupId>xalan</groupId> <artifactId>xalan</artifactId> <version>2.7.1</version> </dependency> [/code]

Edited weblogic-application.xml [code lang=”xml” title=”src/main/application/META-INF/weblogic-application.xml”] <?xml version="1.0" encoding="UTF-8"?> <weblogic-application xmlns="http://xmlns.oracle.com/weblogic/weblogic-application" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.4/weblogic-application.xsd"> <xml> <parser-factory> <saxparser-factory>org.apache.xerces.jaxp.SAXParserFactoryImpl</saxparser-factory> <document-builder-factory>weblogic.xml.jaxp.WebLogicDocumentBuilderFactory</document-builder-factory> <transformer-factory>org.apache.xalan.processor.TransformerFactoryImpl</transformer-factory> </parser-factory> </xml> <prefer-application-packages> <package-name>org.springframework.</package-name> <package-name>org.apache.xerces.parsers.</package-name> <package-name>org.apache.xalan.*</package-name> </prefer-application-packages> </weblogic-application> [/code]

Finally updated weblogic.xml [code lang=”xml” title=”src/main/webapp/WEB-INF/weblogic.xml”] <?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"> <container-descriptor> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor> <context-root>xxxxxx</context-root> </weblogic-web-app> [/code]

Deployed and the warning message was gone.

Loading Google+ Comments ...