Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"invalid version format" p.nettyException with play 2.2.1

My routes file looks like

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

GET for '/' works fine. However, POST for '/get_token' fails with following error message.

[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]

I am using play-2.2.1.
I am relatively new to play. Can some one help me out?

Thanks in advance!

like image 384
Nullpoet Avatar asked Oct 21 '22 04:10

Nullpoet


1 Answers

Are you connecting via https? If so, you may not have a certificate set up.

The simplest fix would be to connect via http instead of https. If you really want https, though, you could generate a self-signed certificate:

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

like image 76
Steve Avatar answered Dec 21 '22 12:12

Steve