AM को संसाधित करने की आवश्यकता है। युद्ध मेवेन का उपयोग नहीं किया गया है। यह सिर्फ एक सामान्य निर्माण है। मेरे पास मेरे वर्ग पथ में जार से नीचे है।CGLIB को वसंत 3.1 का उपयोग कर @ कॉन्फ़िगरेशन कक्षा
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
मैं कोड के नीचे है,
@Configuration
public class AppConfig {
@Bean(name="helloBean")
public HelloWorld helloWorld()
{
return new HelloWorldImpl();
}
}
जब मैं main
विधि चलाते हैं, तो अपवाद
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)
नीचे हो रही है इस पर काबू पाने के लिए, अगर मैं cglib-2.1.jar
जोड़ने के लिए, अपवाद नीचे हो रही है।
java.lang.ClassNotFoundException: org.objectweb.asm.Type
इससे निपटने के लिए, यदि मैं asm3.1.jar
जोड़ता हूं, तो अपवाद नीचे आ रहा हूं।
java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.
मैं अपने प्रारंभिक अपवाद कैसे दूर कर सकते हैं - CGLIB is required to process @Configuration classes ?
संभवतः http://stackoverflow.com/questions/2432471/error-java-lang-nosuchmethoderror-org-objectweb-asm-classwriter-initiv –