How to disable accessExternalDTD and entityExpansionLimit warnings with logback

后端 未结 4 772
迷失自我
迷失自我 2021-01-31 17:03

I\'m using logback with groovy and get lots of warnings showing up when parsing xml. I am aware of the bug in JDK1.7_u45 that is causing this.

Warning:  org.apa         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 17:28

    Old question I know, just wanted to post a shortcut. As mentioned in the answer by Dana Britzman newer versions of the JRE have the Xerces and Xalan implementation built into it. More importantly, the JRE version properly supports the accessExternalDTD and entityExpansionLimit properties.

    I needed a xalan implementation, and did as below

    TransformerFactory tf = com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newInstance("com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl", null);
    

提交回复
热议问题