• Post Reply Bookmark Topic Watch Topic
  • New Topic

CNH-Java 1.6.0_24 is not Supported Please help me  RSS feed

 
rajkumar Indirani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bloggers,

Please resolve my issues in production environment.

We are having currency Name as "CNH"
Here we are passing the currency values to third party application but there they are supporting "CNH".In Java 1.6.0_24 that is not supported and getting an java.lang.IllegalArgumentException.
Please suggest on my approach.

I want to catch that exception for "CNH" currency and re-send to the 3rd party api without getting exception in Java side.


Please advise on this.
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Currency only uses the ISO 4217 codes, so China has CNY.
RMB and CNH aren't considered valid (as you've seen).

How are you passing these to the third party?
Can you just create your own? That is, would a simple text currency do?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the API documentation of java.util.Currency says, it supports the standard ISO 4217 currency codes. <- On that website you can download a list of all the standard currency codes.

"CNH" is not an ISO 4217 currency code, it's not in the list. So, what currency is "CNH"? I would ask the people who came to you with this issue what "CNH" is and point out to them that this is not a standard currency code. Maybe the bug is not in your software, but somewhere else, in somebody else's system that is sending invalid currency codes to your system.
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I have added code tags to your post instead of the blue text and improved the indentation slightly. Always use the code tags: doesn't it look better
 
Dave Tolls
Ranch Foreman
Posts: 3056
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:As the API documentation of java.util.Currency says, it supports the standard ISO 4217 currency codes. <- On that website you can download a list of all the standard currency codes.

"CNH" is not an ISO 4217 currency code, it's not in the list. So, what currency is "CNH"? I would ask the people who came to you with this issue what "CNH" is and point out to them that this is not a standard currency code. Maybe the bug is not in your software, but somewhere else, in somebody else's system that is sending invalid currency codes to your system.


China has CNY (the official code) and RMB for internal Renminbi with CNH for "external" (I think just Hong Kong?). But those aren't part of 4217.
 
rajkumar Indirani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your valuable suggestion..
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!