Meus amigos
estou tentando implementar exemplo utilizando o Spring.
porem estou com varias dificuldades.
nos exemplos esta acontecendo erros que nao consigo identificar. ja importei bibliotecas e td mais.
acredito que o erro esta acontecendo no config.xml, alguem pode me ajudar?
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<!--
Document : config.xml
Created on : 13 de Fevereiro de 2010, 15:53
Author : Toshiba
Description:
Purpose of the document follows.
-->
<beans>
<bean id = "gerenciadorArquivosTarget"
class = "GerenciadorArquivos"/>
<bean id = "logAdvice"
class = "LogAdvice"/>
<bean id = "gerenciadorArquivo"
class = "org.springframework.aop.framework.ProxyFactoryBean">
<property name = "interceptorNames"><list><value>notificacaoAdvice</value>
<value>logAdvice</value></list></property>
<property name = "target" ref = "gerenciadorArquivosTarget"/>
</bean>
<!--
<bean id = "gerenciadorArquivo"
class = "GerenciadorArquivos"/>
-->
<bean id="publicadorDeNoticiasBean"
class ="PublicadorDeNoticias">
<property name = "gerenciadorArquivos" ref = "gerenciadorArquivo"/>
</bean>
<bean id = "notificador"
class = "Notificador" />
<bean id = "notificacaoAdvice"
class = "NotificacaoAdvice">
<property name = "notificador" ref = "notificador"/>
</bean>
</beans>
abaixo segue o erro que esta acontecendo...
[color=red]run:
24/02/2010 11:56:08 org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@a01335: display name [org.springframework.context.support.ClassPathXmlApplicationContext@a01335]; startup date [Wed Feb 24 11:56:08 BRT 2010]; root of context hierarchy
24/02/2010 11:56:09 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [config.xml]
24/02/2010 11:56:09 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@a01335]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1037c71
24/02/2010 11:56:09 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1037c71: defining beans [gerenciadorArquivosTarget,logAdvice,gerenciadorArquivo,publicadorDeNoticiasBean,notificador,notificacaoAdvice]; root of factory hierarchy
24/02/2010 11:56:09 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1037c71: defining beans [gerenciadorArquivosTarget,logAdvice,gerenciadorArquivo,publicadorDeNoticiasBean,notificador,notificacaoAdvice]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'publicadorDeNoticiasBean' defined in class path resource [config.xml]: Cannot resolve reference to bean 'gerenciadorArquivo' while setting bean property 'gerenciadorArquivos'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gerenciadorArquivo': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/Type
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:274)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1274)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:122)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:66)
at PublicadorDeNoticias.main(PublicadorDeNoticias.java:49)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gerenciadorArquivo': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/Type
at org.springframework.beans.factory.support.AbstractBeanFactory$3.run(AbstractBeanFactory.java:1310)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1272)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:206)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:268)
... 17 more
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type
at net.sf.cglib.core.TypeUtils.parseType(TypeUtils.java:180)
at net.sf.cglib.core.KeyFactory.(KeyFactory.java:66)
at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69)
at org.springframework.aop.framework.Cglib2AopProxy.createEnhancer(Cglib2AopProxy.java:225)
at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:152)
at org.springframework.aop.framework.ProxyFactoryBean.getProxy(ProxyFactoryBean.java:351)
at org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(ProxyFactoryBean.java:306)
at org.springframework.aop.framework.ProxyFactoryBean.getObject(ProxyFactoryBean.java:232)
at org.springframework.beans.factory.support.AbstractBeanFactory$3.run(AbstractBeanFactory.java:1304)
... 23 more
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.Type
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 32 more
Java Result: 1[/color][color=green]
CONSTRUÍDO COM SUCESSO (tempo total: 0 segundos)[/color]
Abracos t+