Sto usando Spring 3.1. La guerra non viene costruita usando Maven. È solo una build normale. Ho sotto i barattoli nel mio percorso di classe.CGLIB è necessario per elaborare le classi @Configuration
antlr-runtime-3.0.1.jar
commons-logging-1.1.1.jar
org.apache.commons.logging.jar
org.springframework.aop-3.1.0.M2.jar
org.springframework.asm-3.1.0.M2.jar
org.springframework.aspects-3.1.0.M2.jar
org.springframework.beans-3.1.0.M2.jar
org.springframework.context-3.1.0.M2.jar
org.springframework.context.support-3.1.0.M2.jar
org.springframework.core-3.1.0.M2.jar
org.springframework.core-3.1.0.RELEASE.jar
org.springframework.core.jar
org.springframework.expression-3.1.0.M2.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
ho seguito il codice,
@Configuration
public class AppConfig {
@Bean(name="helloBean")
public HelloWorld helloWorld()
{
return new HelloWorldImpl();
}
}
Quando eseguo main
metodo, sto ottenendo sotto eccezione
Exception in thread "main" java.lang.IllegalStateException: CGLIB is required to process @Configuration classes. Either add CGLIB to the classpath or remove the following @Configuration bean definitions: [appConfig]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:297)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigurationClasses(ConfigurationClassPostProcessor.java:200)
Per ovviare a questo, se aggiungo cglib-2.1.jar
, che ottiene sotto eccezione.
java.lang.ClassNotFoundException: org.objectweb.asm.Type
Per superare questo, se aggiungo asm3.1.jar
, sto ottenendo sotto eccezione.
java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.
Come posso vincere la mia eccezione iniziale - CGLIB is required to process @Configuration classes ?
Forse un duplicato di http://stackoverflow.com/questions/2432471/error-java-lang-nosuchmethoderror-org-objectweb-asm-classwriter-initiv –