Hi,
I am trying to write a simple application with spring (which is in Spring in Action book)but i get the following error:
Loading XML bean definitions from class path resource [aoptest/mrt/knight/knight.xml]
Bean factory for application context [org.springframework.context.support.ClassPathXmlAp plicationContext;hashCode=1607032777]: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [quest,knightTarget,mintrel,knight]; root of BeanFactory hierarchy
4 beans defined in application context [org.springframework.context.support.ClassPathXmlAp plicationContext;hashCode=1607032777]
Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.StaticMessageS ource: {}]
Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicatio nEventMulticaster@56cc56cc]
Refreshing listeners
Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [quest,knightTarget,mintrel,knight]; root of BeanFactory hierarchy]
Creating shared instance of singleton bean 'quest'
Creating shared instance of singleton bean 'knightTarget'
Bean 'knightTarget' instantiated via constructor [public aoptest.mrt.knight.KnightOfTheRoundTable(java.lang .String)]
Creating shared instance of singleton bean 'mintrel'
Creating shared instance of singleton bean 'knight'
Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory defining beans [quest,knightTarget,mintrel,knight]; root of BeanFactory hierarchy}
Destroying inner beans in factory {org.springframework.beans.factory.support.Default ListableBeanFactory defining beans [quest,knightTarget,mintrel,knight]; root of BeanFactory hierarchy}
SRVE0068E: Could not invoke the service() method on servlet Mrb. Exception thrown : org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'knight' defined in class path resource [aoptest/mrt/knight/knight.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptions Exception: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.MethodInvocationExceptio n: Property 'proxyInterfaces' threw exception; nested exception is java.lang.ClassNotFoundException: aoptest.mrt.knight.Knight]
I am definitely sure ( :evil: ) the interface Knight is in the aoptest.mrt.knight package
the knight beans definition in xml file:
<bean id="knight" class="org.springframework.aop.framework.ProxyFact oryBean">
<property name="interceptorNames">
<list>
<value>
aoptest.mrt.knight.MinstrelAdvice
</value>
</list>
</property>
<property name="proxyInterfaces">
<value>
aoptest.mrt.knight.Knight
</value>
</property>
<property name="target">
<ref bean="knightTarget"/>
</property>
</bean>
And the servlet code is: (I also tried to execute this code with a simple Java application then i got the same error.)
ApplicationContext context = new ClassPathXmlApplicationContext("/aoptest/mrt/knight/knight.xml");
try {
Knight knight = (Knight)context.getBean("knight");
knight.embarkOnQuest();
} catch (Exception e) {
e.printStackTrace();
}
Platform: Windows XP and Eclipse 3
Thanx everyone.
Murat HAZER


Reply With Quote