【问题标题】:"invalid version format" p.nettyException with play 2.2.1播放 2.2.1 的“无效版本格式”p.nettyException
【发布时间】:2014-08-03 15:34:20
【问题描述】:

我的路线文件看起来像

GET     /                           controllers.Application.index()
POST    /get_token                  controllers.Application.getToken()

GET for '/' 工作正常。 但是,“/get_token”的 POST 失败并显示以下错误消息。

[error] p.nettyException - Exception caught in Netty
java.lang.IllegalArgumentException: invalid version format: =Dᅥメ$_!HBユHᅢ￝W(￀+￀/゙ᅩᅩ￀
    at org.jboss.netty.handler.codec.http.HttpVersion.<init>(HttpVersion.java:102) ~[netty.jar:na]
    at org.jboss.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:62) ~[netty.jar:na]
    at org.jboss.netty.handler.codec.http.HttpRequestDecoder.createMessage(HttpRequestDecoder.java:75) ~[netty.jar:na]
    at org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:189) ~[netty.jar:na]
    at org.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:101) ~[netty.jar:na]
    at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:500) ~[netty.jar:na]

我正在使用 play-2.2.1。
我比较新玩。 有人能帮帮我吗?

提前致谢!

【问题讨论】:

    标签: playframework playframework-2.2


    【解决方案1】:

    您是通过 https 连接的吗?如果是这样,您可能没有设置证书。

    最简单的解决方法是通过 http 而不是 https 进行连接。但是,如果你真的想要 https,你可以生成一个自签名证书:

    keytool -genkey -alias MyKey -keyalg RSA -keysize 2048 -keystore keystore.jks play -Dhttps.port=9443 -Dhttps.keyStore=keystore.jks -Dhttps.keyStorePassword=password run

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-11
      • 1970-01-01
      相关资源
      最近更新 更多