I'm developing a Spring boot application.
I'm building a war file for JBoss
My war is building correctly , I'm using *-war.original as deployment for JBoss
the deployment seems fine
But when I make call to controller, it's throwing a 404
With embedded sever it's working fine
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>com.my.service</groupId>
<artifactId>my-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Swagger UI Depedency -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.7.0</version>
</dependency>
<!-- Oracle JDBC driver -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<java.version>1.8</java.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</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-data-jpa</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</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>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- <version>2.0.1.RELEASE</version> -->
<!-- https://stackoverflow.com/questions/43641664/why-spring-boot-generate-jar-or-war-file-with-original-extention -->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<phase>package</phase>
<!-- https://stackoverflow.com/questions/30325549/only-generate-one-war-during-package -->
</execution>
</executions>
</plugin>
<!-- This configuration helps to generate war file without web.xml, spring
boot projects -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
SpringBootServletInitializer
#SpringBootApplication
public class ServletInitializer extends SpringBootServletInitializer{
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MyApiApplication.class);
}
#Override
public void onStartup(ServletContext servletContext) throws ServletException{
super.onStartup(servletContext);
}
}
Deployment log
12:01:09,605 INFO [stdout] (ServerService Thread Pool -- 162) ::
Spring Boot :: (v2.0.1.RELEASE)
2018-04-24 12:01:09,605 [ServerService Thread Pool -- 162] INFO (AbstractLoggingWriter.java:71) - :: Spring Boot ::
(v2.0.1.RELEASE)
12:01:09,605 INFO [stdout] (ServerService Thread Pool -- 162)
2018-04-24 12:01:09,605 [ServerService Thread Pool -- 162] INFO (AbstractLoggingWriter.java:71) -
12:01:09,669 INFO [com.aerlingus.dei.subscriber.api.ServletInitializer] (ServerService
Thread Pool -- 162) Starting ServletInitializer on USER with PID 10692
(started by ADMIN in C:\pathto\jboss-eap-7.1\bin)
2018-04-24 12:01:09,669 [ServerService Thread Pool -- 162] INFO (JBossLog.java:134) - Starting ServletInitializer on CND7064JRN with
PID 10692 (started by ADMIN in C:\pathto\jboss-eap-7.1\bin)
2018-04-24 12:01:09,669 [ServerService Thread Pool -- 162] DEBUG (JBossLog.java:134) - Running with Spring Boot v2.0.1.RELEASE, Spring
v5.0.5.RELEASE
12:01:09,670 INFO [com.aerlingus.dei.subscriber.api.ServletInitializer] (ServerService
Thread Pool -- 162) The following profiles are active: uat
2018-04-24 12:01:09,670 [ServerService Thread Pool -- 162] INFO (JBossLog.java:134) - The following profiles are active: uat
12:01:09,686 INFO [org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext]
(ServerService Thread Pool -- 162) Refreshing
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#5023cb50:
startup date [Tue Apr 24 12:01:09 BST 2018]; root of context hierarchy
2018-04-24 12:01:09,686 [ServerService Thread Pool -- 162] INFO (JBossLog.java:134) - Refreshing
org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#5023cb50:
startup date [Tue Apr 24 12:01:09 BST 2018]; root of context hierarchy
12:01:09,805 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor]
(ServerService Thread Pool -- 162) JSR-330 'javax.inject.Inject'
annotation found and supported for autowiring
2018-04-24 12:01:09,805 [ServerService Thread Pool -- 162] INFO (JBossLog.java:134) - JSR-330 'javax.inject.Inject' annotation found
and supported for autowiring
12:01:09,816 INFO [io.undertow.servlet] (ServerService Thread Pool -- 162) Initializing Spring embedded WebApplicationContext
2018-04-24 12:01:09,816 [ServerService Thread Pool -- 162] INFO (ServletContextImpl.java:360) - Initializing Spring embedded
WebApplicationContext
12:01:09,816 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 162) Root WebApplicationContext:
initialization completed in 130 ms
2018-04-24 12:01:09,816 [ServerService Thread Pool -- 162] INFO (JBossLog.java:134) - Root WebApplicationContext: initialization
completed in 130 ms
12:01:09,987 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean]
(ServerService Thread Pool -- 162) Mapping filter: 'errorPageFilter'
to: [/*]
2018-04-24 12:01:09,987 [ServerService Thread Pool -- 162] INFO (JBossLog.java:134) - Mapping filter: 'errorPageFilter' to: [/*]
12:01:10,015 INFO [com.aerlingus.dei.subscriber.api.ServletInitializer] (ServerService
Thread Pool -- 162) Started ServletInitializer in 0.683 seconds (JVM
running for 4712.635)
2018-04-24 12:01:10,015 [ServerService Thread Pool -- 162] INFO (JBossLog.java:134) - Started ServletInitializer in 0.683 seconds (JVM
running for 4712.635)
12:01:10,021 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService
Thread Pool -- 162) Initializing Mojarra 2.2.13.SP3 for context
'/my-api'
2018-04-24 12:01:10,021 [ServerService Thread Pool -- 162] INFO (ConfigureListener.java:213) - Initializing Mojarra 2.2.13.SP3 for
context '/my-api'
12:01:11,566 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 162) WFLYUT0021: Registered web context: '/my-api' for
server 'default-server'
2018-04-24 12:01:11,566 [ServerService Thread Pool -- 162] INFO (Host.java:220) - WFLYUT0021: Registered web context: '/my-api' for
server 'default-server'
12:01:11,583 INFO [org.jboss.as.server] (External Management Request Threads -- 3) WFLYSRV0010: Deployed "my-api.war" (runtime-name
: "my-api.war")
2018-04-24 12:01:11,583 [External Management Request Threads -- 3] INFO (DeploymentHandlerUtil.java:171) - WFLYSRV0010: Deployed
"my-api.war" (runtime-name : "my-api.war")
WEB-INF/jboss-web.xml
<jboss-web>
<context-root>my-api</context-root>
</jboss-web>
similar to this
Getting "404 - Not found" error with Wildfly and springboot
Finally figured out what was wrong in I did, I have an Application class with main method without #SpringBootApplication along with SpringBootServletInitializer , So Jboss was not picking up the mapping correctly
The resolution was to make SpringBootServletInitializer class with main method. So I change ServletInitializermentioned in question
#SpringBootApplication
public class ServletInitializer extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(ServletInitializer.class, args);
}
#Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(ServletInitializer.class);
}
#Override
public void onStartup(ServletContext servletContext) throws ServletException{
super.onStartup(servletContext);
}
}
After that I was able to hit endpoint,
Why I didn't do this earlier ??
I generated the project using
SPRING INITIALIZR with war packaging, When SPRING INITIALIZR generate project Application and SpringBootServletInitializer classes was there.
Among both classes Appliaction class has the main method and #SpringBootApplication annotation
While writing Integration test initially it was not working , Then I change #SpringBootApplication annotation to SpringBootServletInitializer and write a main method in SpringBootServletInitializer test start working. But I kept the main method back in Appliaction class that was the root cause of this issue.
Since Spring Initializer, generate the classes I was in assumption , all classes generated are required to build war .So I kept the Application class the way it's generated without #SpringBootApplication annotation while generating war file. I think Jboss got confused which main method it should run. And eventually throwing a 404 exception while hitting end point
Related
I'm trying to deploy a Spring application in a Wildfly container, but when start container the application don't start correctly.
I tried some tutorials that only write the SpringBootApplication main class extending SpringBootServletInitializer and added spring-boot-starter-web dependency removing tomcat and adding javax.servlet-api works fine, but when I put this settings to my project it's don't work
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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
</parent>
<groupId>br.com.site</groupId>
<artifactId>oAuth2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>oAuth2</name>
<properties>
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
<javax.activation.version>1.1.1</javax.activation.version>
<maven.war.plugin.version>3.2.3</maven.war.plugin.version>
<jaxb.api.version>2.3.0</jaxb.api.version>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>rt</artifactId>
<version>${jaxb.api.version}</version>
<exclusions>
<exclusion>
<artifactId>jaxb-api</artifactId>
<groupId>javax.xml.bind</groupId>
</exclusion>
<exclusion>
<artifactId>stax-ex</artifactId>
<groupId>org.jvnet.staxex</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax.activation.version}</version>
</dependency>
<build>
<finalName>${project.name}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.plugin.version}</version>
<configuration>
<warName>${project.name}</warName>
<archive>
<manifestEntries>
<Dependencies>jdk.unsupported</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
</plugins>
</build>
</project>
SpringBootApplication
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
#SpringBootApplication(exclude = {ErrorMvcAutoConfiguration.class})
public class OAuth2Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(OAuth2Application.class, args);
}
#Override
protected SpringApplicationBuilder configure(final SpringApplicationBuilder application) {
return application.sources(OAuth2Application.class);
}
}
Dockerfile
FROM jboss/base-jdk:11
# Set the WILDFLY_VERSION env variable
ENV WILDFLY_VERSION 17.0.1.Final
ENV WILDFLY_SHA1 eaef7a87062837c215e54511c4ada8951f0bd8d5
ENV JBOSS_HOME /opt/jboss/wildfly
USER root
RUN cd $HOME \
&& curl -O https://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz \
&& sha1sum wildfly-$WILDFLY_VERSION.tar.gz | grep $WILDFLY_SHA1 \
&& tar xf wildfly-$WILDFLY_VERSION.tar.gz \
&& mv $HOME/wildfly-$WILDFLY_VERSION $JBOSS_HOME \
&& rm wildfly-$WILDFLY_VERSION.tar.gz \
&& chown -R jboss:0 ${JBOSS_HOME} \
&& chmod -R g+rw ${JBOSS_HOME}
ENV LAUNCH_JBOSS_IN_BACKGROUND true
USER jboss
EXPOSE 8080
ADD oAuth2.war /opt/jboss/wildfly/standalone/deployments/
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
Wildfly Logs
12:47:02,979 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "oAuth2.war" (runtime-name: "oAuth2.war")
12:47:03,148 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0006: Undertow HTTPS listener https listening on 0.0.0.0:8443
12:47:03,267 INFO [org.jboss.ws.common.management] (MSC service thread 1-1) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.2)
12:47:08,139 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0059: Class Path entry jaxb-core.jar in /content/oAuth2.war/WEB-INF/lib/jaxb-impl-2.3.0.jar does not point to a valid jar for a Class-Path reference.
12:47:08,149 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0059: Class Path entry jaxb-api.jar in /content/oAuth2.war/WEB-INF/lib/jaxb-core-2.3.0.jar does not point to a valid jar for a Class-Path reference.
12:47:09,479 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener due to an exception (enable DEBUG log level to see the cause)
12:47:09,502 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener due to an exception (enable DEBUG log level to see the cause)
12:47:09,532 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
12:47:09,534 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
12:47:09,539 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpRequest$RequestAsyncListener due to an exception (enable DEBUG log level to see the cause)
12:47:09,801 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-4) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.14.Final
12:47:09,844 WARN [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0013: Deployment oAuth2.war contains CDI annotations but no bean archive was found (no beans.xml or class with bean defining annotations was present).
12:47:10,395 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 76) WFLYCLINF0002: Started client-mappings cache from ejb container
12:47:10,606 INFO [io.undertow.servlet] (ServerService Thread Pool -- 83) 2 Spring WebApplicationInitializers detected on classpath
Handler java.util.logging.ConsoleHandler is not defined
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (vfs:/content/oAuth2.war/WEB-INF/lib/jaxb-impl-2.3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
I found the error. Removing this dependency the application works fine
<dependency>
<groupId>de.svenkubiak</groupId>
<artifactId>embedded-mongodb</artifactId>
<version>5.0.2</version>
<scope>compile</scope>
</dependency>
I am having trouble building a Spring Boot + Spring Cloud application that is combining Zuul, Eureka server, Config server and Admin server in one unique application.
If you are already thinking: "Why on earth, this is breaking micro services concepts, etc.." I totally agree. This question is about the feasibility to make it happen, not to ask if it is a good idea to do it, thank you for your understanding.
Does anyone know how to make it happen? Some solution with Spring 2.1.0 + Spring Cloud Finchley or above will be great.
The code is obviously very straightforward:
`
#EnableZuulProxy
#EnableAdminServer
#EnableConfigServer
#EnableEurekaServer
#SpringBootApplication
public class Main {
public static void main(String[] args) {
SpringApplication.run(Main.class, args);
}
}
`
The pom is also simple:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
<relativePath/>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Greenwich.M3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
With an also straightforward config file:
spring.application.name=question
server.port=8090
eureka.client.service-url.defaultZone=http://localhost:8090/eureka
spring.boot.admin.context-path=/admin
spring.cloud.config.server.prefix=/config
spring.cloud.config.server.git.uri=...
spring.cloud.config.server.git.searchPaths=...
[...]
The closest I got was to use 2.0.6 + Finchley:
2018-12-08 13:20:10.515 INFO 13078 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-12-08 13:20:10.519 WARN 13078 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [RxIoScheduler-1 (Evictor)] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
2018-12-08 13:20:10.534 INFO 13078 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-12-08 13:20:10.536 ERROR 13078 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method reactor.retry.Retry.retryMax(J)Lreactor/retry/Retry; but it does not exist. Its class, reactor.retry.Retry, is available from the following locations:
jar:file:/Users/aaa/.m2/repository/io/projectreactor/addons/reactor-extra/3.1.7.RELEASE/reactor-extra-3.1.7.RELEASE.jar!/reactor/retry/Retry.class
It was loaded from the following location:
file:/Users/aaa/.m2/repository/io/projectreactor/addons/reactor-extra/3.1.7.RELEASE/reactor-extra-3.1.7.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of reactor.retry.Retry
Process finished with exit code 1
You need version 2.0.4 of spring boot admin. You're using the latest (2.1.1) which is not compatible with the rest of Spring libraries you're using.
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/
My war application is not deployed into WildFly 10.1.
Here's the log:
16:43:08,875 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "apontatouch.war" (runtime-name: "apontatouch.war")
16:43:09,315 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
16:43:09,932 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-1) ISPN000128: Infinispan version: Infinispan 'Chakra' 8.2.4.Final
16:43:10,144 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 58) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
16:43:10,169 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 58) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
16:43:10,177 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 60) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
16:43:10,179 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 60) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
16:43:10,185 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 61) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
16:43:10,186 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 61) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
16:43:10,653 INFO [org.jboss.as.protocol] (management task-10) WFLYPRT0057: cancelled task by interrupting thread Thread[management-handler-thread - 1,5,management-handler-thread]
16:43:10,688 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
16:43:11,051 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6)
16:43:18,215 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment apontatouch.war
16:43:18,432 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.2.4.Final
16:43:18,933 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0004: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)
16:43:18,996 INFO [org.jboss.weld.Version] (MSC service thread 1-4) WELD-000900: 2.3.5 (Final)
16:43:19,068 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = apontatouch.war_com.microsoft.sqlserver.jdbc.SQLServerDriver_4_0
16:43:20,438 INFO [org.jboss.weld.Bootstrap] (Weld Thread Pool -- 4) WELD-001125: Illegal bean type interface java.util.Map<java.lang.Class<?>,class java.lang.Object> ignored on [EnhancedAnnotatedTypeImpl] public #Named #ApplicationScoped class br.com.caelum.vraptor.view.LinkToHandler
16:43:20,544 INFO [org.jboss.weld.Bootstrap] (Weld Thread Pool -- 4) WELD-001125: Illegal bean type com.google.common.collect.ForwardingMap<java.lang.Class<?>, java.lang.Object> ignored on [EnhancedAnnotatedTypeImpl] public #Named #ApplicationScoped class br.com.caelum.vraptor.view.LinkToHandler
16:43:21,762 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "apontatouch.war")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.undertow.server.default-server.aponta"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.undertow.deployment.default-server.aponta./.UndertowDeploymentInfoService is missing [jboss.undertow.server.default-server.aponta]",
"jboss.undertow.deployment.default-server.aponta./ is missing [jboss.undertow.server.default-server.aponta]"
]
}
16:43:21,805 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "apontatouch.war" (runtime-name : "apontatouch.war")
16:43:21,847 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.undertow.server.default-server.aponta (missing) dependents: [service jboss.undertow.deployment.default-server.aponta./, service jboss.undertow.deployment.default-server.aponta./.UndertowDeploymentInfoService]
16:43:22,087 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
16:43:22,088 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
16:43:22,088 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 23335ms - Started 807 of 1059 services (3 services failed or missing dependencies, 404 services are lazy, passive or on-demand)
16:43:22,156 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0019: Stopped Driver service with driver-name = apontatouch.war_com.microsoft.sqlserver.jdbc.SQLServerDriver_4_0
16:43:23,793 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0028: Stopped deployment apontatouch.war (runtime-name: apontatouch.war) in 1661ms
16:43:23,889 WARN [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0357: Notification of type deployment-undeployed is not described for the resource at the address []
16:43:23,919 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from location C:\Users\luis.infoture\Desktop\wildfly-10.1.0.Final\wildfly-10.1.0.Final\standalone\data\content\0f\38194460d90047fd70e65c404eef0bf7418570\content
16:43:23,920 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "apontatouch.war" (runtime-name: "apontatouch.war")
16:43:23,937 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
Here's my pom.xml:
<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>br.com.schmersal.svm</groupId>
<artifactId>apontatouch</artifactId>
<version>2.0</version>
<packaging>war</packaging>
<description>SVM Apontatouch para Android</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<weld.version>2.1.2.Final</weld.version>
</properties>
<dependencies>
<!-- VRaptor -->
<dependency>
<groupId>br.com.caelum</groupId>
<artifactId>vraptor</artifactId>
<version>4.2.0-RC5</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.paranamer</groupId>
<artifactId>paranamer</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>br.com.caelum.vraptor</groupId>
<artifactId>vraptor-jodatime</artifactId>
<version>4.1.0-RC3</version>
</dependency>
<!-- fim VRaptor -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-hibernate</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.jadira.usertype</groupId>
<artifactId>usertype.core</artifactId>
<version>3.0.0.CR1</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>5.1.1.Final</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.4</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<!-- hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.10.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.3.10.Final</version>
</dependency>
<!-- fim hibernate -->
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
</project>
What's the problem, and how can I fix it?
Do you need default host at all? or only the virtual on?
you should be fine by doing something like this:
<server name="default-server" default-host="aponta">
<http-listener name="default" socket-binding="http"/>
<host name="aponta" alias="localhost" default-web-module="apontatouch.war">
<location name="/" handler="welcome-content" />
</host>
</server>
or if you need default-host, then you just need to add host different allias.
maybe aponta.local, and then add in your hosts file on your machine entry
127.0.0.1 aponta.local (or what ever you decide to call your custom local domain)
on linux this file is located in /etc/hosts
on windows in c:\windows\system32\drivers\etc\hosts
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.