I am a new beginner in SpringBoot, I am trying to microservice-a to fetch config from the config-sever, but after I set the server, and restart the microservice-a, I couldn't see the corresponding log information, it seems it didn't fetch at all.
16:09:02.899 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
16:09:02.902 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-starter/target/classes/, /spring-boot-devtools/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-autoconfigure/target/classes/]
16:09:02.902 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/username/Documents/GitHub/SpringBoot-Exploration/microservice-a/target/classes/]
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.5.RELEASE)
2018-10-11 16:09:03.128 INFO 3198 --- [ restartedMain] c.m.s.cloud.MicroserviceAApplication : Starting MicroserviceAApplication on usernamedeMacBook-Pro.local with PID 3198 (/Users/username/Documents/GitHub/SpringBoot-Exploration/microservice-a/target/classes started by username in /Users/username/Documents/GitHub/SpringBoot-Exploration/microservice-a)
2018-10-11 16:09:03.130 INFO 3198 --- [ restartedMain] c.m.s.cloud.MicroserviceAApplication : No active profile set, falling back to default profiles: default
2018-10-11 16:09:03.205 INFO 3198 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#5e03eade: startup date [Thu Oct 11 16:09:03 IST 2018]; root of context hierarchy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/Users/username/.m2/repository/org/springframework/spring-core/5.0.9.RELEASE/spring-core-5.0.9.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
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
2018-10-11 16:09:04.512 INFO 3198 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-10-11 16:09:04.531 INFO 3198 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-10-11 16:09:04.531 INFO 3198 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-10-11 16:09:04.535 INFO 3198 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/username/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-10-11 16:09:04.602 INFO 3198 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-10-11 16:09:04.602 INFO 3198 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1403 ms
2018-10-11 16:09:05.018 INFO 3198 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-10-11 16:09:05.018 INFO 3198 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webMvcMetricsFilter' to: [/*]
2018-10-11 16:09:05.018 INFO 3198 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-10-11 16:09:05.018 INFO 3198 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-10-11 16:09:05.018 INFO 3198 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-10-11 16:09:05.018 INFO 3198 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpTraceFilter' to: [/*]
2018-10-11 16:09:05.019 INFO 3198 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-10-11 16:09:05.103 INFO 3198 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-11 16:09:05.239 INFO 3198 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#5e03eade: startup date [Thu Oct 11 16:09:03 IST 2018]; root of context hierarchy
2018-10-11 16:09:05.280 INFO 3198 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/message]}" onto public java.util.Map<java.lang.String, java.lang.String> com.mastering.spring.cloud.controller.MessageController.welcome()
2018-10-11 16:09:05.281 INFO 3198 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/random]}" onto public java.util.List<java.lang.Integer> com.mastering.spring.cloud.controller.RandomNumberController.random()
2018-10-11 16:09:05.285 INFO 3198 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-10-11 16:09:05.285 INFO 3198 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-10-11 16:09:05.306 INFO 3198 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-11 16:09:05.306 INFO 3198 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-11 16:09:05.569 INFO 3198 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-10-11 16:09:05.580 INFO 3198 --- [ restartedMain] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2018-10-11 16:09:05.589 INFO 3198 --- [ restartedMain] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator/health],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>)
2018-10-11 16:09:05.590 INFO 3198 --- [ restartedMain] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator/info],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle(javax.servlet.http.HttpServletRequest,java.util.Map<java.lang.String, java.lang.String>)
2018-10-11 16:09:05.590 INFO 3198 --- [ restartedMain] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Mapped "{[/actuator],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto protected java.util.Map<java.lang.String, java.util.Map<java.lang.String, org.springframework.boot.actuate.endpoint.web.Link>> org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping.links(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-10-11 16:09:05.638 INFO 3198 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-10-11 16:09:05.677 INFO 3198 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-10-11 16:09:05.682 INFO 3198 --- [ restartedMain] c.m.s.cloud.MicroserviceAApplication : Started MicroserviceAApplication in 2.771 seconds (JVM running for 3.545)
2018-10-11 16:09:05.991 INFO 3198 --- [on(2)-127.0.0.1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2018-10-11 16:09:05.991 INFO 3198 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2018-10-11 16:09:06.001 INFO 3198 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 10 ms
In microservice-a, I have changed application.properties to bootstrap.properties
spring.application.name=microservice-a
spring.cloud.config.uri=http://localhost:8888
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.mastering.spring.cloud</groupId>
<artifactId>microservice-a</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>microservice-a</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.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-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.RC1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
In config-sever, I have added the Annotation #EnableConfigServer and set application.properties
package com.mastering.spring.configserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
#EnableConfigServer
#SpringBootApplication
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class, args);
}
}
application.properties
I connected spring cloud server to a local git repository, this repository include some setting file.
spring.application.name=config-server
server.port=8888
spring.cloud.config.server.git.uri=/Users/username/Documents/GitHub/SpringBoot-Exploration/git-localconfig-repo
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.mastering.spring</groupId>
<artifactId>config-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>config-server</name>
<description>Demo project for Spring initializr</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.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>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
Could anyone tell me how to solve this problem? Thanks
I believe you are using local file system for all the config. Could you please use below configuration in config server properties. This will fetch all the configurations from service-config directory.
spring.cloud.config.server.native.searchLocations=file:///C:/debopam/service-config
Related
I have a Springboot project I created by copying the libraries from mvn repository, not using SPRING INITLZR.
Anyway Springboot main seems to be working fine.
It's just that my Rest Controller is not displaying the message I want to.
Main.class
#SpringBootApplication
public class MovieInfoServiceApplication {
public static void main(String[] args) throws IOException, GeneralSecurityException, MessagingException {
SpringApplication.run(MovieInfoServiceApplication.class, args);
}
}
RestController.class
#RestController
#RequestMapping("/")
public class MovieServiceRestController {
#GetMapping("/hello")
//#CrossOrigin(origins = "http://localhost:9005")
public String hello() {
return "movie-service-api: hello from MovieServiceRestController";
}
}
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.3.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.backend</groupId>
<artifactId>movie-info-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>movie-info-service</name>
<description>microservices about movie info</description>
<properties>
<java.version>11</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-web-services</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>
This is what I got when I access "localhost:9005/hello"
Springboot logs
2020-10-18 02:18:35.481 INFO 4347 --- [ main] com.gmailapijava.main.GmailAPIJavaMain : No active profile set, falling back to default profiles: default
2020-10-18 02:18:38.779 INFO 4347 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$e708c1d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-10-18 02:18:39.142 INFO 4347 --- [ main] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
2020-10-18 02:18:40.286 INFO 4347 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9005 (http)
2020-10-18 02:18:40.307 INFO 4347 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-10-18 02:18:40.307 INFO 4347 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.38]
2020-10-18 02:18:41.175 INFO 4347 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-10-18 02:18:41.176 INFO 4347 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5020 ms
2020-10-18 02:18:42.329 INFO 4347 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-10-18 02:18:43.369 INFO 4347 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9005 (http) with context path ''
2020-10-18 02:18:43.391 INFO 4347 --- [ main] com.gmailapijava.main.GmailAPIJavaMain : Started GmailAPIJavaMain in 10.504 seconds (JVM running for 14.339)
2020-10-18 02:18:56.903 INFO 4347 --- [nio-9005-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-10-18 02:18:56.905 INFO 4347 --- [nio-9005-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2020-10-18 02:18:56.919 INFO 4347 --- [nio-9005-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 14 ms
SpringApplication.run(GmailAPIJavaMain.class, args);
should be
SpringApplication.run(MovieInfoServiceApplication.class, args);
Also check if the controller package is getting scanned.
Try it like this
#RestController
public class MovieServiceRestController {
#GetMapping("/hello")
//#CrossOrigin(origins = "http://localhost:9005")
public String hello() {
return "movie-service-api: hello from MovieServiceRestController";
}
}
I'm following a tutorial about Eureka to start up a sample eureka server ,I followed exactly the same steps but i get a whitelabel insteed of eureka dashbord, I will share with you all the configuration that I made
the POM.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com..discovery.service</groupId>
<artifactId>descoveryservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>descoveryservice</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
application.properties :
server.port=8010
spring.application.name=discoveryservice
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
eureka.client.serviceUrl.defaultZone = http://localhost:8010/eureka
and the finally the console :
2020-05-07 16:15:59.358 INFO 21060 --- [ main] o.s.core.annotation.AnnotationUtils : Failed to introspect annotations on class org.springframework.cloud.netflix.eureka.config.EurekaDiscoveryClientConfigServiceBootstrapConfiguration: java.lang.IllegalStateException: Could not obtain annotation attribute value for public abstract java.lang.Class[] org.springframework.boot.autoconfigure.condition.ConditionalOnClass.value()
2020-05-07 16:15:59.679 INFO 21060 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$97f8ff4f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
2020-05-07 16:16:01.722 INFO 21060 --- [ main] c.d.s.d.DescoveryserviceApplication : No active profile set, falling back to default profiles: default
2020-05-07 16:16:02.829 WARN 21060 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2020-05-07 16:16:03.242 INFO 21060 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=889ab658-056e-3973-ba9c-f9fdd0f82c43
2020-05-07 16:16:03.378 INFO 21060 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$97f8ff4f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-07 16:16:04.447 INFO 21060 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8010 (http)
2020-05-07 16:16:04.491 INFO 21060 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-05-07 16:16:04.491 INFO 21060 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
2020-05-07 16:16:04.509 INFO 21060 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk-11.0.6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jdk-11.0.6/bin/server;C:/Program Files/Java/jdk-11.0.6/bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\novatim\AppData\Local\Microsoft\WindowsApps;C:\Users\novatim\Desktop\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin;C:\Program Files\Java\jdk-11.0.6\bin;;C:\Users\novatim\Desktop\eclipse-jee-2019-12-R-win32-x86_64\eclipse;;.]
2020-05-07 16:16:04.768 INFO 21060 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-05-07 16:16:04.768 INFO 21060 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2996 ms
2020-05-07 16:16:04.935 WARN 21060 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2020-05-07 16:16:04.936 INFO 21060 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-05-07 16:16:04.962 INFO 21060 --- [ main] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration#13ed066e
2020-05-07 16:16:06.652 INFO 21060 --- [ main] o.s.cloud.commons.util.InetUtils : Cannot determine local hostname
2020-05-07 16:16:08.337 INFO 21060 --- [ main] o.s.cloud.commons.util.InetUtils : Cannot determine local hostname
2020-05-07 16:16:08.963 WARN 21060 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2020-05-07 16:16:08.964 INFO 21060 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-05-07 16:16:09.222 INFO 21060 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-05-07 16:16:10.021 INFO 21060 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 2 endpoint(s) beneath base path '/actuator'
2020-05-07 16:16:10.174 INFO 21060 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2020-05-07 16:16:10.226 INFO 21060 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2020-05-07 16:16:10.229 INFO 21060 --- [ main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2020-05-07 16:16:10.243 INFO 21060 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1588860970242 with initial instances count: 0
2020-05-07 16:16:10.250 INFO 21060 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application discoveryservice with eureka with status UP
2020-05-07 16:16:10.326 INFO 21060 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8010 (http) with context path ''
2020-05-07 16:16:10.333 INFO 21060 --- [ main] c.d.s.d.DescoveryserviceApplication : Started DescoveryserviceApplication in 13.391 seconds (JVM running for 14.094)
2020-05-07 16:16:17.202 INFO 21060 --- [nio-8010-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-05-07 16:16:17.204 INFO 21060 --- [nio-8010-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2020-05-07 16:16:17.223 INFO 21060 --- [nio-8010-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 19 ms
I do not know where the problem is it has been several hours that I am looking for a solution, if you have ideas do not hesitate to share them,
Thanks .
I guess you didn't add #EnableEurekaServer annotation to your main app
It should be like this
#SpringBootApplication
#EnableEurekaServer
public class DiscoveryServerApplication {
…
}
I recently started using Linux Fedora 26 and wanted to start a Spring Boot Application but it won't recognize #Controller and #RestController annotations with Thymeleaf. My HomeController class's mapping doesn't see my Templates folder and I get a Whiteable Error page / 404.
I have started to build a similar project (https://github.com/alexanderphoen1x/trainingdiary) in my old Windows machine and it seemed to work fine, but when I tried running my old project, I cloned it from github and it gives me an Exception:
Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource
[org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed
I think it might be Linux related?
Project structure:
1. greenenergy
-src/main/java
+com.greenenergy
*GreenEnergyApplication.java
+com.greenenergy.controller
*HomeController.java
-src/main/resources
+static
+templates
*stories.html
+application.properties
(...)
-pom.xml
My code:
GreenEnergyApplication.java:
package com.greenenergy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class GreenEnergyApplication {
public static void main(String[] args) {
SpringApplication.run(GreenEnergyApplication.class, args);
}
}
HomeController.java:
package com.greenergy.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
public class HomeController {
#RequestMapping("/")
public String stories() {
return "stories";
}
}
stories.html:
<!DOCTYPE html>
<html>
<title></title>
<head></head>
<body>Hey Alex</body>
</html>
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.greenenergy</groupId>
<artifactId>greenenergy</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>demo</name>
<description>Green energy project</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-devtools</artifactId>
<optional>true</optional>
</dependency>
<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>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Console:
2018-10-22 17:31:32.580 INFO 5091 --- [ restartedMain] com.greenenergy.GreenEnergyApplication : Starting GreenEnergyApplication on localhost.localdomain with PID 5091 (/home/alexanderp/Projects/greenenergy/greenenergy/target/classes started by alexanderp in /home/alexanderp/Projects/greenenergy/greenenergy)
2018-10-22 17:31:32.581 INFO 5091 --- [ restartedMain] com.greenenergy.GreenEnergyApplication : No active profile set, falling back to default profiles: default
2018-10-22 17:31:32.650 INFO 5091 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#76dffce0: startup date [Mon Oct 22 17:31:32 CEST 2018]; root of context hierarchy
2018-10-22 17:31:34.411 INFO 5091 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-10-22 17:31:34.438 INFO 5091 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-10-22 17:31:34.439 INFO 5091 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-10-22 17:31:34.446 INFO 5091 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3].
2018-10-22 17:31:34.447 INFO 5091 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
2018-10-22 17:31:34.447 INFO 5091 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
2018-10-22 17:31:34.450 INFO 5091 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : OpenSSL successfully initialized [OpenSSL 1.1.0h-fips 27 Mar 2018]
2018-10-22 17:31:34.546 INFO 5091 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-10-22 17:31:34.546 INFO 5091 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1900 ms
2018-10-22 17:31:34.619 INFO 5091 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-10-22 17:31:34.623 INFO 5091 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-10-22 17:31:34.624 INFO 5091 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-10-22 17:31:34.624 INFO 5091 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-10-22 17:31:34.624 INFO 5091 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-10-22 17:31:34.785 INFO 5091 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-22 17:31:35.027 INFO 5091 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#76dffce0: startup date [Mon Oct 22 17:31:32 CEST 2018]; root of context hierarchy
2018-10-22 17:31:35.117 INFO 5091 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-10-22 17:31:35.119 INFO 5091 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-10-22 17:31:35.177 INFO 5091 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-22 17:31:35.177 INFO 5091 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-10-22 17:31:35.425 INFO 5091 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-10-22 17:31:35.453 INFO 5091 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-10-22 17:31:35.482 INFO 5091 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-10-22 17:31:35.487 INFO 5091 --- [ restartedMain] com.greenenergy.GreenEnergyApplication : Started GreenEnergyApplication in 3.246 seconds (JVM running for 4.164)
2018-10-22 17:31:40.437 INFO 5091 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2018-10-22 17:31:40.437 INFO 5091 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2018-10-22 17:31:40.450 INFO 5091 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 12 ms
2018-10-22 17:31:48.845 INFO 5091 --- [ Thread-7] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#76dffce0: startup date [Mon Oct 22 17:31:32 CEST 2018]; root of context hierarchy
2018-10-22 17:31:48.848 INFO 5091 --- [ Thread-7] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
The Maven dependency could be corrupted during the download. Comment out the Thymeleaf in the POM and save the project. Delete manually the Thymeleaf files on your drive. Put back the Thymeleaf dependency in the POM and save the Project.
I have a spring-boot war application that runs perfectly in windows and ios, then I tried to run it in linux. It did run and build normally but when I tried to open it via browser it returns invalid http responses in chrome and some undeciphered codes in Firefox. I used this pc to run another spring-boot projects and they work just fine. I'm using Maven 3.3.9 and Ubuntu 16.04.
Here's what my pom.xml looks like
<?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.example</groupId>
<artifactId>hris</artifactId>
<version>0.1</version>
<packaging>war</packaging>
<name>hris</name>
<description>sso template for hris</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.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-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1212.jre7</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity4</artifactId>
<version>3.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/nz.net.ultraq.thymeleaf/thymeleaf-layout-dialect -->
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
<version>2.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf-spring4 -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
<scope>provided</scope>
</dependency>
<!-- CAS Integration -->
<dependency>
<groupId>com.kakawait</groupId>
<artifactId>cas-security-spring-boot-starter</artifactId>
<version>0.6.0</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-core</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>22.0</version>
</dependency>
</dependencies>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>${compilerArgument}</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
</project>
And here's what's written out when I run the app
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dapil 0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.9.RELEASE:run (default-cli) > test-compile # hris >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # hris ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 953 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # hris ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # hris ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /******/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # hris ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.9.RELEASE:run (default-cli) < test-compile # hris <<<
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.9.RELEASE:run (default-cli) # hris ---
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.9.RELEASE)
2018-04-12 12:49:22.096 INFO 30740 --- [ main] c.example.hris.HRISApplication : Starting HRISApplication on Lenovo-G40-70 with PID 30740 (/*******/target/classes started by ****** in **********)
2018-04-12 12:49:22.101 INFO 30740 --- [ main] c.example.hris.HRISApplication : No active profile set, falling back to default profiles: default
2018-04-12 12:49:22.632 INFO 30740 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#9e79a00: startup date [Thu Apr 12 12:49:22 WIB 2018]; root of context hierarchy
2018-04-12 12:49:24.064 WARN 30740 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.example.hris]' package. Please check your configuration.
2018-04-12 12:49:25.583 INFO 30740 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 12000 (https)
2018-04-12 12:49:25.611 INFO 30740 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-04-12 12:49:25.613 INFO 30740 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.23
2018-04-12 12:49:25.766 INFO 30740 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-04-12 12:49:25.767 INFO 30740 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3141 ms
2018-04-12 12:49:26.053 INFO 30740 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-04-12 12:49:26.054 INFO 30740 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-04-12 12:49:26.054 INFO 30740 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-04-12 12:49:26.055 INFO 30740 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-04-12 12:49:26.056 INFO 30740 --- [ost-startStop-1] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2018-04-12 12:49:26.057 INFO 30740 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-04-12 12:49:28.032 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#9e79a00: startup date [Thu Apr 12 12:49:22 WIB 2018]; root of context hierarchy
2018-04-12 12:49:28.050 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Detected #ModelAttribute methods in siteController
2018-04-12 12:49:28.175 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/edit/{id}],methods=[POST]}" onto public java.lang.String com.example.hris.controller.AuthController.postAuthEdit(com.example.hris.dto.form.cmd.AuthItemCmd,org.springframework.validation.BindingResult,org.springframework.web.servlet.mvc.support.RedirectAttributes)
2018-04-12 12:49:28.176 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/create],methods=[GET]}" onto public java.lang.String com.example.hris.controller.AuthController.getAuthAdd(org.springframework.ui.Model)
2018-04-12 12:49:28.177 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/create],methods=[POST]}" onto public java.lang.String com.example.hris.controller.AuthController.postAuthAdd(com.example.hris.dto.form.cmd.AuthItemChildCmd,org.springframework.validation.BindingResult,org.springframework.web.servlet.mvc.support.RedirectAttributes)
2018-04-12 12:49:28.177 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/update/{id}],methods=[GET]}" onto public java.lang.String com.example.hris.controller.AuthController.getAuthEdit(java.lang.Long,org.springframework.ui.Model,org.springframework.web.servlet.mvc.support.RedirectAttributes)
2018-04-12 12:49:28.178 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/delete],methods=[POST]}" onto public boolean com.example.hris.controller.AuthController.postUserDeactivate(java.lang.String)
2018-04-12 12:49:28.178 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/manage],methods=[GET]}" onto public java.lang.String com.example.hris.controller.AuthController.indexGet(com.example.hris.dto.form.search.AuthItemSearchForm,org.springframework.validation.BindingResult,org.springframework.ui.Model)
2018-04-12 12:49:28.179 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/table],methods=[POST]}" onto public com.github.dandelion.datatables.core.ajax.DatatablesResponse<com.example.hris.dto.table.AuthItemItem> com.example.hris.controller.AuthController.postTableSearch(com.example.hris.dto.form.search.AuthItemSearchForm,javax.servlet.http.HttpServletRequest)
2018-04-12 12:49:28.181 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/signin],methods=[GET]}" onto public java.lang.String com.example.hris.controller.SiteController.login()
2018-04-12 12:49:28.181 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public java.lang.String com.example.hris.controller.SiteController.index()
2018-04-12 12:49:28.185 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-04-12 12:49:28.186 INFO 30740 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-04-12 12:49:28.250 INFO 30740 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-04-12 12:49:28.251 INFO 30740 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-04-12 12:49:28.337 INFO 30740 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-04-12 12:49:29.686 INFO 30740 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/css/**'], Ant [pattern='/js/**'], Ant [pattern='/images/**'], Ant [pattern='/webjars/**'], Ant [pattern='/**/favicon.ico'], Ant [pattern='/error']]], []
2018-04-12 12:49:29.830 INFO 30740 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/**']]], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#551f663f, org.springframework.security.web.context.SecurityContextPersistenceFilter#223b66, org.springframework.security.web.header.HeaderWriterFilter#37dc0139, org.jasig.cas.client.session.SingleSignOutFilter#4b658c91, org.springframework.security.web.authentication.logout.LogoutFilter#274ccf4f, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#13f8799a, org.springframework.security.cas.web.CasAuthenticationFilter#764ed709, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#422b1740, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#6e1eddc, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#7886ebc0, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#58ce6961, org.springframework.security.web.session.SessionManagementFilter#48408088, org.springframework.security.web.access.ExceptionTranslationFilter#4fa73638, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#46775723]
2018-04-12 12:49:29.853 INFO 30740 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/**']]], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#2ff438ee, org.springframework.security.web.context.SecurityContextPersistenceFilter#d3ea90c, org.springframework.security.web.header.HeaderWriterFilter#41ef1e45, org.springframework.security.web.authentication.logout.LogoutFilter#4e1c5a6a, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#3657e01, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#381dbdc1, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#1b991b1, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#4dd194c2, org.springframework.security.web.session.SessionManagementFilter#3b7b329e, org.springframework.security.web.access.ExceptionTranslationFilter#7f495bf9, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#ad57ac4]
2018-04-12 12:49:30.176 INFO 30740 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-04-12 12:49:31.983 INFO 30740 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 12000 (https)
2018-04-12 12:49:31.991 INFO 30740 --- [ main] c.example.hris.HRISApplication : Started HRISApplication in 10.454 seconds (JVM running for 16.918)
2018-04-12 12:49:48.922 INFO 30740 --- [ Thread-4] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#9e79a00: startup date [Thu Apr 12 12:49:22 WIB 2018]; root of context hierarchy
2018-04-12 12:49:48.928 INFO 30740 --- [ Thread-4] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
I tried this on Ubuntu 17.10 but the same thing happened. Is there anything I can do to fix it? Thanks in advance
EDIT: I'm have openjdk8 in both version of ubuntu and windows. I'm not sure about the ios since its my friend's.
Here's how they look like when I tried to build it
in chromium & in firefox
I had this problem with spring-boot version 1.4.0.RELEASE and got resolved when switched to version 2.1.8.RELEASE
I have done sample spring boot app. I do not know what I am missing.
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.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SpringBootRestEx</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.3.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>
MyApplicationClass
#SpringBootApplication
public class SpringBootRestExApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootRestExApplication.class, args);
}
}
MyRestCallClass
#RestController
public class RestControllerClass {
#RequestMapping("/rest/test/")
public #ResponseBody void testOne(HttpServletResponse response) throws IOException{
response.sendRedirect("help.html");
}
}
AplicationProperyfile
server.port=8787
server.context-path=/demo
My help.html file under resource & static folder.
I am getting 404 error.
**UPDATE - 1 **
- this is my LOG.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.3.RELEASE)
2016-12-30 12:49:58.781 INFO 9576 --- [ main] com.example.SpringBootRestExApplication : Starting SpringBootRestExApplication on Hydrogen with PID 9576 (D:\18062016_AceKab_WorkShop\10-11-2016_mysql_Acekab\SpringBootRestEx\target\classes started by ace in D:\18062016_AceKab_WorkShop\10-11-2016_mysql_Acekab\SpringBootRestEx)
2016-12-30 12:49:58.788 INFO 9576 --- [ main] com.example.SpringBootRestExApplication : No active profile set, falling back to default profiles: default
2016-12-30 12:49:58.940 INFO 9576 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#1622f1b: startup date [Fri Dec 30 12:49:58 IST 2016]; root of context hierarchy
2016-12-30 12:50:02.411 INFO 9576 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8787 (http)
2016-12-30 12:50:02.438 INFO 9576 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-12-30 12:50:02.440 INFO 9576 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.6
2016-12-30 12:50:02.718 INFO 9576 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/demo] : Initializing Spring embedded WebApplicationContext
2016-12-30 12:50:02.719 INFO 9576 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3788 ms
2016-12-30 12:50:03.145 INFO 9576 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-12-30 12:50:03.154 INFO 9576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-12-30 12:50:03.155 INFO 9576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-12-30 12:50:03.156 INFO 9576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-12-30 12:50:03.156 INFO 9576 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2016-12-30 12:50:03.965 INFO 9576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#1622f1b: startup date [Fri Dec 30 12:49:58 IST 2016]; root of context hierarchy
2016-12-30 12:50:04.126 INFO 9576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/rest/test/]}" onto public void com.example.RestControllerClass.testOne(javax.servlet.http.HttpServletResponse) throws java.io.IOException
2016-12-30 12:50:04.137 INFO 9576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-12-30 12:50:04.138 INFO 9576 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-12-30 12:50:04.222 INFO 9576 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-12-30 12:50:04.222 INFO 9576 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-12-30 12:50:04.313 INFO 9576 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-12-30 12:50:04.628 INFO 9576 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-12-30 12:50:04.803 INFO 9576 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8787 (http)
2016-12-30 12:50:04.820 INFO 9576 --- [ main] com.example.SpringBootRestExApplication : Started SpringBootRestExApplication in 6.889 seconds (JVM running for 7.666)
2016-12-30 12:52:10.192 INFO 9576 --- [nio-8787-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/demo] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2016-12-30 12:52:10.192 INFO 9576 --- [nio-8787-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2016-12-30 12:52:10.222 INFO 9576 --- [nio-8787-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 30 ms
First of all i don't understand why you use #ResponseBody a method which return type void. Remove it. Then you need to use View Resolver to show html page and if you want to redirect it you can use an approach like below:
#Controller
public class RestControllerClass {
#RequestMapping("/rest/test/")
public String testOne(HttpServletResponse response) throws IOException{
return "redirect:/help";
}
}
HelpController.java
#Controller
public class HelpController {
#RequestMapping("/help")
public String get(HttpServletResponse response) throws IOException{
return "help";
}
}
in application.properties under src/main/resources folder.
spring.mvc.view.prefix=/static/
spring.mvc.view.suffix=.html