Bonjour,

Je travail sur un projet utilisant spring. Afin de correctement intégrer mes briques supplémentaire je tâche d'utiliser spring comme il se doit.

Je cherche à réaliser 3 injections, et voici les détails.

Classe :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
public class DocumentDAO extends GenericDAO implements IDocumentDAO {
 
    private String endPoint;
    private String login;
    private String pass;
 
    public DocumentDAO() {
        super();
    }
 
    public DocumentDAO(String endPoint, String login, String pass) {
        this.endPoint = endPoint;
        this.login = login;
        this.pass = pass;
    }
 
    public String getEndPoint() {
        return endPoint;
    }
 
    public void setEndPoint(String endPoint) {
        this.endPoint = endPoint;
    }
 
    public String getLogin() {
        return login;
    }
 
    public void setLogin(String login) {
        this.login = login;
    }
 
    public String getPass() {
        return pass;
    }
 
    public void setPass(String pass) {
        this.pass = pass;
    }
   ...
}
J'ai essayer :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
  <bean id="documentDAO" class="fr.cg95.cvq.dao.document.alfresco.DocumentDAO" parent="genericDAO">
    <constructor-arg index="0" type="java.lang.String" value="http://capdemat:8081/alfresco/api"/>
    <constructor-arg index="1" type="java.lang.String" value="admin"/>
    <constructor-arg index="2" type="java.lang.String" value="admin"/>
  </bean>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
  <bean id="documentDAO" class="fr.cg95.cvq.dao.document.alfresco.DocumentDAO" parent="genericDAO">
    <property name="endPoint" value="http://capdemat:8081/alfresco/api"/>
    <property name="login" value="admin"/>
    <property name="pass" value="admin"/>
  </bean>
Aucun d'eux ne marche oO.

L'exception soulevée avec l'injection par constructeur est la suivante :
2009-09-08 19:28:12.784::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@175b132{/CapDemat,/home/fred/capdemat/trunk/BackOfficeNG/web-app}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestAdaptorService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeFolderService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'localAuthorityRegistry' while setting bean property 'localAuthorityRegistry'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'localAuthorityRegistry' defined in URL [file:grails-app/conf/spring/applicationContext-deployment.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentTypeService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentContextCheckAspect' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'documentDAO' while setting bean property 'documentDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
at java.security.AccessController.doPrivileged(Native Method)
at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy:68)
at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy)
at Init_groovy$_run_closure6.doCall(Init_groovy:128)
at RunApp_groovy$_run_closure2.doCall(RunApp_groovy:67)
at RunApp_groovy$_run_closure2.doCall(RunApp_groovy)
at RunApp_groovy$_run_closure1.doCall(RunApp_groovy:59)
at RunApp_groovy$_run_closure1.doCall(RunApp_groovy)
at gant.Gant.dispatch(Gant.groovy:271)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:436)
at gant.Gant.processArgs(Gant.groovy:372)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeFolderService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'localAuthorityRegistry' while setting bean property 'localAuthorityRegistry'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'localAuthorityRegistry' defined in URL [file:grails-app/conf/spring/applicationContext-deployment.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentTypeService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentContextCheckAspect' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'documentDAO' while setting bean property 'documentDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
at java.security.AccessController.doPrivileged(Native Method)
... 13 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'localAuthorityRegistry' defined in URL [file:grails-app/conf/spring/applicationContext-deployment.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentTypeService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentContextCheckAspect' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'documentDAO' while setting bean property 'documentDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
at java.security.AccessController.doPrivileged(Native Method)
... 14 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentTypeService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentContextCheckAspect' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'documentDAO' while setting bean property 'documentDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
at java.security.AccessController.doPrivileged(Native Method)
at fr.cg95.cvq.service.authority.impl.LocalAuthorityRegistry.init(LocalAuthorityRegistry.java:97)
... 15 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentContextCheckAspect' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'documentDAO' while setting bean property 'documentDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
at java.security.AccessController.doPrivileged(Native Method)
at org.aspectj.util.PartialOrder$SortObject.addDirectedLinks(PartialOrder.java:68)
at org.aspectj.util.PartialOrder.addNewPartialComparable(PartialOrder.java:88)
at org.aspectj.util.PartialOrder.sort(PartialOrder.java:121)
... 17 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
at java.security.AccessController.doPrivileged(Native Method)
... 21 more
2009-09-08 19:28:12.804::WARN: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestAdaptorService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeFolderService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'localAuthorityRegistry' while setting bean property 'localAuthorityRegistry'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'localAuthorityRegistry' defined in URL [file:grails-app/conf/spring/applicationContext-deployment.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentTypeService' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentContextCheckAspect' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: Cannot resolve reference to bean 'documentDAO' while setting bean property 'documentDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities):
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentDAO' defined in URL [file:grails-app/conf/spring/applicationContext.xml]: 3 constructor arguments specified but no matching constructor found in bean 'documentDAO' (hint: specify index and/or type arguments for simple parameters to avoid type ambiguities)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
at org.aspectj.util.PartialOrder$SortObject.addDirectedLinks(PartialOrder.java:68)
at org.aspectj.util.PartialOrder.addNewPartialComparable(PartialOrder.java:88)
at org.aspectj.util.PartialOrder.sort(PartialOrder.java:121)
at java.security.AccessController.doPrivileged(Native Method)
at fr.cg95.cvq.service.authority.impl.LocalAuthorityRegistry.init(LocalAuthorityRegistry.java:97)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy:68)
at RunApp_groovy$_run_closure2_closure7.doCall(RunApp_groovy)
at Init_groovy$_run_closure6.doCall(Init_groovy:128)
at RunApp_groovy$_run_closure2.doCall(RunApp_groovy:67)
at RunApp_groovy$_run_closure2.doCall(RunApp_groovy)
at RunApp_groovy$_run_closure1.doCall(RunApp_groovy:59)
at RunApp_groovy$_run_closure1.doCall(RunApp_groovy)
at gant.Gant.dispatch(Gant.groovy:271)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:436)
at gant.Gant.processArgs(Gant.groovy:372)
Quelqu'un a une idée ?