• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Uncaught SyntaxError: Unexpected end of JSON input

 
Ranch Hand
Posts: 364
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if this is the right place to post this, but only forum related to javascript I can find.  


I am getting the error in the subject line, and I cannot figure out why.  This is the function.




There is nothing wrong with the JSON data.  Nothing missing such as a }.  The get request came from a Spring Boot project via Hibernate.  The data is in a MySQL database.  I cannot figure out through tons of google searches why it's doing this and how to fix it.  
 
Marshal
Posts: 25420
65
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nathan Milota wrote:There is nothing wrong with the JSON data.  Nothing missing such as a }.



Just to clarify, though: Did you determine that by looking at the JSON data on the server it's being read from, or did you look at what was actually received on the client?
 
Paul Clapham
Marshal
Posts: 25420
65
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha. I see from your newer post that you have already considered this possibility. I will mark this thread as resolved, then.
 
Nathan Milota
Ranch Hand
Posts: 364
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Nathan Milota wrote:There is nothing wrong with the JSON data.  Nothing missing such as a }.



Just to clarify, though: Did you determine that by looking at the JSON data on the server it's being read from, or did you look at what was actually received on the client?



So, the this.responseText is reading the database correctly.   However, that is in a nested function.  The var data is blank, or an empty string, and it is not reading anything from it to parse, so that's why the error is there.

I'm trying to find out how to get the information from my database to the var data to be able to parse and use it, but it keeps coming back empty.
 
Nathan Milota
Ranch Hand
Posts: 364
2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Aha. I see from your newer post that you have already considered this possibility. I will mark this thread as resolved, then.



It's resolved in the sense that I know why I'm getting the error now, but I made a newer post to find out why it's an empty string causing that error.
 
Message for you sir! I think it is a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic