-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Alef Arendsen opened SPR-5475 and commented
If I use a factory-method without an argument, but in xml use a constructor+argument, I get quite a vague error message. Consider the following:
public aspect LoggingAspect {} // a bunch of stuff, but no constructors obviously
<bean class="com.mycompany.LoggingAspect" factory-method="aspectOf">
<constructor-arg ref="stats"/>
</bean>
Renders the following error. Can we improve this to give a hint that there no arguments in the method?? Or something similar??
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.mycompany.LoggingAspect#0' defined in class path resource [context.xml]: No matching factory method found: factory method 'aspectOf'
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:396)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:901)
Affects: 2.5.6
Attachments:
- mylyn-context.zip (254.69 kB)
- mylyn-context.zip (279.13 kB)
Referenced from: commits 351e72b