Spring boot error:java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy -
Spring boot error:java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy -
i want utilize spring boot start application ,but after add together relative jar @ pom.xml,it homecoming error:and give thanks may caused conflict jars?
application.java
package com.mm.application; import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.enableautoconfiguration; import org.springframework.context.applicationcontext; import org.springframework.context.annotation.bean; import org.springframework.context.annotation.componentscan; import org.springframework.context.annotation.configuration; import org.springframework.context.support.classpathxmlapplicationcontext; import org.springframework.web.servlet.view.internalresourceviewresolver; @componentscan("com.mm.controller") @configuration @enableautoconfiguration public class application { public static void main(string[] args) { //spring properties xml applicationcontext context = new classpathxmlapplicationcontext( "spring-module.xml"); springapplication.run(application.class, args); } @bean public internalresourceviewresolver setupviewresolver() { internalresourceviewresolver resolver = new internalresourceviewresolver(); resolver.setprefix("/web-inf/jsp/"); resolver.setsuffix(".jsp"); homecoming resolver; } } error:
error starting applicationcontext. display auto-configuration study enabled debug logging (start --debug) exception in thread "main" org.springframework.beans.factory.beancreationexception: error creating bean name 'requestmappinghandlermapping' defined in class path resource [org/springframework/web/servlet/config/annotation/delegatingwebmvcconfiguration.class]: invocation of init method failed; nested exception java.lang.arraystoreexception: sun.reflect.annotation.typenotpresentexceptionproxy atorg.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1553) atorg.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:539) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:475) atorg.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:304) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:228) atorg.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:300) atorg.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:195) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:703) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:760) atorg.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:482) atorg.springframework.boot.context.embedded.embeddedwebapplicationcontext.refresh(embeddedwebapplicationcontext.java:120) @ org.springframework.boot.springapplication.refresh(springapplication.java:648) @ org.springframework.boot.springapplication.run(springapplication.java:311) @ org.springframework.boot.springapplication.run(springapplication.java:909) @ org.springframework.boot.springapplication.run(springapplication.java:898) @ com.mm.application.application.main(application.java:20) main problem:
caused by: java.lang.arraystoreexception:sun.reflect.annotation.typenotpresentexceptionproxy atsun.reflect.annotation.annotationparser.parseclassarray(annotationparser.java:673) @ sun.reflect.annotation.annotationparser.parsearray(annotationparser.java:480) atsun.reflect.annotation.annotationparser.parsemembervalue(annotationparser.java:306) atsun.reflect.annotation.annotationparser.parseannotation(annotationparser.java:241) atsun.reflect.annotation.annotationparser.parseannotations2(annotationparser.java:88) atsun.reflect.annotation.annotationparser.parseannotations(annotationparser.java:70) @ java.lang.class.initannotationsifnecessary(class.java:3178) @ java.lang.class.initannotationsifnecessary(class.java:3185) @ java.lang.class.getdeclaredannotations(class.java:3166) atorg.springframework.core.annotation.annotationutils.isannotationdeclaredlocally(annotationutils.java:395) atorg.springframework.core.annotation.annotationutils.findannotation(annotationutils.java:281) atorg.springframework.core.annotation.annotationutils.findannotation(annotationutils.java:265) atorg.springframework.web.servlet.mvc.method.annotation.requestmappinghandlermapping.ishandler(requestmappinghandlermapping.java:173) atorg.springframework.web.servlet.handler.abstracthandlermethodmapping.inithandlermethods(abstracthandlermethodmapping.java:123) atorg.springframework.web.servlet.handler.abstracthandlermethodmapping.afterpropertiesset(abstracthandlermethodmapping.java:103) atorg.springframework.web.servlet.mvc.method.annotation.requestmappinghandlermapping.afterpropertiesset(requestmappinghandlermapping.java:126) atorg.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1612) atorg.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1549) ... 15 more pom.xml
<parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.0.1.release</version> </parent> <properties> <start-class>com.kdubb.springboot.application</start-class> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <repositories> <repository> <id>spring-milestones</id> <name>spring milestones</name> <url>http://repo.spring.io/libs-milestone</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>spring-snapshots</id> <name>spring snapshots</name> <url>http://repo.spring.io/libs-snapshot</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginrepositories> <pluginrepository> <id>spring-milestones</id> <name>spring milestones</name> <url>http://repo.spring.io/libs-milestone</url> <snapshots> <enabled>true</enabled> </snapshots> </pluginrepository> <pluginrepository> <id>spring-snapshots</id> <name>spring snapshots</name> <url>http://repo.spring.io/libs-snapshot</url> <snapshots> <enabled>true</enabled> </snapshots> </pluginrepository> </pluginrepositories> <build> <plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> </plugins> </build> <dependencies> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>5.0.4</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context</artifactid> <version>4.0.0.release</version> </dependency> <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</groupid> <artifactid>spring-dao</artifactid> <version>2.0.8</version> </dependency> <dependency> <groupid>org.apache.tomcat.embed</groupid> <artifactid>tomcat-embed-jasper</artifactid> <scope>provided</scope> </dependency> <dependency> <groupid>javax.servlet</groupid> <artifactid>jstl</artifactid> </dependency> </dependencies> logincontroller
package com.mm.controller; import org.springframework.stereotype.component; import org.springframework.stereotype.controller; import org.springframework.ui.model; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; @controller @component public class logincontroller { @requestmapping(value = "/creditrating", method = requestmethod.get) public string index(model model) { model.addattribute("wisdom", "goodbye xml"); // renders /web-inf/jsp/login.jsp homecoming "login"; } @requestmapping(value = "/creditrating/gologin") public string login(model model) { model.addattribute("wisdom", "goodbye xml"); // renders /web-inf/jsp/index.jsp homecoming "index"; } } spring-mvc spring-boot
Comments
Post a Comment