Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6757611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:40:25+00:00 2026-05-26T13:40:25+00:00

Here is the code I tried: if(rs.next()){ Gson gson = new Gson(); STRUCT st

  • 0

Here is the code I tried:

 if(rs.next()){
    Gson gson = new Gson();
    STRUCT st =  (STRUCT) rs.getObject(1);
    JGeometry j_geom = JGeometry.load(st);
    System.out.println(" gson.toJson(j_geom)  "+gson.toJson(j_geom));
 }

But I am getting this error:

java.lang.IllegalArgumentException: NaN is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialDoubleValues() method.

Cannot find a way to sort it out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:40:26+00:00Added an answer on May 26, 2026 at 1:40 pm

    Did you try using GsonBuilder.serializeSpecialFloatingPointValues()? The exception mentions serializeSpecialDoubleValues(), which does not seem to exist.

    That JavaDoc states:

    Section 2.4 of JSON specification disallows special double values (NaN, Infinity, -Infinity). However, Javascript specification (see section 4.3.20, 4.3.22, 4.3.23) allows these values as valid Javascript values. Moreover, most JavaScript engines will accept these special values in JSON without problem. So, at a practical level, it makes sense to accept these values as valid JSON even though JSON specification disallows them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to compile Ercia Sadun's sample code here , but this error came
I am sorry about the amount of code here. I have tried to show
I can't get my dojo working. I've tried everything. Here is the code: <!DOCTYPE
Here is my code that i tried to get two consecutive elements of Iterator.
I have tried to implement doubly linked list in C++. Here is the code,
I'm new to jQuery. I'm trying to use this code: var ThisTableWrapper = $('#switch1').parent().next();
I need help some help printing out some xml. Here is my code (which
Here my code snippet: query.next(); qDebug()<<query.lastError(); qlonglong res=query.value(0).toLongLong(); qDebug()<<query.lastError(); and the corresponding log I
I tried to open mutiple frames by mutiple threads. Here is my code. '''
Ok the error is showing up somewhere in this here code if($error==false) { $query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.