Spring Boot System.GetProperty read value from weblogic arguments - spring-boot

Hi I have a spring application and I have a system.getproperty("xxx"); command.My app work in adminserver in weblogic and I added my property via admin console ( server-->configuration-->argument like -Dxxx=yyy
Also I restart my server and still I cant see my xxx property value?
Is there any missing point?

Related

default http threadpool size in embedded tomcat server spring boot

I have a spring boot application which is running on embedded tomcat server. I want to know the default tomcat http threadpool size and how to check them.
After checking on various portal i got to know that we can add 'server.tomcat.max-threads' in the applications.properties file and control it.
But i want to understand what is the default size and how to find it.
You can find the default value for each property here for the latest Spring Boot version. In this case the property is server.tomcat.threads.max and the default value is Tomcat's default, which is 200.

SpringBoot Rest API: Works as Java Application, fails when deployed on tomcat

I have a Springboot project and it has a api which I can invoke from postman.
When I run the application using Main Class I'm able to hit the endpoint and get response.
But if I deploy it on tomcat using war of project the same endpoint says 404!
What am I missing?
There can be multiple possibilities
You didn't extended your application class to SpringBootServletInitializer. In this case, spring boot application will not be deployed to tomcat. To fix this add "extends SpringBootServletInitializer" to your main application class
You are hitting wrong url. Make sure you append your aplication name to url. Example - if http://localhost:8080/data works in your local, and your application name is app, you have to hit http://{{serverip:port}}/app/data when deployed
There is something wrong in application properties like DB configured is local and not accessible from tomcat etc. To check such issues, check your tomcat log file (/{{tomcat dir}}/logs/catalina.out

Shutdown Spring Boot application running on random port

I have a Spring Boot services and I manage deployment on the server using a batch script. So, when ever I have to deploy a update I shutdown current running service using Spring Boot's shutdown hook. For example:
curl -X POST http://%HOST_NAME%:%PORT%/actuator/shutdown
Here I am giving %PORT% number of the service, Which is same as I have given in application.yml. I don't want hardcode the port neither in application.yml nor want to pass from the command line while starting the Spring Boot application. Actually I do not want to mention the port. I just want Spring Boot use any of the random port available on the server. If I will do the same then how can I shut down the service because I don't know the port where the service is running.

How does Spring Boot get the local server properties?

I am using the Spring Boot to develop a application. When startup a spring boot application, I got a log message like
com.xerox.eppic.report.Application : Starting Application on {{server name}} with PID {{PID}}
I want to know, how does Spring Boot get my server information? I need this information to develop some other features.
I have added the line number to log message, the line number for my main class is not correct. I have read some source code of Spring Boot, I didn't find where Spring Boot read the server info.
The class responsible of this is StartupInfoLogger. Check the code for more details.
In short the server name is retrieved by the INetAddress class and the PID system property is set by ApplicationPid

Using Spring Console Extension in WebLogic 10.3.4.0 with Spring 3.0.3

I've a Spring 3.0.3-based EAR+WAR which I'm deploying to WebLogic 10.3.4.0. I want to be able to see my the various framework Spring Beans at runtime via JMX and ideally in the WebLogic console. (Note, these are NOT bean's we've written but the ones which come by default with Spring.)
Ideally we'd have been able to get it working with the WebLogic Spring Console Extension as described here. However after following all these steps (plus adding the weblogic-spring.jar to our WAR after we saw ClassNotFoundException errors in our WebLogic log when trying to navigate to the Spring tab in the WL Admin UI) we still see the following message in the WL console "This application does not use the Spring Framework or Spring MBean integration is not enabled." and no errors or messages in the log.
Does anyone know if it is possible to get Spring 3 apps working with the WebLogic 10.3.4.0 Spring Console Extension or should I try another route?
Weblogic family 10.3.X supports only Spring Framework 2.5.X

Resources