Spring Boot Application immediately shuts down after starting - spring

I am working currently on a project which includes the Spring Framework. Everything is working as aspect but there is one problem. When I try to start my application onto my laptop it immediately shuts down after startup. It is working on every other machine, so this problem occurs only on my laptop.
Maybe you got an idea what could force this problem ? I am working with IntelliJ and I haven´t found any solutions for this problem.
PC Specs
Laptop is a AsusN550JK( modified RAM and SSD)
Intel Core i7-4700HQ CPU#2.4 GHz
16 GB Ram
500 GB SSD Samsung EVO 840
1 TB HDD
64 Bit OS - Windows 10
ConsoleOutput
Exclusions:
-----------
None
Unconditional classes:
----------------------
org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
2017-04-22 21:24:15.756 INFO 6300 --- [ main] com.objectbay.test.me.Application : Started Application in 8.012 seconds (JVM running for 9.251)
2017-04-22 21:24:15.758 INFO 6300 --- [ Thread-3] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#6fb0d3ed: startup date [Sat Apr 22 21:24:08 CEST 2017]; root of context hierarchy
2017-04-22 21:24:15.763 INFO 6300 --- [ Thread-3] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2017-04-22 21:24:15.764 INFO 6300 --- [ Thread-3] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-04-22 21:24:15.765 INFO 6300 --- [ Thread-3] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export
2017-04-22 21:24:15.771 DEBUG 6300 --- [ Thread-3] org.hibernate.SQL : drop table person if exists
2017-04-22 21:24:15.782 INFO 6300 --- [ Thread-3] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete
Process finished with exit code 0
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-accessing-data-rest</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
Full example which is not working on my machine
Spring Guide Rest example
Console - LOG after Updating Dependencies
LOG after Updating Dependencies

Add this dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

For me what caused this was that I had this property below, in the application properties (carried over by mistake from a test application.properties file). See if any of your property files that are included have this like below, and remove it:
# disables the servlet-container initialization (for unit testing only)
spring.main.web-application-type=none

Problem is solved - thanks for your help crazycoder.
The issue was caused by an older version of tomcat. After upating the embedded tomcat of Spring to 1.5.3_RELEASE and updating mysql-jdbc-driver as well , it finally worked for me.
I adjusted the pom.xml like this:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>

I met the same problem, I fix by these steps as below:
update file application.yml
1- remove:
main:
web-application-type: none
2- if your change server port already, it's still error:
Identify and stop the process that's listening on port 8080 or
configure this application to listen on another port.
solution: move server port config on the top of yml file
Done! it's for my case.

Related

Spring Boot Application displays no error, but tomcat not initialized and application.properties is unused

I created a new project using Spring Initializr, and opened it with Intellij IDEA version 2020.3.2 ide. After maven installed all dependencies in the pom.xml file, I ran the main method in the DemoApplication class. I didn't add anything new or different than the default project created by the Spring Initializr.
Two Problems occured:
1- Console outputted only these 3 logs, and Tomcat wasn't initialized
2021-02-03 23:48:45.073 INFO 15872 --- [ main] com.example.DemoApplication: Starting DemoApplication using Java 1.8.0_281 on DESKTOP-M with PID 15872 (D:\demo\target\classes started by M in D:\demo)
2021-02-03 23:48:45.078 INFO 15872 --- [ main] com.example.DemoApplication : No active profile set,falling back to default profiles: default
2021-02-03 23:48:46.355 INFO 15872 --- [ main] com.example.DemoApplication: Started DemoApplication in 2.062 seconds (JVM running for 2.87)
Process finished with exit code 0
2- Anything I write in the application.properties file turns grey (unused)
I watched a lot of tutorials, and did exactly as they do. Their console output always has more than 3 statements and is even colored, which mine isn't
My pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
DemoApplication.java
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
Would appreciate it if you would help me figure out how to correctly run the project and have the server up and running.
Should I add anymore run Options?
External Libraries:
This issue is reproducible with a simple war initializer, when you run DemoApplication with a "standalone java" (IDE run) configuration.
The solution/correct usage is: To run (the project) in a "maven" spring-boot:run (IDE run) configuration.
Like:
It looks like you are using IntelliJ IDEA Community Edition which has no support for Spring Boot.
That is why the properties are not highlighted and the output is not colored.
IntelliJ IDEA Ultimate will use Spring Boot Run/Debug configuration type automatically:
As a workaround you can run your code via Maven spring-boot:run.
I saw the same behavior when I setup a project with pox.xml you provided.
The "Include dependencies with "Provided" fixed it for me. However I had to reload the Maven dependencies like this a few times: pom.xml (right click) -> Maven -> Reload Project.
I would still suggest that you remove <scope>provided</scope> in spring-boot-starter-tomcat.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!-- Comment this out -->
<!-- <scope>provided</scope> -->
</dependency>
Here is a good answer - Java Spring Boot - spring-boot-starter-tomcat dependency doesn't work with scope provided when running locally
If you still need this project to run in an external Tomcat container and thus want to mark the spring-boot-spring-boot-starter dependency as "provided", you can specify a separate profile for that configuration - https://stackoverflow.com/a/42302247

Spring Boot Application Not Starting and no exception

I am using spring boot version: 2.3.5.RELEASE, with only the main class which I am trying to start. When I run the main class, I get the below message and the application fails to start without any error.
2020-11-03 12:39:17.871 INFO 15426 --- [ main] com.rahul.poc.HealthcheckApplication : Starting HealthcheckApplication on INMLTCU6LVCG with PID 15426 (/Users/rahul/Documents/Rahul/Projects/healthcheck/target/classes started by rahul in /Users/rahul/Documents/Rahul/Projects/healthcheck)
2020-11-03 12:39:17.873 INFO 15426 --- [ main] com.rahul.poc.HealthcheckApplication : No active profile set, falling back to default profiles: default
2020-11-03 12:39:18.617 INFO 15426 --- [ main] com.rahul.poc.HealthcheckApplication : Started HealthcheckApplication in 1.353 seconds (JVM running for 1.806)
Process finished with exit code 0
The pom.xml looks like below:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.rahul.poc</groupId>
<artifactId>healthcheck</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Healthcheck</name>
<description>Healthcheck POC</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<!-- <scope>test</scope>-->
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
The main class as:
package com.rahul.poc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class HealthcheckApplication {
public static void main(String[] args) {
SpringApplication.run(HealthcheckApplication.class, args);
}
}
I don't have any other class or configuration.
I believe that your problem is that you haven't added a starter package reference that adds a server component to your app, or otherwise adds anything that stays alive and does anything. I think your app is running, and then exiting because it has not been configured to run anything on a continual basis.
The most common thing you're missing that would cause your app to stay running is the web starter. Add this as a Maven dependency, and you should get behavior more like what you expect:
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>

Spring Boot cannot start server

I am building a spring-boot service, but when I start run 'spring boot app' the server cannot start and I cannot access to localhost:8080. I research some topic but cannot find solution right now.
This is my pom file :
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
when I run the application the log file console :
2018-10-24 23:11:51.350 INFO 5492 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication on Welcomes-PC with PID 5492 (C:\Users\Welcomes\Documents\workspace-spring-tool-suite-4-4.0.0.RELEASE\demo\target\classes started by Welcomes in C:\Users\Welcomes\Documents\workspace-spring-tool-suite-4-4.0.0.RELEASE\demo)
2018-10-24 23:11:51.354 INFO 5492 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default
2018-10-24 23:11:51.401 INFO 5492 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext#40e6dfe1: startup date [Wed Oct 24 23:11:51 ICT 2018]; root of context hierarchy
2018-10-24 23:11:52.187 INFO 5492 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-10-24 23:11:52.201 INFO 5492 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 1.142 seconds (JVM running for 1.71)
2018-10-24 23:11:52.204 INFO 5492 --- [ Thread-3] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext#40e6dfe1: startup date [Wed Oct 24 23:11:51 ICT 2018]; root of context hierarchy
2018-10-24 23:11:52.207 INFO 5492 --- [ Thread-3] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
I cannot see the Tomcat initializatied with port(s) : 8080. Does I miss some steps? I'm using JDK jdk1.8.0_191

How connect to embedded activeMQ in spring boot using Hawtio?

I have spring boot application contains embedded activeMQ, i want to connect to web console using hawtio but not able to connect .
i do the following steps :
1-in cmd "java -jar hawtio-app-1.5.7.jar".
2- trying connect to Host : localhost port : 1099 Path : /api/jolokia
but not working return the following :
Failed to load resource: the server responded with a status of 500 (localhost:1099 failed to respond)
Pom.xml
<!-- Starter for building web, including RESTful, applications using Spring
MVC. Uses Tomcat as the default embedded container -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- the embedded container dependencies as “provided” -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!-- Logging libraries -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<!-- WebSocket libraries -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- reactor project libraries -->
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bus</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-net</artifactId>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.0.33.Final</version>
</dependency>
<!-- Email -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>sockjs-client</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>stomp-websocket</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.3.7</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-stomp</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.7.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
the below log startup :
`2018-02-13;00:31:26.976 [localhost-startStop-1] INFO
o.s.b.w.s.ServletRegistrationBean.onStartup(190) - Mapping servlet: 'dispatcherServlet' to [/]
2018-02-13;00:31:27.016 [localhost-startStop-1] INFO
o.s.b.w.s.FilterRegistrationBean.configure(258) - Mapping filter: 'characterEncodingFilter' to: [/*]
2018-02-13;00:31:27.019 [localhost-startStop-1] INFO
o.s.b.w.s.FilterRegistrationBean.configure(258) - Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-02-13;00:31:27.021 [localhost-startStop-1] INFO
o.s.b.w.s.FilterRegistrationBean.configure(258) - Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-02-13;00:31:27.022 [localhost-startStop-1] INFO
o.s.b.w.s.FilterRegistrationBean.configure(258) - Mapping filter: 'requestContextFilter' to: [/*]
2018-02-13;00:31:28.938 [main] INFO
o.s.s.c.ThreadPoolTaskExecutor.initialize(165) - Initializing ExecutorService 'clientInboundChannelExecutor'
2018-02-13;00:31:28.976 [main] INFO
o.s.s.c.ThreadPoolTaskExecutor.initialize(165) - Initializing ExecutorService 'clientOutboundChannelExecutor'
2018-02-13;00:31:29.434 [main] INFO
o.s.s.c.ThreadPoolTaskScheduler.initialize(165) - Initializing ExecutorService 'messageBrokerTaskScheduler'
2018-02-13;00:31:29.567 [main] INFO
o.s.w.s.s.s.WebSocketHandlerMapping.registerHandler(362) - Mapped URL path [/websocket/**] onto handler of type [class org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler]
2018-02-13;00:31:29.627 [main] INFO
o.s.s.c.ThreadPoolTaskExecutor.initialize(165) - Initializing ExecutorService 'brokerChannelExecutor'
2018-02-13;00:31:30.895 [main] WARN
o.a.activemq.broker.BrokerService.checkMemorySystemUsageLimits(2146) - Memory Usage for the Broker (1024mb) is more than the maximum available for the JVM: 512 mb - resetting to 70% of maximum available: 358 mb
2018-02-13;00:31:31.096 [main] INFO
o.a.activemq.broker.BrokerService.doStartPersistenceAdapter(671) - Using Persistence Adapter: KahaDBPersistenceAdapter[C:\Users\anash\git\Notfication\activemq-data\localhost\KahaDB]
2018-02-13;00:31:31.111 [JMX connector] INFO
o.a.a.broker.jmx.ManagementContext.run(155) - JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
2018-02-13;00:31:31.721 [main] INFO
o.a.a.store.kahadb.MessageDatabase.read(191) - KahaDB is version 6
2018-02-13;00:31:31.747 [main] INFO
o.a.a.store.kahadb.MessageDatabase.recover(678) - Recovering from the journal #1:1026194
2018-02-13;00:31:31.768 [main] INFO
o.a.a.store.kahadb.MessageDatabase.recover(706) - Recovery replayed 253 operations from the journal in 0.037 seconds.
2018-02-13;00:31:31.965 [main] INFO
o.a.a.s.kahadb.plist.PListStoreImpl.doStart(371) - PListStore:[C:\Users\anash\git\Notfication\activemq-data\localhost\tmp_storage] started
2018-02-13;00:31:32.136 [main] INFO
o.a.activemq.broker.BrokerService.doStartBroker(734) - Apache ActiveMQ 5.14.5 (localhost, ID:SPS-Anash-49217-1518474691990-0:1) is starting
2018-02-13;00:31:32.159 [main] INFO
o.a.a.t.TransportServerThreadSupport.doStart(69) - Listening for connections at: stomp://127.0.0.1:61613
2018-02-13;00:31:32.160 [main] INFO
o.a.a.broker.TransportConnector.start(263) - Connector stomp://127.0.0.1:61613 started
2018-02-13;00:31:32.164 [main] INFO
o.a.activemq.broker.BrokerService.doStartBroker(761) - Apache ActiveMQ 5.14.5 (localhost, ID:SPS-Anash-49217-1518474691990-0:1) started
2018-02-13;00:31:32.165 [main] INFO
o.a.activemq.broker.BrokerService.doStartBroker(762) - For help or more information please see: http://activemq.apache.org
2018-02-13;00:31:32.169 [main] WARN `
You need to enable Jolokia endpoint on your Spring Boot app and make it accessible outside of the app.
To do so, firstly you need to add spring-boot-actuator in pom.xml:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
Then in your application.properties, disable sensitivity of the Jolokia endpoint:
endpoints.jolokia.sensitive = false
Now you should be able to connect to Jolokia at: http://localhost:8080/jolokia Try connecting to it from your hawtio console.
FYI, here you can find a working example of hawtio integration with a Spring Boot app:
https://github.com/hawtio/hawtio/blob/hawtio-1.5.7/hawtio-sample-springboot/

In Creating a Spring Boot application with a flyway H2 embedded database I am having trouble getting the SQL file to run

I have my SQL file titled V2__create_shipwrech.sql. The above file is located in the migration folder of the following path das-boot/src/main/resources/db/migration.
Here's the SQL content:
CREATE TABLE SHIPWRECK(
ID INT AUTO_INCREMENT,
NAME VARCHAR(255),
DESCRIPTION VARCHAR(2000),
CONDITION VARCHAR(255),
DEPTH INT,
LATITUDE DOUBLE,
LONGITUDE DOUBLE,
YEAR_DISCOVERED INT
);
Here's my application.properties file contents:
logging.level.org.springframework.web=DEBUG
server.port=8080
spring.h2.console.enabled=true
spring.h2.console.path=/h2
spring.datasource.url=jdbc:h2:file:~/dasboot
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.max-active=10
spring.datasource.max-idle=8
spring.datasource.max-wait=10000
spring.datasource.min-evictable-idle-time-millis=1000
spring.datasource.min-idle=8
spring.datasource.time-between-eviction-runs-millis=1
flyway.baseline-on-migrate=true
spring.jpa.hibernate.ddl-auto=false;
Here's my pom file contents:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.boot</groupId>
<artifactId>das-boot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.1.RELEASE</version>
</parent>
<name>das-boot</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
This is my first time working with Spring Boot, Flyway, and the h2 embedded database, so please for give me if I sound like a newbie at this, I am.
Here's my console output lines I think stand out to me:
- Database: jdbc:h2:file:~/dasboot (H2 1.4)
- Validated 1 migration (execution time 00:00.039s)
- Current version of schema "PUBLIC": 2
- Schema "PUBLIC" is up to date. No migration necessary.
- Building JPA container EntityManagerFactory for persistence unit 'default'
- Processing PersistenceUnitInfo [
- name: default
- ...]
- Hibernate Core {4.3.11.Final}
- hibernate.properties not found
- HHH000021: Bytecode provider name : javassist
- Hibernate Commons Annotations {4.0.5.Final}
- Unrecognized value for "hibernate.hbm2ddl.auto": false;
- Looking for #ControllerAdvice:
Then there were a ton of debug statements saying bean that were rejected after that, which I don't have enough room to paste.
This was all using java version 1.8
Any help would be greatly appreciated and what I learn from you will be used to teach others as I progress.
Thanks in advance,
Joe
Modify the property spring.jpa.hibernate.ddl-auto=false to
spring.jpa.hibernate.ddl-auto=none

Resources