java - Could not find or load main class BasicApp.Application -
i new spring boot , trying create basic application on spring boot. but, getting error while creating application.
could not find or load main class basicapp.application
my application having 2 classes 1 controller
class , 1 main
class. here code:
application.java
package basicapp; import org.springframework.boot.springapplication; public class application { public static void main(string[] args) { springapplication.run(application.class, args); } }
maincontroller.java
package basicapp; import org.springframework.boot.autoconfigure.enableautoconfiguration; import org.springframework.stereotype.controller; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.responsebody; @controller @enableautoconfiguration public class maincontroller { @requestmapping("/send") @responsebody public string sendmessage() { return("m sending message"); } }
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>springbootsecond</groupid> <artifactid>springbootsecond</artifactid> <version>0.0.1-snapshot</version> <properties> <!-- spring version --> <spring-framework.version>4.1.0.release</spring-framework.version> <!-- activemq version --> <activemq.version>5.10.0</activemq.version> </properties> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.3.2.release</version> </parent> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> <version>1.3.2.release</version> </dependency> <!-- spring aritifacts --> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context</artifactid> <version>4.2.0.release</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-jms</artifactid> <version>4.2.4.release</version> </dependency> <!-- activemq artifacts --> <dependency> <groupid>org.apache.activemq</groupid> <artifactid>activemq-spring</artifactid> <version>${activemq.version}</version> </dependency> </dependencies> <!-- using jdk 1.7 compiling --> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>2.5.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build> <!-- <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.3.2.release</version> </parent> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> </dependencies> <properties> <java.version>1.8</java.version> </properties> <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>
could please me error?
put @springbootapplication annotation application class , configuration you.
Comments
Post a Comment