spring boot - Embedded tomcat not launching -
i wanted upgrade spring boot 1.5.6 boot 1.4.3. created simple web project using spring initializer , added simple controller class. pom.xml
<parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.5.6.release</version> <relativepath/> <!-- lookup parent 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>
restapplication.java
package com.djcodes.testing.rest; import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplication public class restapplication { public static void main(string[] args) { springapplication.run(restapplication.class, args); } }
employeecontroller.java
package com.djcodes.testing.rest; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; import org.springframework.web.bind.annotation.restcontroller; @restcontroller @requestmapping("/employee") public class employeecontroller { @requestmapping(method = { requestmethod.get }, value ="/welcome") public string welcome() { return "welcome employee controller"; } }
when try launch doenst start , builds
$ mvn spring-boot:run [info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building demo-rest-api 0.0.1-snapshot [info] ------------------------------------------------------------------------ [info] [info] >>> spring-boot-maven-plugin:1.5.6.release:run (default-cli) > test-compile @ demo-rest-api >>> [info] [info] --- maven-resources-plugin:2.6:resources (default-resources) @ demo-rest-api --- [info] using 'utf-8' encoding copy filtered resources. [info] copying 1 resource [info] copying 0 resource [info] [info] --- maven-compiler-plugin:3.1:compile (default-compile) @ demo-rest-api --- [info] nothing compile - classes date [info] [info] --- maven-resources-plugin:2.6:testresources (default-testresources) @ demo-rest-api --- [info] using 'utf-8' encoding copy filtered resources. [info] skip non existing resourcedirectory /home/dj/github/test-frameworks-tools/demo-rest-api/src/test/resources [info] [info] --- maven-compiler-plugin:3.1:testcompile (default-testcompile) @ demo-rest-api --- [info] nothing compile - classes date [info] [info] <<< spring-boot-maven-plugin:1.5.6.release:run (default-cli) < test-compile @ demo-rest-api <<< [info] [info] --- spring-boot-maven-plugin:1.5.6.release:run (default-cli) @ demo-rest-api --- . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: spring boot :: (v1.5.6.release) 2017-08-20 16:53:09.047 info 7690 --- [ main] c.djcodes.testing.rest.restapplication : starting restapplication on lenovo pid 7690 (/home/dj/github/test-frameworks-tools/demo-rest-api/target/classes started dj in /home/dj/github/test-frameworks-tools/demo-rest-api) 2017-08-20 16:53:09.051 info 7690 --- [ main] c.djcodes.testing.rest.restapplication : no active profile set, falling default profiles: default 2017-08-20 16:53:09.099 info 7690 --- [ main] s.c.a.annotationconfigapplicationcontext : refreshing org.springframework.context.annotation.annotationconfigapplicationcontext@72458578: startup date [sun aug 20 16:53:09 ist 2017]; root of context hierarchy 2017-08-20 16:53:09.762 info 7690 --- [ main] o.s.j.e.a.annotationmbeanexporter : registering beans jmx exposure on startup 2017-08-20 16:53:09.772 info 7690 --- [ main] c.djcodes.testing.rest.restapplication : started restapplication in 0.966 seconds (jvm running 4.05) [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 2.740 s [info] finished at: 2017-08-20t16:53:09+05:30 [info] final memory: 28m/275m [info] ------------------------------------------------------------------------ 2017-08-20 16:53:09.942 info 7690 --- [ thread-2] s.c.a.annotationconfigapplicationcontext : closing org.springframework.context.annotation.annotationconfigapplicationcontext@72458578: startup date [sun aug 20 16:53:09 ist 2017]; root of context hierarchy 2017-08-20 16:53:09.943 info 7690 --- [ thread-2] o.s.j.e.a.annotationmbeanexporter : unregistering jmx-exposed beans on shutdown
has change in spring-boot 1.5.6? above works fine 1.4.3
thanks
Comments
Post a Comment