i working on maven project every time try deploy war exception below:
error [dispatcherportlet:276] context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.context.weaving.aspectjweavingenabler#0': initialization of bean failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'loadtimeweaver': initialization of bean failed; nested exception java.lang.illegalstateexception: classloader [org.apache.catalina.loader.webappclassloader] not provide 'addtransformer(classfiletransforme r)' method. specify custom loadtimeweaver or start java virtual machine spring's agent: -javaagent:org.springframework.instrument.jar @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:527) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:456) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:294) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:225) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:291) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:197) @ org.springframework.context.support.abstractapplicationcontext.getbean(abstractapplicationcontext.java:1097) @ org.springframework.context.support.abstractapplicationcontext.invokebeanfactorypostprocessors(abstractapplicationcontext.java:661) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:446) @ org.springframework.web.portlet.frameworkportlet.createportletapplicationcontext(frameworkportlet.java:356) @ org.springframework.web.portlet.frameworkportlet.initportletapplicationcontext(frameworkportlet.java:294) @ org.springframework.web.portlet.frameworkportlet.initportletbean(frameworkportlet.java:268) @ org.springframework.web.portlet.genericportletbean.init(genericportletbean.java:120)
i don't understand when have in place why error. please checkout declaration in pom.xml
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.4</version> <configuration> <forkmode>once</forkmode> <argline> -javaagent:"path\spring-instrument-3.1.0.release.jar" </argline> <usesystemclassloader>true</usesystemclassloader> </configuration> </plugin>
please guide.
if using tomcat bundle , enable load-time-weaving
in tomcat add spring instrument tomcat tomcat's lib
directory , following in context.xml
inside meta-inf
directory of tomcat:
<context path="/test"> <loader loaderclass="org.springframework.instrument.classloading.tomcat.tomcatinstrumentableclassloader"/> </context>
refer spring docs on tomcat's configuration.
note: configuration tomcat differs based on version.
Comments
Post a Comment