spring boot - Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: java/nio/charset/StandardCharsets -
i created starter project spring tool suite config shown below
when run app changing of
@springbootapplication @restcontroller public class firstapplication { public static void main(string[] args) { springapplication.run(firstapplication.class, args); } @requestmapping("/greet") public string hellogreeting() { return "salam rest"; } }
it crashes saying
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: spring boot :: (v1.2.6.release) 2015-10-03 08:18:45.362 info 4100 --- [ main] c.rhcloud.arshad.demo.firstapplication : starting firstapplication on arshad pid 4100 (f:\boot-work\first\target\classes started arshay in f:\boot-work\first) 2015-10-03 08:18:45.487 info 4100 --- [ main] ationconfigembeddedwebapplicationcontext : refreshing org.springframework.boot.context.embedded.annotationconfigembeddedwebapplicationcontext@11f23e5: startup date [sat oct 03 08:18:45 pkt 2015]; root of context hierarchy 2015-10-03 08:18:46.732 info 4100 --- [ main] o.s.b.f.s.defaultlistablebeanfactory : overriding bean definition bean 'beannameviewresolver': replacing [root bean: class [null]; scope=; abstract=false; lazyinit=false; autowiremode=3; dependencycheck=0; autowirecandidate=true; primary=false; factorybeanname=org.springframework.boot.autoconfigure.web.errormvcautoconfiguration$whitelabelerrorviewconfiguration; factorymethodname=beannameviewresolver; initmethodname=null; destroymethodname=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/errormvcautoconfiguration$whitelabelerrorviewconfiguration.class]] [root bean: class [null]; scope=; abstract=false; lazyinit=false; autowiremode=3; dependencycheck=0; autowirecandidate=true; primary=false; factorybeanname=org.springframework.boot.autoconfigure.web.webmvcautoconfiguration$webmvcautoconfigurationadapter; factorymethodname=beannameviewresolver; initmethodname=null; destroymethodname=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/webmvcautoconfiguration$webmvcautoconfigurationadapter.class]] 2015-10-03 08:18:48.387 warn 4100 --- [ main] ationconfigembeddedwebapplicationcontext : exception encountered during context initialization - cancelling refresh attempt org.springframework.context.applicationcontextexception: unable start embedded container; nested exception java.lang.noclassdeffounderror: java/nio/charset/standardcharsets @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.onrefresh(embeddedwebapplicationcontext.java:133) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:474) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.refresh(embeddedwebapplicationcontext.java:118) @ org.springframework.boot.springapplication.refresh(springapplication.java:687) @ org.springframework.boot.springapplication.run(springapplication.java:321) @ org.springframework.boot.springapplication.run(springapplication.java:967) @ org.springframework.boot.springapplication.run(springapplication.java:956) @ com.rhcloud.arshad.demo.firstapplication.main(firstapplication.java:13) caused by: java.lang.noclassdeffounderror: java/nio/charset/standardcharsets @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:331) @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:307) @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:292) @ org.apache.catalina.core.standardcontext.addservletmapping(standardcontext.java:3073) @ org.apache.catalina.core.standardcontext.addservletmapping(standardcontext.java:3050) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.adddefaultservlet(tomcatembeddedservletcontainerfactory.java:199) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.preparecontext(tomcatembeddedservletcontainerfactory.java:174) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.getembeddedservletcontainer(tomcatembeddedservletcontainerfactory.java:154) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.createembeddedservletcontainer(embeddedwebapplicationcontext.java:157) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.onrefresh(embeddedwebapplicationcontext.java:130) ... 7 common frames omitted caused by: java.lang.classnotfoundexception: java.nio.charset.standardcharsets @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 17 common frames omitted 2015-10-03 08:18:48.391 info 4100 --- [ main] .b.l.classpathloggingapplicationlistener : application failed start classpath: [file:/f:/boot-work/first/target/classes/, file:/f:/boot-work/first/target/test-classes/, file:/c:/users/arshay/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.2.6.release/spring-boot-starter-web-1.2.6.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/boot/spring-boot-starter/1.2.6.release/spring-boot-starter-1.2.6.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/boot/spring-boot/1.2.6.release/spring-boot-1.2.6.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.2.6.release/spring-boot-autoconfigure-1.2.6.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.2.6.release/spring-boot-starter-logging-1.2.6.release.jar, file:/c:/users/arshay/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.12/jcl-over-slf4j-1.7.12.jar, file:/c:/users/arshay/.m2/repository/org/slf4j/slf4j-api/1.7.12/slf4j-api-1.7.12.jar, file:/c:/users/arshay/.m2/repository/org/slf4j/jul-to-slf4j/1.7.12/jul-to-slf4j-1.7.12.jar, file:/c:/users/arshay/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.12/log4j-over-slf4j-1.7.12.jar, file:/c:/users/arshay/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar, file:/c:/users/arshay/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar, file:/c:/users/arshay/.m2/repository/org/yaml/snakeyaml/1.14/snakeyaml-1.14.jar, file:/c:/users/arshay/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.2.6.release/spring-boot-starter-tomcat-1.2.6.release.jar, file:/c:/users/arshay/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.26/tomcat-embed-core-8.0.26.jar, file:/c:/users/arshay/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.26/tomcat-embed-el-8.0.26.jar, file:/c:/users/arshay/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.26/tomcat-embed-logging-juli-8.0.26.jar, file:/c:/users/arshay/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.26/tomcat-embed-websocket-8.0.26.jar, file:/c:/users/arshay/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.4.6/jackson-databind-2.4.6.jar, file:/c:/users/arshay/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.4.6/jackson-annotations-2.4.6.jar, file:/c:/users/arshay/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.4.6/jackson-core-2.4.6.jar, file:/c:/users/arshay/.m2/repository/org/hibernate/hibernate-validator/5.1.3.final/hibernate-validator-5.1.3.final.jar, file:/c:/users/arshay/.m2/repository/javax/validation/validation-api/1.1.0.final/validation-api-1.1.0.final.jar, file:/c:/users/arshay/.m2/repository/org/jboss/logging/jboss-logging/3.1.3.ga/jboss-logging-3.1.3.ga.jar, file:/c:/users/arshay/.m2/repository/com/fasterxml/classmate/1.0.0/classmate-1.0.0.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-core/4.1.7.release/spring-core-4.1.7.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-web/4.1.7.release/spring-web-4.1.7.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-aop/4.1.7.release/spring-aop-4.1.7.release.jar, file:/c:/users/arshay/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-beans/4.1.7.release/spring-beans-4.1.7.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-context/4.1.7.release/spring-context-4.1.7.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-webmvc/4.1.7.release/spring-webmvc-4.1.7.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-expression/4.1.7.release/spring-expression-4.1.7.release.jar, file:/c:/users/arshay/.m2/repository/org/springframework/boot/spring-boot-starter-test/1.2.6.release/spring-boot-starter-test-1.2.6.release.jar, file:/c:/users/arshay/.m2/repository/junit/junit/4.12/junit-4.12.jar, file:/c:/users/arshay/.m2/repository/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.jar, file:/c:/users/arshay/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar, file:/c:/users/arshay/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar, file:/c:/users/arshay/.m2/repository/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar, file:/c:/users/arshay/.m2/repository/org/springframework/spring-test/4.1.7.release/spring-test-4.1.7.release.jar] 2015-10-03 08:18:48.393 error 4100 --- [ main] o.s.boot.springapplication : application startup failed org.springframework.context.applicationcontextexception: unable start embedded container; nested exception java.lang.noclassdeffounderror: java/nio/charset/standardcharsets @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.onrefresh(embeddedwebapplicationcontext.java:133) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:474) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.refresh(embeddedwebapplicationcontext.java:118) @ org.springframework.boot.springapplication.refresh(springapplication.java:687) @ org.springframework.boot.springapplication.run(springapplication.java:321) @ org.springframework.boot.springapplication.run(springapplication.java:967) @ org.springframework.boot.springapplication.run(springapplication.java:956) @ com.rhcloud.arshad.demo.firstapplication.main(firstapplication.java:13) caused by: java.lang.noclassdeffounderror: java/nio/charset/standardcharsets @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:331) @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:307) @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:292) @ org.apache.catalina.core.standardcontext.addservletmapping(standardcontext.java:3073) @ org.apache.catalina.core.standardcontext.addservletmapping(standardcontext.java:3050) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.adddefaultservlet(tomcatembeddedservletcontainerfactory.java:199) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.preparecontext(tomcatembeddedservletcontainerfactory.java:174) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.getembeddedservletcontainer(tomcatembeddedservletcontainerfactory.java:154) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.createembeddedservletcontainer(embeddedwebapplicationcontext.java:157) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.onrefresh(embeddedwebapplicationcontext.java:130) ... 7 common frames omitted caused by: java.lang.classnotfoundexception: java.nio.charset.standardcharsets @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 17 common frames omitted exception in thread "main" org.springframework.context.applicationcontextexception: unable start embedded container; nested exception java.lang.noclassdeffounderror: java/nio/charset/standardcharsets @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.onrefresh(embeddedwebapplicationcontext.java:133) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:474) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.refresh(embeddedwebapplicationcontext.java:118) @ org.springframework.boot.springapplication.refresh(springapplication.java:687) @ org.springframework.boot.springapplication.run(springapplication.java:321) @ org.springframework.boot.springapplication.run(springapplication.java:967) @ org.springframework.boot.springapplication.run(springapplication.java:956) @ com.rhcloud.arshad.demo.firstapplication.main(firstapplication.java:13) caused by: java.lang.noclassdeffounderror: java/nio/charset/standardcharsets @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:331) @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:307) @ org.apache.tomcat.util.buf.udecoder.urldecode(udecoder.java:292) @ org.apache.catalina.core.standardcontext.addservletmapping(standardcontext.java:3073) @ org.apache.catalina.core.standardcontext.addservletmapping(standardcontext.java:3050) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.adddefaultservlet(tomcatembeddedservletcontainerfactory.java:199) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.preparecontext(tomcatembeddedservletcontainerfactory.java:174) @ org.springframework.boot.context.embedded.tomcat.tomcatembeddedservletcontainerfactory.getembeddedservletcontainer(tomcatembeddedservletcontainerfactory.java:154) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.createembeddedservletcontainer(embeddedwebapplicationcontext.java:157) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.onrefresh(embeddedwebapplicationcontext.java:130) ... 7 more caused by: java.lang.classnotfoundexception: java.nio.charset.standardcharsets @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) ... 17 more
what wrong this.
seems, use wrong jre run application. make sure, running java version 1.7 or above, if run via ide. standardcharsets, due java docs, available since version 1.7.
Comments
Post a Comment