Open Ajz316 opened 3 years ago
Hi, I have few questions like
dropins/spring
or just directly to the dropins
folder or as an application tag in serverl.xml using webApplication
or springApplication
.Thanks!
I am deploying the WAR Using
On Tue, 26 Jan 2021, 07:27 ANJUM FATIMA, notifications@github.com wrote:
Hi, I have few questions like
- I know that you are deploying the application as a WAR, I want to know where the application is deployed? To dropins/spring or just directly to the dropins folder or as an application tag in serverl.xml using webApplication or springApplication.
- I deployed a simple application war but wasn't successful in reproducing the error. Could you please point me to a sample application which gives this error?
Thanks!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenLiberty/open-liberty/issues/15647#issuecomment-767091861, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2W364H5VLFRM7V5II7R5LS3XH2PANCNFSM4WQ7CZXA .
You won't need to set<springBootApplication>
in you server.xml if you are placing your application in dropins. This is how you can deploy the application
Deploy an application with either the server.xml application configuration or with the dropins folder as shown in the following options.
Define the application with a springBootApplication element or an application element.
<springBootApplication location="hellospringboot.jar"/>
. or
<application type="spring" location="hellospringboot.jar"/>
If you choose not to update the server.xml file, use Liberty dropins support instead.
[ ] Copy the hellospringboot.jar file to the /usr/servers/helloserver/dropins/spring/hellospringboot.jar directory.
[ ] The spring subdirectory within the dropins subdirectory keeps the existing .jar or .war extension.
[ ] Use the .spring extension when you copy the application directly to the dropins subdirectory.
You can find more information on https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_dep_springboot.html
Hi Anjum While I appreciate the inputs you have provided for deployments, my problem is coming at runtime. The deployment looks fine to me. Is this something you could help me with?
On Wed, 27 Jan 2021, 03:10 ANJUM FATIMA, notifications@github.com wrote:
You won't need to set
in you server.xml if you are placing your application in dropins. This is how you can deploy the application Deploy an application with either the server.xml application configuration or with the dropins folder as shown in the following options.
-
Define the application with a springBootApplication element or an application element.
. or -
If you choose not to update the server.xml file, use Liberty dropins support instead.
Copy the hellospringboot.jar file to the /usr/servers/helloserver/dropins/spring/hellospringboot.jar directory.
The spring subdirectory within the dropins subdirectory keeps the existing .jar or .war extension.
Use the .spring extension when you copy the application directly to the dropins subdirectory.
You can find more information on [( https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_dep_springboot.html )]
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenLiberty/open-liberty/issues/15647#issuecomment-767649996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2W363TMXRZ2UJT2E2AIJ3S33SORANCNFSM4WQ7CZXA .
I am trying to understand how you are deploying exactly. I need to know the exact folder where you deployed your application and the server.xml config. Also, it would be very helpful if could put up a sample application on github which gives this error, because i wasn't able to reproduce the error. I want to know, what is that in your application which is causing this error to appear.
Ok the application is a bit sensitive. How about I try to use the app you are using locally and see if i xan reproduce steps? Will that be easier as we both will be working on common code base? By the way, just so we are clear, when you say you can't reproduce the error- you have deployed the app and you are accessing a controller's endpoint through postman or something and you are not getting any error is logs?
On Wed, 27 Jan 2021, 07:59 ANJUM FATIMA, notifications@github.com wrote:
I am trying to understand how you are deploying exactly. I need to know the exact folder where you deployed your application and the server.xml config. Also, it would be very helpful if could put up a sample application on github which gives this error, because i wasn't able to reproduce the error. I want to know, what is that in your application which is causing this error to appear.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenLiberty/open-liberty/issues/15647#issuecomment-767823747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2W36ZGM36B5FU5RGRNFH3S34UKDANCNFSM4WQ7CZXA .
ok, let me work on the sample application. I will let you know the link as soon as possible.
Thanks but you did not answer the second part of my question. Are you trying to access the end point and you do not see any error log?
On Wed, 27 Jan 2021, 08:25 ANJUM FATIMA, notifications@github.com wrote:
ok, let me work on the sample application. I will let you know the link as soon as possible.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenLiberty/open-liberty/issues/15647#issuecomment-767837426, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2W36ZQAXO7VJRCKQBRGJ3S34XK5ANCNFSM4WQ7CZXA .
Yes, I do not see the error when I try to access the end point from browser and the POSTMAN.
Hi Anjum Found this one out https://github.com/openliberty/open-liberty/issues/14875
Seems like it could be an issue with Spring. But is it possible for you to find the version it is fixed in? I have commented on that issue too to check with author if he can provide some inputs.
Thanks Ajit
On Wed, 27 Jan 2021, 08:37 ANJUM FATIMA, notifications@github.com wrote:
Yes, I do not see the error when I try to access the end point from browser and also from POSTMAN.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenLiberty/open-liberty/issues/15647#issuecomment-767843612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK2W362AEXEWEJQGFQ56JQDS34YYBANCNFSM4WQ7CZXA .
The issue has been tagged 5.2.11 milestone. May be you could try the next version of spring boot which would be 2.3.6.RELEASE or later.
Yes, it seems it is a Spring issue. I could not try 5.2.11, but tried 5.2.12 and that seems to work fine. No errors in log. Now, that is an option for sure. But I wonder if there is a flag or something in Openliberty that I can use to disable this error message? That would be easier for my team, given that there is a lot of interdependencies of different modules we have.
I am not aware of any such flag. Although, could you try this workaround?
In the mean time as a workaround you could disable the JsonGenerator.Feature.AUTO_CLOSE_TARGET on the ObjectMapper.
For example in Spring Boot:
@Bean
public Jackson2ObjectMapperBuilderCustomizer om() {
return builder -> builder.featuresToDisable(JsonGenerator.Feature.AUTO_CLOSE_TARGET);
}
This was mentioned in https://github.com/spring-projects/spring-framework/issues/25987#issuecomment-719731353.
The issue was linked as backport in https://github.com/spring-projects/spring-framework/issues/25989
I have deployed two Spring Boot Apps and a few RESTful services in them. Irrespective of a GET or POST I am consistently getting this error in log. When run as FAT JAR (embedded Tomcat), this issue does not occur.
Steps to Reproduce Write a Spring boot 2.3.5 application. Deploy it in Openliberty (20.0.0.10) as WAR file. Access an endpoint in a client like Postman. The output from the RESTful service is 200 OK and the response is obtained correctly, but in the logs we see the above stack trace for every single request.
I have tried using
<webContainer throwExceptionWhenUnableToCompleteOrDispatch="false" com.ibm.ws.webcontainer.invokeflushafterservice="false"></webContainer>
but the error still occurs.Expected behavior The logs should not be printing this ERROR.
Diagnostic information: