Spring MVC kein default-Konstruktor gefunden?

Ich habe Probleme mit meinen Spring Controller - ich bekomme keinen default-Konstruktor gefunden - aber Sie haben einen Konstruktor, der ich versuche über die applicationContext.xml - hier ist das entsprechende bit:

<bean id="PcrfSimulator" class="com.rory.services.pcrf.simulator.PcrfSimulator" init-method="start">  
</bean>

<bean id="CacheHandler" class="com.rory.services.pcrf.simulator.handlers.CacheHandler">
    <constructor-arg index="0" type="com.rory.services.pcrf.simulator.CustomGxSessionIdCacheImpl">
        <bean factory-bean="PcrfSimulator" factory-method="getGxSessionIdCache">
        </bean>
    </constructor-arg>       
</bean>

Ie. Ich bin momentan dabei, eine Bohne zuerst, und dann zu versuchen, übergeben Sie das Ergebnis des Aufrufs einer Methode aus, die Bohne in die zweite Bohne (CacheHandler) - Konstruktor.

Hier ' E start CacheHandler:

    @Controller
    public class CacheHandler {

    private final CustomGxSessionIdCacheImpl gxSessionIdCache;

    public CacheHandler(CustomGxSessionIdCacheImpl gxSessionIdCache) {
        this.gxSessionIdCache = gxSessionIdCache;
    }

Hier ist der Fehler, die ich immer bin:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheHandler' defined in URL [jar:file:/users/rtorney/Documents/apache-tomcat-7.0.25/webapps/PCRFSimulator-4.0/WEB-INF/lib/PCRFSimulator-4.0.jar!/com/rory/services/pcrf/simulator/handlers/CacheHandler.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.rory.services.pcrf.simulator.handlers.CacheHandler]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.rory.services.pcrf.simulator.handlers.CacheHandler.<init>()

Jede Hilfe ist sehr willkommen!

InformationsquelleAutor der Frage Rory | 2012-02-15

Schreibe einen Kommentar