Pergunta

After upgrading to play 2.2, I get the following error:

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)

I am running on OS X, the latest JDK from Oracle, upgrade plugins for play 2.2.0 and sbt 0.13, vis-a-vis:

"play 2.2.0 built with Scala 2.10.2 (running Java 1.7.0_40), http://www.playframework.com"

on startup.

Can't figure out how to resolve this, help greatly appreciated.

Foi útil?

Solução

Ok I found the problem and it's a problem linked to the dependencies of your project. Play 2.2.0 is delivered with a dep on XercesImpl 2.11.0.

In Play.Scala line 45, there are these lines:

    SAXParserFactory.newInstance("org.apache.xerces.jaxp.SAXParserFactoryImpl", Play.getClass.getClassLoader)

...

// new line in play2.2.0
xercesSaxParserFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)

So if you have another library in your project that depends on an older version of XercesImpl (as in my case), the classloader may use an older "org.apache.xerces.jaxp.SAXParserFactoryImpl" which doesn't support "XMLConstants.FEATURE_SECURE_PROCESSING".

You should analyze your deps and try to find the dependency responsible of the problem. In my case, it's tricky because this is an old, no more supported library and it requires an old Xerces... not an easy solution :(

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top