升级到2.2后,我收到以下错误:
org.xml.sax.SAXNotRecognizedException: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source)
at play.api.Play$.<init>(Play.scala:45)
at play.api.Play$.<clinit>(Play.scala)
at play.core.server.NettyServer$$anonfun$12.apply(NettyServer.scala:152)
at play.core.server.NettyServer$$anonfun$12.apply(NettyServer.scala:151)
at scala.Option.foreach(Option.scala:236)
at play.core.server.NettyServer.<init>(NettyServer.scala:151)
at play.core.server.NettyServer$$anonfun$mainDev$1.apply(NettyServer.scala:310)
at play.core.server.NettyServer$$anonfun$mainDev$1.apply(NettyServer.scala:308)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.core.server.NettyServer$.mainDev(NettyServer.scala:307)
at play.core.server.NettyServer$.mainDevHttpMode(NettyServer.scala:303)
at play.core.server.NettyServer.mainDevHttpMode(NettyServer.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:233)
at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:91)
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
我在OS X上运行,这是来自Oracle的最新JDK,升级插件为2.2.0和sbt 0.13,相对于:
"play 2.2.0 built with Scala 2.10.2 (running Java 1.7.0_40), http://www.playframework.com"
启动时。
无法弄清楚如何解决这个问题,非常感谢。
答案 0 :(得分:3)
好的,我发现了问题,这是与项目依赖关系相关的问题。 Play 2.2.0与XercesImpl 2.11.0上的dep一起提供。
在Play.Scala第45行中,有以下几行:
SAXParserFactory.newInstance("org.apache.xerces.jaxp.SAXParserFactoryImpl", Play.getClass.getClassLoader)
...
// new line in play2.2.0
xercesSaxParserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)
因此,如果您的项目中有另一个库依赖于旧版XercesImpl(在我的情况下),则类加载器可能会使用较旧的&#34; org.apache.xerces.jaxp.SAXParserFactoryImpl&#34;它不支持&#34; XMLConstants.FEATURE_SECURE_PROCESSING&#34;。
您应该分析您的deps并尝试找到负责该问题的依赖项。 就我而言,它很棘手,因为这是一个旧的,不再受支持的库,它需要一个旧的Xerces ......不是一个简单的解决方案:(