vert-x / mod-mysql-postgresql

Vert.x 2.x is deprecated - use instead
http://vertx.io/docs/vertx-mysql-postgresql-client/java/
Apache License 2.0
49 stars 17 forks source link

java.lang.ClassCastException: scala.math.BigDecimal cannot be cast to java.math.BigDecimal #54

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi, I get cast error when I tried this code: BigDecimal test = row.get(0); (mysql field type is "decimal")

error: java.lang.ClassCastException: scala.math.BigDecimal cannot be cast to java.math.BigDecimal

I am using: io.vertx~lang-scala_2.11~1.1.0-M1 io.vertx~mod-mysql-postgresql_2.11~0.3.1

Narigo commented 9 years ago

Can you try it with io.vertx~lang-scala_2.10~1.1.0-M1? Might be the same issue as https://github.com/vert-x/mod-mysql-postgresql/issues/53#issuecomment-60590471

Narigo commented 9 years ago

Actually, I'm not sure how it transports decimals anyway. I'll need to have a look, but as it's just JSON, it shouldn't actually have any BigDecimal classes in there at all?

Could you provide a small test maybe?

ghost commented 9 years ago

Yes there is. I will try with the other version later today thanks

On Wednesday, October 29, 2014, Joern Bernhardt notifications@github.com wrote:

Actually, I'm not sure how it transports decimals anyway. I'll need to have a look, but as it's just JSON, it shouldn't actually have any BigDecimal classes in there at all?

— Reply to this email directly or view it on GitHub https://github.com/vert-x/mod-mysql-postgresql/issues/54#issuecomment-60887616 .

ghost commented 9 years ago

Hi, I found another way to solve this by adding scala library to my project, and converting the type myself from scala type to java type, and it worked!