java - Spring boot mvc multimodule on Whitelabel Error Page -
i know question has been asked multiple times , couldn't find answer fits.
here have created maven multi-module project in spring boot included , not sure have gone wrong.
someone please me through,its been 2 days , cant find answer.
below error getting.
whitelabel error page application has no explicit mapping /error, seeing fallback. tue nov 08 17:22:26 ist 2016 there unexpected error (type=not found, status=404). no message available
parent pom.
<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.sonic</groupid> <artifactid>sonicboot</artifactid> <version>0.0.1-snapshot</version> <packaging>pom</packaging> <modules> <module>sonicweb</module> </modules> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.3.1.release</version> <relativepath/> <!-- lookup parent repository --> </parent> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <java.version>1.8</java.version> <start-class>com.sonic.applauncher</start-class> </properties> <build> <plugins> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> </plugins> </build> </project>
module pom:
<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>com.sonic</groupid> <artifactid>sonicboot</artifactid> <version>0.0.1-snapshot</version> </parent> <artifactid>sonicweb</artifactid> <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> </project>
bottlauncherapp.java
package com.sonic.applauncher; import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplication public class bootlauncher { public static void main(string[] args) throws exception { springapplication.run(bootlauncher.class, args); } }
pagecontroller.java
package com.sonic.controller; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.restcontroller; @restcontroller public class pagecontroller { @requestmapping("/index") public string index(){ return "home"; } }
even had same issue.just annotate @componentscan("com.sonic").
this should work!!
Comments
Post a Comment