Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Spring
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Spring
Problem with the Sample Spring AOP application
Keerthi Kumar
Ranch Hand
Posts: 105
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Dear all,
I am new to spring aop and trying to execute one sample program from the net. But I am getting the below error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'businesslogicbean' defined in file [D:\kk_workspace\SpringAOP\build\springconfig.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class[]] for property 'proxyInterfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class [IBusinessLogic]. Root cause: java.lang.ClassNotFoundException: IBusinessLogic at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) 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:407) 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.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:124) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:68) at com.Spring.AOP.Demo.SpringAOPDemo.main(SpringAOPDemo.java:10) Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class[]] for property 'proxyInterfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class [IBusinessLogic]. Root cause: java.lang.ClassNotFoundException: IBusinessLogic at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:395) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1313) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1285) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ... 13 more Caused by: java.lang.IllegalArgumentException: Cannot find class [IBusinessLogic]. Root cause: java.lang.ClassNotFoundException: IBusinessLogic at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:252) at org.springframework.beans.propertyeditors.ClassArrayEditor.setAsText(ClassArrayEditor.java:66) at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:341) at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:325) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:192) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:390)
springConfig.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <!--CONFIG--> <bean id="businesslogicbean" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="proxyInterfaces"> <value>IBusinessLogic</value> </property> <property name="target"> <ref local="beanTarget"/> </property> <property name="interceptorNames"> <list> <value>theTracingBeforeAdvisor</value> <value>theTracingAfterAdvisor</value> </list> </property> </bean> <!--CLASS--> <bean id="beanTarget" class="BusinessLogic"/> <!--ADVISOR--> <!--Note: An advisor assembles pointcuts and advice--> <bean id="theTracingBeforeAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> <property name="advice"> <ref local="theTracingBeforeAdvice"/> </property> <property name="pattern"> <value>.*</value> </property> </bean> <!--ADVISOR--> <!--Note: An advisor assembles pointcuts and advice--> <bean id="theTracingAfterAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> <property name="advice"> <ref local="theTracingAfterAdvice"/> </property> <property name="pattern"> <value>.*</value> </property> </bean> <!--ADVICE--> <bean id="theTracingBeforeAdvice" class="TracingBeforeAdvice"/> <bean id="theTracingAfterAdvice" class="TracingAfterAdvice"/> </beans>
Request you all to please help me out to resolve this issue.
Thanks,
Keerthi Kumar N
Cheers,
Keerthi Kumar N
David Newton
Author
Posts: 12617
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Caused by: java.lang.IllegalArgumentException: Cannot find class [IBusinessLogic]. Root cause: java.lang.ClassNotFoundException: IBusinessLogic
Where's that class?
Keerthi Kumar
Ranch Hand
Posts: 105
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I have made an entry for IBusinessLogic (which is an interface).
Cheers,
Keerthi Kumar N
David Newton
Author
Posts: 12617
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yeah, okay, but where is it? Is it in a package? Is it being deployed? Because it's not there at runtime--that's why you're getting the error message.
Keerthi Kumar
Ranch Hand
Posts: 105
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Yes. I had defined that
java
file in the same package. Also injected in the springConfig.xml too.
Cheers,
Keerthi Kumar N
David Newton
Author
Posts: 12617
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
*What* package?
Keerthi Kumar
Ranch Hand
Posts: 105
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
It is being defined in the following package:
package com.Spring.AOP.Demo;
Cheers,
Keerthi Kumar N
David Newton
Author
Posts: 12617
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Okay, why wouldn't you use the fully-qualified class name in the Spring config? It's not going to *guess* where the class is.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Spring 3 with Hibernate error
Spring +JAX-RPC +Operation timed out
Dependency injection with Wrapper classes
Error while executing simple application with jdk1.5
[spring] aop config
More...