Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Greg Abel

Greenhorn
+ Follow
since Jan 28, 2014
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Greg Abel

I have a spring boot rest API set up that accepts JSON data and does some database operations with the values.  I am running into an issue where every so often, the web service produces the following error:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Like I said, it does not happen all of the time.  I can get it to happen via postman when I send a successful request and then wait a couple of minutes and try to send another request, it throws the error.  But when i send another immediate request after the error, it works fine.  Is this a database settings issue?  I've tried a lot of different tomcat settings like the following in my yaml file:

datasource:
   tomcat:
     initial-size: 15
     max-active: 200
     max-idle: 30
     max-wait: 20000
     min-idle: 89
     testWhileIdle: true
     timeBetweenEvictionRunsMillis: 60000
     validation-query: SELECT 1
     validation-interval: 34000
     test-on-borrow: true
     remove-abandoned: true
     remove-abandoned-timeout: 55
     default-auto-commit: true

Thank you in advance for the help.
2 months ago
Thank you for the help
3 months ago
I created a restful endpoint with spring boot similar to the code below.  It does a mapping to my java object MyObect and it it works fine.  I was wondering if there is a way to get the JSON that was actually received by the controller?  If I wanted to the raw JSON and just print it or save it to a JSON field, is that possible?  Thanks in advance for the help.  

3 months ago
I have a rest API set up that accepts a JSON request and maps it to a POJO.  My question is, what is the best practice or how do I validate that the JSON that is being sent contains valid data before continuing on and processing further logic?  If it's invalid, I want to send a message back to the user to indicate that the request was bad.  Do I have to iterate through every possible field and check them?  For example, let's say I'm expecting a value for a field that will end up being a main data element for my java object, how can I verify it is there?  Thanks in advance for the help.
3 months ago
I have to go with the structure that is already present.
4 years ago
I have a swing application that uses an application server for its business logic. The tomcat server is located in EST time zone and the swing client is used in many time zones. The issue that is occurring is that on the client, dates are created and then sent to the application server to be compared with dates that are created on the application server. The issue is the time zones are not the same and dates are being changed. For example, on the client, the user would enter a date string of 4/29/15 but when a date object is created and compared on the server, it is getting changed to 4/28/15. I was wondering what the correct way would be to address this issue? Would I set the timezone to EST when the client creates a date object? I am using the SimpleDateFormat and formatting the date to MM/dd/yyyy from the client and the formatted date is sent to the server. Any help would be great.

Thanks in advance.
4 years ago
Could this be related to a bandwidth issue? I have 3 load balanced Tomcats and the CPU stays relatively low as does the memory. Should I keep an eye on the upload speeds?
4 years ago
I have a java swing application that uses a servlet to connect to Tomcat which in turn holds all of my business logic. I need to send data in the request from the user input and the way that I am doing this is converting my java object into XML via XStream and then into a string which includes it as a parameter in a PostMethod. From within Tomcat, the String is then converted back to XML which then grabs the object from it and begins processing. There are times when the application gets slow (possible from a load of users) and I can't determine the cause. In my business logic, I set some code that times each piece and it doesn't seem as if it takes too long. I am wondering if the problem lies within the request getting to the server? Is there not enough of bandwidth that can handle these requests? What is the best way to diagnose this? Any help would be great and please let me know if any more information is needed.
4 years ago
Xstream is supposed to be thread safe though.
Is it possible that my double value has a ton of extra decimal digits? If that's the case, do I just prevent that to go to only 2 decimal places?
5 years ago
I just have double values that don't get larger than 100,000.00. It seems that xstream is manipulating this for some reason and converting to scientific notation.
5 years ago
Should i change my field type?
5 years ago
I have an object that I convert to XML using XStream. Occasionally I am encountering errors (not all the time) on fields that are both of type Integer and double. I get the java error java.lang.NumberFormatException: For input string: ".12625E312625" because XStream seems to be converting this number to scientific notation. I cannot figure out how this is occurring and how I should correct it. I could see if the double numbers were very large but my numbers never exceed 100,000.00 and I don't understand why it would be doing it on the Integer field. Any help would be greatly appreciated.

Thanks.
5 years ago
I have an object that I convert to XML using XStream. Occasionally I am encountering errors (not all the time) on fields that are both of type Integer and double. I get the java error java.lang.NumberFormatException: For input string: ".12625E312625" because XStream seems to be converting this number to scientific notation. I cannot figure out how this is occurring and how I should correct it. I could see if the double numbers were very large but my numbers never exceed 100,000.00 and I don't understand why it would be doing it on the Integer field. Any help would be greatly appreciated.

Thanks.
I have an application that is a java swing client and sends data via a servlet which resides on a tomcat server. All business logic resides on tomcat and utilizes many queries that connects to a MySQL database server. The problem is that this application is run in multiple offices across the country. The thing that is noticed is that in some offices don't have any issue with the speed of the application where as some offices experience extreme slowness. Although, some offices with no speed issues occasionally experience slow downs. The users with the slowest speed have some of the fewest concurrent users also. I was wondering what a good way would be to diagnose this? Could this be a bandwidth issue among different offices? I am at a loss as to how to debug this issue. Any help would be greatly appreciated. Thanks.
5 years ago