Strange exception happening only after some hours of production - java

This exception appears only after some hours that my spring boot app runs as backend, if i restart it disappears. Any hint?
2018-Mar-06 16:13:09.388 DEBUG [http-nio-8081-exec-3] o.s.w.s.DispatcherServlet - Could not complete request
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/data/repository/query/ResultProcessor$ChainingConverter

Related

MultipartException and IOFileUploadException when requests receives MultipartFile

I'm developing a spring API and I have an endpoint that receives a MultipartFile as parameter but in the production environment I'm receiving the following error in some cases:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.impl.IOFileUploadException: Processing of multipart/form-data request failed. java.io.EOFException
I'm using spring-boot-starter-tomcat:2.4.7 that uses tomcat:9.0.46
I'm having some difficulty to debug this error because it throws before the code starts so it never reaches the logs that I put.
Thank you.
Regards.
If this does not happen all the time and only sometimes, its probably because the upload got interrupted ( browser got closed for example ). Therefore, there is nothing for you to change in the code.
You can get more details if you enable Spring MVC debug logging
application.properties
logging.level.org.springframework.web: DEBUG
Here's additional info about how you can efficiently log these kinds of errors.

Constraints exception handling on weblogic by java hipster

A project generated by Jhipster and deployed on weblogic server. Everythings works fine on weblogic server except constranits exceptions handling.
On tomcat when happen constraints exception is returned status error code 409 correctly but on weblogic return status error code 500, as below, so we cant detect what error has happened
with cause = 'weblogic.transaction.RollbackException: setRollbackOnly called on transaction' and exception = 'JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is weblogic.transaction.RollbackException: setRollbackOnly called on transaction'

How to deal with "feign.FeignException: [301 Moved Permanently] during [GET]"?

i'm trying to do a request with FeignClient in my Spring-Boot app to https://pixabay.com/api?key=17079440-d2facf535011df5d60e5ccfe2&q=Playstation%203&image_type=photo but but this exception has been throw:
2020-06-17 21:10:24.730 ERROR 14008 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException: [301 Moved Permanently] during [GET] to [https://pixabay.com/api?key=17079440-d2facf535011df5d60e5ccfe2&q=Playstation%203&image_type=photo] [PixabayClient#getImageUrl(String,String,String)]
https://pastebin.com/yeNbcP5k
I already tried to make a request through the postman and the browser, and the response was returned normally :(
Here is my FeignClient class: https://pastebin.com/MFhFs5um
And there is my pom.xml: https://pastebin.com/4XXjYkyE
Probably this is something your application can resolve.
What your browser does is to automatically follow the redirect and execute another request to the URL given in the redirection response.
Now you could catch the exception, take the URL and run another request just like the browser does.
This often happens when you confuse HTTP and HTTPS in your request.

Getting I/O exception (java.net.SocketException) caught when processing request

I have been using optimizely 'core-api', version:'3.3.0' and 'core-httpclient-impl', version:'3.3.0'
for my java app. I frequently see this exception in my info log
"I/O exception (java.net.SocketException) caught when processing request to {s}->https://cdn.optimizely.com: Connection reset".
This is logged part of optimizely SDK. I'm not able to find why this shows up as the http calls from the sdk are succeeding. If someone can give me some leads that will be great help. Thanks.
It means that the other side or a network component in the line dropped the connection unexpectedly.

HTTP Status 500 - Request processing failed in shopizer

After following the instruction of buildin Shopizer from this link
https://github.com/shopizer-ecommerce/shopizer
and after building and moving sm-shop.war to Tomcat webapps folder and then accessing the url:
http://localhost:8080/sm-shop/shop
I'm facing this error
HTTP Status 500 - Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
So, what is the problem, can anybody help ?
It expects this DB configuration.
You have two options:
Configure your own local DB and fill it with your connection and authentication details (config is using MySQL).
Uncomment H2 database config and comment out MySQL config. H2 is embedded database and therefore you wouldn't need to install anything.

Categories