How to configure wily with spring boot application - spring-boot

I have created an application as spring boot application,Now i want to integrate this application with wily,where i ll passed wily parameter in application to configure application.

The fact that it's a Spring Boot application shouldn't make any difference. If you're using an executable jar file, you'll need to configure the agent when you launch the jar, for example:
java -jar my-app.jar -javaagent:<Agent_Home>/Agent.jar -Dcom.wily.introscope.agentProfile=<Path_To_Agent_Profile>
If you're deploying your Spring Boot application as a war file to a servlet container or application server, you'll need to be make the equivalent configuration changes. The documentation describes how to configure Tomcat.

Related

Can Spring boot based application's embedded jetty/tomcat also run external war file

We are trying to evaluate following scenario (to support couple of legacy apps and new apps).
Team has developed application based on spring boot and working OK (using embedded Jetty ie. typical spring boot JAR)
We have couple of legacy small applications (Spring MVC/Apache Camel based) which were packaged as WAR .
WARs can not be placed into " src/main/resources" (application is already packaged)
We know that in spring boot we can specify external lib directory from where JARs are scanned and initialised.
Is there any way where we can provide WAR file to this spring boot application as runtime argument and it gets exploded-initialised-served (along side of spring boot app)
(This is not duplicate of How to run external war file with embedded tomcat of spring boot with gradle? .. We are having different scenario)

Deploy spring boot applications

I know spring boot applications can be deployed to production environments as war files. But what is the typical way of deploying spring boot applications? Does it only require a jvm, not a container?
The Spring Boot Project Page states that Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
Means by default, the Spring Boot maven or gradle plugin builds self-contained executable jars, that contain all dependencies and an embedded webserver, e.g. tomcat or jetty. The Spring Boot Getting Started doc gives you an introduction to that. Using this approach you just need a JVM to run your application. But you can also configure it to create war files if this is a better fit to your production environment.
Does it only require a jvm, not a container?
It can run anywhere Java is setup.
Spring Boot's use of embedded containers and why Spring chose to go the container-less route. Many of their main driving forces were ease of use while testing and debugging, and being able to deploy Spring-based Java applications to the cloud, or any other environment.
Rest can be found out in attached image.
Spring boot applications if they are serving web requests do require a container. You can either deploy them as a war inside a container such as tomcat/jetty. Or you can deploy them with embedded container, tomcat.

Web Application Manager for Spring Boot MVC jar - display all jars

I am quite new to Spring boot and I have just created a small spring boot mvc web application as a jar.
Is there some kind of Web Application Manager like with Tomcat, where one can stop or undeploy/delete?
Or do I have to manually upload the jar to my server and manually type in the console java -jar myFile.jar?
How do I stop/restart my jar web application?
How do I display/list all my active running jar web applications?
Any help is appreciated!
Is there some kind of Web Application Manager like with Tomcat, where one can stop or undeploy/delete?
Nope. There isn't and you actually don't need one. As mentioned in comment by Shankar do read this question.
Or do I have to manually upload the jar to my server and manually type in the console java -jar myFile.jar?
You don't upload you myFile.jar application to tomcat, spring-boot has embedded Tomcat server. When you run java -jar myFile.jar sringboot apliication starts this embedded tomcat server and runs your application in it.
How do I stop/restart my jar web application?
You can simply kill the java -jar myFile.jar process by pressing Ctlr + C.
How do I display/list all my active running jar web applications?
Each Springboot application has its own embedded tomcat server, so this is N/A.
Now if you want to deploy your spring boot application in standalone Tomcat server where you can see the GUI, app manager, start/stop etc. create a WAR file instead of JAR.
Read this Guide on converting jar-to-war.
In short, creating a WAR file answers all your questions.

Tomcats RemoteIPValve not invoked in Spring Boot Application deployed as a WAR file

My Spring Boot 1.3.2 Application is deployed as a WAR file into a standalone tomcat7. I am trying to activate the RemoteIPValve using server.use-forward-headers=true as described in the spring boot docs.
But the RemoteIPValve is not properly configured nor invoked when handling the request. Log says:
NonEmbeddedServletContainerFactory detected.
When I start the application using the maven plugin I get a:
Initializing Spring embedded WebApplicationContext
... and RemoteIPValve is working as expected. How can I accomplish the same using WAR File deployment?
When you deploy a Spring Boot application to standalone Tomcat, none of the embedded server configuration takes effect. Instead, you need to update your Tomcat installation's configuration to enable the valve. To use the valve in its default configuration, add the following to server.xml:
<Valve className="org.apache.catalina.valves.RemoteIpValve"/>

Logback Appender for Webpage in Spring Boot application

I have a maven and spring boot application which use logback.
This application is on some servers and the log files on this servers are stored only on this server.
Give it a tool/api which is free, can visualize the logs into a webpage and is easy to integrat with spring boot and maven?
I have try JAMon but it will not work with Spring boot (need to deploy a war file) because the spring boot application is a embedded application. Thanks for Help :)
Have a look on Kibana, search for ELK-Stack. You can easily run it using Docker. There is also a Maven lib for the logstash-forwarder.

Resources