can't seem to have my spring webapp working with jetty-maven pluging
i always get
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Initialization of bean failed; nested exception is java.lang.IllegalStateException: ClassLoader [org.eclipse.jetty.webapp.WebAppClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:org.springframework.instrument.jar
though i have:
jvmArgs
with -javaagent:....
to jetty-maven-plugin configurationThe Jetty Maven plugin is useful for rapid development and testing. You can add it to any webapp project that is structured according to the usual Maven defaults. The plugin can then periodically scan your project for changes and automatically redeploy the webapp if any are found.
Using the Jetty Plugin enables you to quickly test your web application by skipping the last two steps. By default the Jetty Plugin scans target/classes for any changes in your Java sources and src/main/webapp for changes to your web sources.
To start a Jetty Server, you can type the following command. The only way to stop the Jetty Server is by pressing Ctrl + C in the shell prompt.
Probably you are missing few jars aspectjweaver
aspectjrt
spring-instrument
Additionally you may want to try explicitly defining the bean loadTimeWeaver
in applicationcontext.xml file.
<property name="loadTimeWeaver">
<bean id="instrumentationLoadTimeWeaver" class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
</property>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With