Hey! I am using Apache http client in jvm module a...
# ktor
m
Hey! I am using Apache http client in jvm module and am getting No field instance of type Lorg/apache/http/message/BasicLineFormatter. However, if use the android client in the http module, then the error vanishes. Is using android client in jvm module feasible?
e
Android engine is fully supported on jvm, but it block the thread on request.
Could you clarify the problem with response?
m
I mean I just want to make simple async http requests in jvm module using coroutines. If I use CIO client, then I get NativePRNGBlocking algorithm not available. Next, I tried Apache client and got a null pointer error because of No field instance of type Lorg/apache/http/message/BasicLineFormatter. But, the Android client seems to work fine.
e
What OS do you use?
m
macOS 10.13.5
e
And what is the jdk version?
You could change random algorithm in
CIO.config { ... }
block.
It’s strange error with
Apache
. Could you file an issue on github?
m
Change to which random algorithm?
e
It depends on jdk version 🙂
m
1.8
e
You could try
SHA1PRNG
, or check for
SecureRandom.getInstance()
name
❤️ 1
openjdk 1.8 or oracle jdk 1.8?
m
Oracle
📝 1
Changing to SHA1PRNG worked🙂
e
Thanks for the report. I’ll try to reproduce and fix the problems tomorrow.
m
Whoops, just discovered that I am getting a number format exception error on using cio because cipher suite being used has minor version as 152-release which is not an int (on Github, the tls library uses - and _ as delimiters while on the local the delimiter is only _ which I guess causes this error. Another thing I noticed is that ok http client is also available on Github which I guess would be preferable. So, can we expect a newer release incorporating these changes soon?
👌 1
@e5l I am sorry, I just realized it was OpenJdk. My bad.