spring - Error creating bean with name 'freeMarkerConfigurer' -
i have package spring boot project war maven package. when deploy tomcat have web projecting running on it, wired problem happen.i'm start learning spring boot, me issue. thx~
org.springframework.beans.factory.beancreationexception: error creating bean name 'freemarkerconfigurer' defined in class path resource [org/springframework/boot/autoconfigure/freemarker/freemarkerautoconfiguration$freemarkerwebconfiguration.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [org.springframework.web.servlet.view.freemarker.freemarkerconfigurer]: factory method 'freemarkerconfigurer' threw exception; nested exception java.lang.linkageerror: loader constraint violation in interface itable initialization: when resolving method "org.springframework.ui.freemarker.freemarkerconfigurationfactory.setresourceloader(lorg/springframework/core/io/resourceloader;)v" class loader (instance of org/apache/catalina/loader/standardclassloader) of current class, org/springframework/web/servlet/view/freemarker/freemarkerconfigurer, , class loader (instance of org/apache/catalina/loader/webappclassloader) interface org/springframework/context/resourceloaderaware have different class objects type org/springframework/core/io/resourceloader used in signature @ org.springframework.beans.factory.support.constructorresolver.instantiateusingfactorymethod(constructorresolver.java:599) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.instantiateusingfactorymethod(abstractautowirecapablebeanfactory.java:1119) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfactory.java:1014) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:504) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:476) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:303) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:299) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:755) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:757) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:480) @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.refresh(embeddedwebapplicationcontext.java:118) @ org.springframework.boot.springapplication.refresh(springapplication.java:686) @ org.springframework.boot.springapplication.run(springapplication.java:320) @ org.springframework.boot.context.web.springbootservletinitializer.run(springbootservletinitializer.java:117) @ org.springframework.boot.context.web.springbootservletinitializer.createrootapplicationcontext(springbootservletinitializer.java:108) @ org.springframework.boot.context.web.springbootservletinitializer.onstartup(springbootservletinitializer.java:68) @ org.springframework.web.springservletcontainerinitializer.onstartup(springservletcontainerinitializer.java:175) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5274) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase.addchildinternal(containerbase.java:901) @ org.apache.catalina.core.containerbase.addchild(containerbase.java:877) @ org.apache.catalina.core.standardhost.addchild(standardhost.java:633) @ org.apache.catalina.startup.hostconfig.deploywar(hostconfig.java:977) @ org.apache.catalina.startup.hostconfig$deploywar.run(hostconfig.java:1655) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:334) @ java.util.concurrent.futuretask.run(futuretask.java:166) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1110) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:603) @ java.lang.thread.run(thread.java:679) caused by: org.springframework.beans.beaninstantiationexception: failed instantiate [org.springframework.web.servlet.view.freemarker.freemarkerconfigurer]: factory method 'freemarkerconfigurer' threw exception; nested exception java.lang.linkageerror: loader constraint violation in interface itable initialization: when resolving method "org.springframework.ui.freemarker.freemarkerconfigurationfactory.setresourceloader(lorg/springframework/core/io/resourceloader;)v" class loader (instance of org/apache/catalina/loader/standardclassloader) of current class, org/springframework/web/servlet/view/freemarker/freemarkerconfigurer, , class loader (instance of org/apache/catalina/loader/webappclassloader) interface org/springframework/context/resourceloaderaware have different class objects type org/springframework/core/io/resourceloader used in signature @ org.springframework.beans.factory.support.simpleinstantiationstrategy.instantiate(simpleinstantiationstrategy.java:189) @ org.springframework.beans.factory.support.constructorresolver.instantiateusingfactorymethod(constructorresolver.java:588) ... 31 common frames omitted caused by: java.lang.linkageerror: loader constraint violation in interface itable initialization: when resolving method "org.springframework.ui.freemarker.freemarkerconfigurationfactory.setresourceloader(lorg/springframework/core/io/resourceloader;)v" class loader (instance of org/apache/catalina/loader/standardclassloader) of current class, org/springframework/web/servlet/view/freemarker/freemarkerconfigurer, , class loader (instance of org/apache/catalina/loader/webappclassloader) interface org/springframework/context/resourceloaderaware have different class objects type org/springframework/core/io/resourceloader used in signature @ org.springframework.boot.autoconfigure.freemarker.freemarkerautoconfiguration$freemarkerwebconfiguration.freemarkerconfigurer(freemarkerautoconfiguration.java:124) @ org.springframework.boot.autoconfigure.freemarker.freemarkerautoconfiguration$freemarkerwebconfiguration$$enhancerbyspringcglib$$49f80c27.cglib$freemarkerconfigurer$0(<generated>) @ org.springframework.boot.autoconfigure.freemarker.freemarkerautoconfiguration$freemarkerwebconfiguration$$enhancerbyspringcglib$$49f80c27$$fastclassbyspringcglib$$1c5632a1.invoke(<generated>) @ org.springframework.cglib.proxy.methodproxy.invokesuper(methodproxy.java:228) @ org.springframework.context.annotation.configurationclassenhancer$beanmethodinterceptor.intercept(configurationclassenhancer.java:309) @ org.springframework.boot.autoconfigure.freemarker.freemarkerautoconfiguration$freemarkerwebconfiguration$$enhancerbyspringcglib$$49f80c27.freemarkerconfigurer(<generated>) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:616) @ org.springframework.beans.factory.support.simpleinstantiationstrategy.instantiate(simpleinstantiationstrategy.java:162) ... 32 common frames omitted
pom.xml
to compatible of java 1.6, exclude several dependency.
<parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.2.3.release</version> </parent> <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-data-jpa</artifactid> <exclusions> <exclusion> <artifactid>javax.transaction-api</artifactid> <groupid>javax.transaction</groupid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.jboss.spec.javax.transaction</groupid> <artifactid>jboss-transaction-api_1.1_spec</artifactid> <version>1.0.1.final</version> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-security</artifactid> </dependency> <dependency> <groupid>com.h2database</groupid> <artifactid>h2</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-test</artifactid> </dependency> <dependency> <groupid>com.google.guava</groupid> <artifactid>guava</artifactid> <version>18.0</version> </dependency> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-thymeleaf</artifactid> </dependency> <dependency> <groupid>nekohtml</groupid> <artifactid>nekohtml</artifactid> <version>1.9.6.2</version> </dependency> <dependency> <groupid>org.webjars</groupid> <artifactid>webjars-locator</artifactid> <version>0.1</version> <exclusions> <exclusion> <artifactid>javassist</artifactid> <groupid>javassist</groupid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.thymeleaf.extras</groupid> <artifactid>thymeleaf-extras-springsecurity3</artifactid> </dependency> </dependencies> <properties> <java.version>1.6</java.version> <tomcat.version>7.0.63</tomcat.version> </properties>
Comments
Post a Comment