【问题标题】:SAXNotRecognizedException in Play for Scala 2.6Scala 2.6 中的 SAXNotRecognizedException
【发布时间】:2023-04-02 06:14:01
【问题描述】:

我正在从 Play 2.5 迁移到 2.6,应用程序编译没有问题,但是当我启动 Play 时,出现以下异常。错误提到AkkaHttpServer - Play 2.6 中新的默认 HTTP 服务器。我尝试将取自 Play 网站的 Akka HTTP 服务器标准配置添加到 application.conf,但我仍然遇到同样的错误。

查看SAX Exception 它说有一个解析器无法识别的属性。任何想法如何解决这个问题?

play.api.UnexpectedException:意外 异常[ExceptionInInitializerError: null] 在 play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:190) 在 play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124) 在 play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202) 在 play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:117) 在 akka.stream.impl.fusing.MapAsync$$anon$25.onPush(Ops.scala:1194) 在 akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519) 在 akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:482) 在 akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378) 在 akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:585) 在 akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:469) 原因:java.lang.ExceptionInInitializerError:null 在 play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:177) 在 play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124) 在 play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202) 在 play.core.server.AkkaHttpServer.$anonfun$createServerBinding$1(AkkaHttpServer.scala:117) 在 akka.stream.impl.fusing.MapAsync$$anon$25.onPush(Ops.scala:1194) 在 akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:519) 在 akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:482) 在 akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:378) 在 akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:585) 在 akka.stream.impl.fusing.GraphInterpreterShell$AsyncInput.execute(ActorGraphInterpreter.scala:469) 原因:org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/disallow-doctype-decl 在 org.apache.xerces.parsers.AbstractSAXParser.setFeature(AbstractSAXParser.java:1508) 在 org.apache.xerces.jaxp.SAXParserImpl.setFeatures(SAXParserImpl.java:145) 在 org.apache.xerces.jaxp.SAXParserImpl.(SAXParserImpl.java:128) 在 org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:112) 在 org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:140) 在 play.api.Play$.(Play.scala:58) 在 play.api.Play$.(Play.scala) 在 play.core.server.DevServerStart$$anon$1.reload(DevServerStart.scala:177) 在 play.core.server.DevServerStart$$anon$1.get(DevServerStart.scala:124) 在 play.core.server.AkkaHttpServer.handleRequest(AkkaHttpServer.scala:202)

【问题讨论】:

    标签: scala playframework akka akka-http playframework-2.6


    【解决方案1】:

    经过长时间的错误尝试,我发现将commons-dbcp 的版本从 1.2 更改为 1.4 可以解决问题。错误消息似乎没有指向解决方案。

    【讨论】:

      猜你喜欢
      • 2018-06-25
      • 1970-01-01
      • 2019-02-16
      • 1970-01-01
      • 2018-10-13
      • 1970-01-01
      • 2012-08-07
      • 2019-04-04
      • 2017-07-21
      相关资源
      最近更新 更多