• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Springboot rest api returns HTML i expected json , no errors is thrown.

 
Ranch Hand
Posts: 366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I call this rest api , i get HTML back, no errors , nothing is thrown, its going thru all my code and logs this line.
logger.info("Exporting all customer to SOLR berefore return response: ." + exportAddCustomers) ;
Just before returning the response.
Its newer catch an exception so this is newer logged:
logger.info("Exporting all customer to SOLR Exception: ." +  e.getMessage() + " " + e.getCause()) ;

But what I get back from swagger is plain html.
What can actual be wrong here, I have googled for 3 Hours and can not find any explanation , can you ?  I will give you a beer ;-)



Response from swagger:



Kind regards Frank

 
Sheriff
Posts: 22210
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you communicating directly with the Spring Boot application, or is there a service in front of it (like Apache, Nginx, IIS)?

Because the error is a 500 error which states that the service is unavailable:

That's not the default error you get from Spring Boot.

If there is no service in front of the Spring Boot application, check your logs. You're then probably getting an exception.
 
Frank Jacobsen
Ranch Hand
Posts: 366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No there is nothing between the request and the server , and i runs thru all the code , without an exception in the log .
I get.the error after exactly 30 seconds



 
Marshal
Posts: 3568
505
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even though you see Exporting all customer to SOLR berefore return response ... in the log, it doesn't mean that the client was still connected when that occurred.

How long does it take to execute exportAllDeleteData() and exportAddAllData()?  Could it be that the client side is only willing to wait up to 30 seconds for a response and bailed before your processing has had a chance to complete?
 
Bartender
Posts: 2085
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Frank,
one thing you can try is to put this property in your application.properties under the resources folder of your project:

Then,you can see what information is printed out on the console when you run the code.
It is better to see if there is any exception thrown from the output console.
 
Frank Jacobsen
Ranch Hand
Posts: 366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ron McLeod wrote:Even though you see Exporting all customer to SOLR berefore return response ... in the log, it doesn't mean that the client was still connected when that occurred.

How long does it take to execute exportAllDeleteData() and exportAddAllData()?  Could it be that the client side is only willing to wait up to 30 seconds for a response and bailed before your processing has had a chance to complete?



Yehh maybe is returning HTML , becouse the client timeouts, while the server still is running the code, i will create some loginfo in the morning, to see if it takes over 30 seconds.
 
Frank Jacobsen
Ranch Hand
Posts: 366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:Hi, Frank,
one thing you can try is to put this property in your application.properties under the resources folder of your project:

Then,you can see what information is printed out on the console when you run the code.
It is better to see if there is any exception thrown from the output console.



I allready have log info on the test server. :-)
 
Frank Jacobsen
Ranch Hand
Posts: 366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ron McLeod wrote:Even though you see Exporting all customer to SOLR berefore return response ... in the log, it doesn't mean that the client was still connected when that occurred.

How long does it take to execute exportAllDeleteData() and exportAddAllData()?  Could it be that the client side is only willing to wait up to 30 seconds for a response and bailed before your processing has had a chance to complete?



The program runs for 45 seconds,  you are absolutely right, that was the problem, I owe you a beer, thank you very much for giving yourself time to answer, you are my hero :-)
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic