Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
867 views
in Technique[技术] by (71.8m points)

scala - java.lang.NumberFormatException: For input string: "" (Error when running `sbt test`)

On my local Mac OS (Mountain Lion), I have been running sbt test just fine and the tests compiled/passed with Play 2.3.x, Scala (2.10.x). Java version on my local was "1.8.0_131".

After re-imaging my Mac OS X(10.12.3), I started getting the very strange error when running "sbt test" for the same codebase (Play, Scala, Java versions still the same).

Probably, this might not be to do with my Mac upgrade but that is the only variable (change) I could think of right now.

I would really appreciate if someone could give me a quick pointer on probable causes of this?

Error stack trace looks something like

[error]    NumberFormatException: : For input string: ""  (ProxyUtils.java:159)
[error] com.ning.http.util.ProxyUtils.createProxyServerSelector(ProxyUtils.java:159)
[error] com.ning.http.client.AsyncHttpClientConfig$Builder.build(AsyncHttpClientConfig.java:1132)
[error] play.api.libs.ws.ning.NingAsyncHttpClientConfigBuilder.build(NingAsyncHttpClientConfigBuilder.scala:37)
[error] play.api.libs.ws.ning.NingWSAPI.buildAsyncClientConfig(NingWS.scala:563)
[error] play.api.libs.ws.ning.NingWSAPI.newClient(NingWS.scala:520)
[error] play.api.libs.ws.ning.NingWSAPI$$anonfun$client$1.apply(NingWS.scala:543)
[error] play.api.libs.ws.ning.NingWSAPI$$anonfun$client$1.apply(NingWS.scala:540)
[error] play.api.libs.ws.ning.NingWSAPI.client(NingWS.scala:538)
[error] play.api.libs.ws.ning.NingWSAPI.url(NingWS.scala:553)
[error] play.api.libs.ws.WS$.url(WS.scala:129)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I would really appreciate if someone could give me a quick pointer on the cause of this?

You just need to look at the stack trace. It can give you a 'pointer' of the cause.

For instance, here, the cause is indicated in the message of the exception, which is :

For input string: ""

Which indicates that a line of code tried to parse a string containing nothing, and threw an exception to indicate a failed conversion from string to a number

The probable cause of this is some data that the application retrived somewhere, and was changed after the re-imaging of the computer. Generally, a way to correct that might be to re-install the app


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...