IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Spring Web Java Discussion :

[Spring MVC] config servlet


Sujet :

Spring Web Java

  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    130
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2007
    Messages : 130
    Par défaut [Spring MVC] config servlet
    Bonjour
    Je dev une webapps avec Spring
    voici mon erreur

    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    2007-08-03 10:22:05,514 ERROR [org.springframework.web.servlet.DispatcherServlet] - <Context initialization failed>
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'controller' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Can't resolve reference to bean 'livreServiceTarget' while setting property 'service'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'livreServiceTarget' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'livreDaoAble' of bean class [livre.LivreServiceImpl]: Bean property 'livreDaoAble' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'livreServiceTarget' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'livreDaoAble' of bean class [livre.LivreServiceImpl]: Bean property 'livreDaoAble' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    org.springframework.beans.NotWritablePropertyException: Invalid property 'livreDaoAble' of bean class [livre.LivreServiceImpl]: Bean property 'livreDaoAble' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:814)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:734)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:862)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:889)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:878)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:930)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:731)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:340)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:920)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:731)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:340)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:276)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:312)
    	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:305)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:250)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
    	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
    	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    	at java.lang.Thread.run(Thread.java:619)
    et voici mon fichier de conf
    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    	<beans>
     
    		<bean id="livre" class="livre.Livre">
    	        <property name="id" >
    				<value>1</value>
    	        </property>
    	        <property name="nom">
    	        	<value>nom</value>
    	        </property>
    	        <property name="auteur">
    	        	<value>auteur</value>
    	        </property>
        	</bean>
     
     
     
    		<bean id="controller" class="web.SpringappController">
    			<property name="livre">
    	            <ref bean="livre"/>
    	        </property>
    	        <property name="service">
                	<ref bean="livreServiceTarget"/>
            	</property>   
            </bean>
     
     
    		<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">        
    			<property name="mappings">            
    				<props>                
    					<prop key="/hello.htm">controller</prop>           
    				</props>        
    			</property>    
    		</bean>
     
     
     
    		<!-- ========================= Start of PERSISTENCE DEFINITIONS =========================-->
     
    		<!-- DataSource Definition -->
    		<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    			<property name="driverClassName">
    				<value>com.mysql.jdbc.Driver</value>
    			</property>
    			<property name="url">
    				<value>jdbc:mysql://localhost:3306/bdtest</value>
    			</property>
    			<property name="username">
    				<value>root</value>
    			</property>
    			<property name="password">
    				<value>root</value>
    			</property>
    		</bean>
     
    		<!-- Hibernate SessionFactory Definition -->
    		<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    			<property name="mappingResources">
    				<list>
    					<value>livre/livre.hbm.xml</value>
    				</list>
    			</property>
    			<property name="hibernateProperties">
    				<props>
    					<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    					<prop key="hibernate.show_sql">true</prop>
    					<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
    					<prop key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
    				</props>
    			</property>
    			<property name="dataSource">
    				<ref bean="dataSource" />
    			</property>
    		</bean>
     
    		<!-- Spring Data Access Exception Translator Defintion -->
    		<bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator">
    			<property name="dataSource">
    				<ref bean="dataSource" />
    			</property>
    		</bean>
     
    		<!-- Hibernate Template Defintion -->
    		<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
    			<property name="sessionFactory">
    				<ref bean="sessionFactory" />
    			</property>
    			<property name="jdbcExceptionTranslator">
    				<ref bean="jdbcExceptionTranslator" />
    			</property>
    		</bean>
     
    		<!-- Hibernate Transaction Manager Definition -->
    		<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    			<property name="sessionFactory">
    				<ref local="sessionFactory" />
    			</property>
    		</bean>
     
    		<!-- ========================= Start of DAO DEFINITIONS ========================= -->
     
    		<!-- TODO DAO Definition: Hibernate implementation -->
    		<bean id="livreDaoAble" class="livre.dao.LivreDaoImpl">
    			<property name="hibernateTemplate">
    				<ref bean="hibernateTemplate" />
    			</property>
    		</bean>
    		<!-- ========================= Start of SERVICE DEFINITIONS ========================= -->
     
    		<!-- TODO Service Definition -->
    		<bean id="livreServiceTarget" class="livre.LivreServiceImpl">
    			<property name="livreDaoAble">
    				<ref local="livreDaoAble" />
    			</property>
    		</bean>
     
    		<!-- Transactional proxy for the TODO Service -->
    		<bean id="livreService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    			<property name="transactionManager">
    				<ref local="transactionManager" />
    			</property>
    			<property name="target">
    				<ref local="livreServiceTarget" />
    			</property>
    			<property name="transactionAttributes">
    				<props>
    					<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
    					<prop key="save*">PROPAGATION_REQUIRED</prop>
    				</props>
    			</property>
    		</bean>
    	</beans>
    Je ne vois plus ce que je peut faire qui peut m'aider merci??

  2. #2
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    A premiere vue il rale parce que livre.LivreServiceImpl ne possède pas de
    setLivreDaoAble(LivreDaoAble dao);

    Peux tu mettre le code du service ici ?
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    130
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2007
    Messages : 130
    Par défaut
    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    package livre;
     
    import java.util.Collection;
    import org.apache.log4j.Logger;
     
    import livre.dao.LivreDaoAble;
     
    /**
     * @author Jumper
     */
    public class LivreServiceImpl implements LivreServiceAble {
     
        private LivreDaoAble livreDaoAble;
     
     
        /**
         * @param livreDaoAble
         *        The todoDao to set.
         */
        public void setLivreDao(LivreDaoAble toDoDao) {
            this.livreDaoAble = toDoDao;
        }
     
        /**
         * Constructor.
         */
        public LivreServiceImpl() {
     
        	System.out.println("lol");
        }
     
        /*
         * (non-Javadoc)
         * @see jotest.biz.bs.ToDoServiceAble#getToDo(java.lang.Long)
         */
        public Livre getLivre(Integer id) {
            return livreDaoAble.getLivre(id);
     
        }
     
        /*
         * (non-Javadoc)
         * @see jotest.biz.bs.ToDoServiceAble#saveToDo(jotest.biz.bo.ToDo)
         */
        public void saveLivre(Livre todo) {
            livreDaoAble.saveLivre(todo);
        }
     
     
     
        /*
         * (non-Javadoc)
         * @see jotest.biz.bs.ToDoServiceAble#getToDoS()
         */
        public Collection getLivreS()  {
            return this.livreDaoAble.getLivreS();
        }
     
    	public LivreDaoAble getLivreDao()
    	{
    		return livreDaoAble;
    	}
     
     
    }

  4. #4
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    Ok le problème vient de :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    <bean id="livreServiceTarget" class="livre.LivreServiceImpl">
    			<property name="livreDaoAble">
    				<ref local="livreDaoAble" />
    			</property>
    		</bean>
    Ou tu spécifie à Spring d'utiliser le setter setLivreDaoAble ( property name="livreDaoAble") mais dans ton service le setter est setLivreDao;

    Donc soit tu renomme le setter en setLivreDaoAble au niveau de la classe.
    Soit tu change ton xml en :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    <bean id="livreServiceTarget" class="livre.LivreServiceImpl">
    			<property name="livreDao">
    				<ref local="livreDaoAble" />
    			</property>
    		</bean>
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  5. #5
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    130
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2007
    Messages : 130
    Par défaut
    voici la nouvelle erreur

    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
    2007-08-03 12:26:53,203 ERROR [org.springframework.web.servlet.DispatcherServlet] - <Context initialization failed>
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'controller' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'livre' of bean class [web.SpringappController]: Bean property 'livre' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    org.springframework.beans.NotWritablePropertyException: Invalid property 'livre' of bean class [web.SpringappController]: Bean property 'livre' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:814)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:734)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:862)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:889)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:878)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:930)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:731)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:340)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:276)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:312)
    	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:305)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:250)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:219)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:111)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:211)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
    	at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3043)
    	at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:4658)
    	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
    	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
    	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
    	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
    	at java.lang.Thread.run(Thread.java:619)

  6. #6
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    C'est le meme type d'erreur ...

    Vérifie l'existence d'un setter setLivre(Livre livre) dans ton controlleur.
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  7. #7
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    130
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2007
    Messages : 130
    Par défaut
    Voici mon controlleur je ne vois pas trop quoi rajouter
    (dsl pr le temps mais je decouvre Spring)

    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
     
    package web;
     
    import java.io.IOException;
    import java.util.HashMap;
    import java.util.Map;
     
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
     
    import livre.LivreManager;
    import livre.LivreServiceImpl;
     
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.Controller;
     
    import bus.ProductManager;
     
    public class SpringappController implements org.springframework.web.servlet.mvc.Controller
    {
     
    	/** Logger for this class and subclasses */
    	protected final Log logger = LogFactory.getLog(getClass());
     
    	private ProductManager prodMan;
    	private LivreServiceImpl livreMan;
     
    	public ModelAndView handleRequest(HttpServletRequest request,
    			HttpServletResponse response) throws ServletException, IOException
    	{
    		String now = (new java.util.Date()).toString();
    		logger.info("returning hello view with " + now);
     
    		Map<String, Object> myModel = new HashMap<String, Object>();
    		myModel.put("now", now);
    		myModel.put("products", prodMan.getProducts());
    		//myModel.put("livres", livreMan.getLivreS());
     
    		return new ModelAndView("hello", "model", myModel);
    	}
     
    	public void setProductManager(ProductManager pm)
    	{
    		prodMan = pm;
    	}
     
    	public ProductManager getProductManager()
    	{
     
    		return prodMan;
    	}
     
    	public ProductManager getProdMan()
    	{
    		return prodMan;
    	}
     
    	public void setProdMan(ProductManager prodMan)
    	{
    		this.prodMan = prodMan;
    	}
     
    	// -------------------------------------------------------------//
    	// Livre //
     
    	public void setLivreManager(LivreServiceImpl pm)
    	{
    		livreMan = pm;
    	}
     
     
     
    	public LivreServiceImpl getLivreManager()
    	{
     
    		return livreMan;
    	}
     
    }

  8. #8
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    <bean id="controller" class="web.SpringappController">
    			<property name="livre">
    	            <ref bean="livre"/>
    	        </property>
    	        <property name="service">
                	<ref bean="livreServiceTarget"/>
            	</property>
    Tu défini une propriété "livre", mais il n'y a pas de setLivre ( ni de getLivre, ni même de champ Livre ) dans ton controlleur.

    Donc il est normal que spring ne puisse pas configurer la propriété 'livre' du controlleur vu qu'elle n'existe pas.

    Pour débuter, je te conseille de regarder les différents articles sur Spring présent sur developpez.com.
    Il existe aussi de très bon livres sur Spring aussi.

    N'essaie pas d'aller trop vite, essaie d'abord de comprendre le fonctionnement de base de Spring ( sans service, sans Dao ), et avance pas à pas.

    Une fois les bases du fonctionnement de Spring comprises, ca ira tout seul
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

  9. #9
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    130
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2007
    Messages : 130
    Par défaut
    J'ai deja reussit a faire un site sans DAO donc je voulais continuer mais je vais devoir peut etre revoir mes bases

  10. #10
    Membre confirmé
    Profil pro
    Inscrit en
    Avril 2007
    Messages
    130
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Avril 2007
    Messages : 130
    Par défaut
    Ca y est tout marche
    Merci pr tes conseils et le temps consacré
    a plus

  11. #11
    Membre du Club
    Inscrit en
    Octobre 2008
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 8
    Par défaut
    Bonjour,
    j'ai une erreur similaire mais j'ai bien vérifié mes beans pas à pas, rien n'y fait, je ne trouve pas d'où provient l'exception.
    Ci-dessous je posterais mon code, j'espère avoir de l'aide le plutôt possible.

    je bloque dessus depui 2 jours déjà et j'ai l'impression que c'est juste un détail qui me passe sous le nez!

    voici mon fichier application-context-service.xml
    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
    42
    43
    44
    45
    46
    47
    48
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
        "http://www.springframework.org/dtd/spring-beans.dtd">
     
    <beans>
    	<bean id="lookupManager"
    		class="com.commons.tw.spring.service.util.LookupManagerImpl">
    		<property name="lookupDao" ref="lookupDao" />
    	</bean>
     
    	<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
    	<bean id="transactionManager"
    		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    		<property name="sessionFactory" ref="sessionFactory" />
    	</bean>
     
     
    	<!-- Generic manager that can be used to do basic CRUD operations on any objects -->
    	<bean id="manager" parent="txProxyTemplate">
    		<property name="target">
    			<bean
    				class="com.commons.tw.spring.service.util.BaseManager">
    				<property name="dao" ref="dao" />
    			</bean>
    		</property>
    	</bean>
    	<bean id="txProxyTemplate" abstract="true"
    		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager" ref="transactionManager" />
    		<property name="transactionAttributes">
    			<props>
    				<prop key="save*">PROPAGATION_REQUIRED</prop>
    				<prop key="remove*">PROPAGATION_REQUIRED</prop>
    				<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
    			</props>
    		</property>
    	</bean>
     
     
    	<bean id="LocaliteManager" parent="txProxyTemplate">
    		<property name="target">
    			<bean
    				class="com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl">
    				<property name="LocaliteDAO" ref="localiteDAO" />
    			</bean>
    		</property>
    	</bean>
    </beans>
    voici ma classe LocaliteManagerImpl:
    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
    public class LocaliteManagerImpl extends BaseManager implements LocaliteManager{
    	LocaliteDAO localiteDao;
     
     
     
    	public LocaliteDAO getLocaliteDao() {
    		return localiteDao;
    	}
     
    	public void setLocaliteDao(LocaliteDAO localiteDao) {
    		this.localiteDao = localiteDao;
    	}
     
    	public Localite getLocalite(int id){
    		Localite loc=null;
    		loc.setId(id);
    		loc.setDescri(localiteDao.get(id).getDescri());
    		loc.setNomLoc(localiteDao.get(id).getNomLoc());
    		return loc;
    	};
     
    	public List getListLocalite(){
    		List listLocalite = new ArrayList();
            listLocalite=localiteDao.findAll();
            return listLocalite;
    	};
     
    	public void saveLocalite(Localite lct){
    		 localiteDao.saveOrUpdate(lct);
    	};
    }
    voici mon fichier applicationContext-hibernate
    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
        "http://www.springframework.org/dtd/spring-beans.dtd">
     
    <beans>
    	<!--  ressources  -->
     
     
    	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <property name="driverClassName" value="org.postgresql.Driver"/>
             <property name="url" value="jdbc:postgresql://localhost:5432/fleetManagement"/>
            <property name="username" value="user"/>
            <property name="password" value="pwd"/>
            <property name="maxActive" value="100"/>
            <property name="maxIdle" value="30"/>
            <property name="maxWait" value="1000"/>
            <property name="defaultAutoCommit" value="true"/>
            <property name="removeAbandoned" value="true"/>
            <property name="removeAbandonedTimeout" value="60"/>
        </bean>
    	<!--  Hibernate -->
    	<bean id="sessionFactory"
    		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    		<property name="dataSource" ref="dataSource" />
    		<property name="mappingResources">
    			<list>
    <value>/com/tw/fleetManagement/model/Localite.hbm</value>
    			</list>
    		</property>
     
    		<property name="hibernateProperties">
    			<props>
    				<!-- to override, use the "SpringHibernateProperties" snippet in your project -->
    				<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
    				 <!-- Create/update the database tables automatically when the JVM starts up >
                     <prop key="hibernate.hbm2ddl.auto">update</prop-->
     
                    <!-- Turn batching off for better error messages under PostgreSQL -->
                    <prop key="hibernate.jdbc.batch_size">0</prop> 
     
                    <!-- 
                    <prop key="hibernate.show_sql">true</prop>-->
    			</props>
    		</property>
    	</bean>
     
    	<bean id="jdbcTemplate"
    		class="org.springframework.jdbc.core.JdbcTemplate">
    		<constructor-arg>
    			<ref bean="dataSource" />
    		</constructor-arg>
    	</bean>
     
    	<!-- Generic Dao - can be used when doing standard CRUD-->
    	<bean id="dao" class="com.commons.tw.spring.dao.util.BaseDaoHibernate">
        	<property name="sessionFactory" ref="sessionFactory"/>
    	</bean>
     
     
    	<!-- LookupDao: Hibernate implementation -->
    	<bean id="lookupDao" class="com.commons.tw.spring.dao.util.LookupDaoHibernate">
        	<property name="sessionFactory" ref="sessionFactory"/>
    	</bean>
     
     
     
    	<bean id="localiteDAO" class="com.tw.fleetManagement.model.dao.LocaliteDAO">
    		<property name="sessionFactory"><ref local="sessionFactory"/></property>		
    	</bean>
     
     
     
    </beans>
    Merci pour votre aide

  12. #12
    Membre du Club
    Inscrit en
    Octobre 2008
    Messages
    8
    Détails du profil
    Informations forums :
    Inscription : Octobre 2008
    Messages : 8
    Par défaut
    Je viens de remarqué que j'ai oublié d'introduire le code de l'erreur

    Le voici:
    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
    42
    43
     
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'LocaliteManager' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Cannot create inner bean 'com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl#cc0e01' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl#cc0e01' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'LocaliteDAO' of bean class [com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl]: Bean property 'LocaliteDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl#cc0e01' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'LocaliteDAO' of bean class [com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl]: Bean property 'LocaliteDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    org.springframework.beans.NotWritablePropertyException: Invalid property 'LocaliteDAO' of bean class [com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl]: Bean property 'LocaliteDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:670)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:572)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:737)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:764)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:753)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1057)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBeanDefinition(BeanDefinitionValueResolver.java:151)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:97)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1046)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
    	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    	at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    elle est générée lors de l'exécution de mon action (je travaile avec struts, hibernate et spring)
    voici mon action:
    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
    public class LocaliteAction extends Action{
     
    	public ActionForward execute(ActionMapping mapping, ActionForm form, 
    			HttpServletRequest request, HttpServletResponse response) throws Exception {
    			System.out.println("c bon, bellehi odhhor");
    			LocaliteForm locForm = (LocaliteForm) form;
    			try {
    				LocaliteManager  l = (LocaliteManager) FleetManagementUtil.getBean(request, LocaliteManager.managerId);
    				l.saveLocalite(locForm.getLocalite());
    			} catch (Exception e) {
    				e.printStackTrace();
    			}
     
     
     
     
     
     
    	return null;
     
        }
     
    }

    J'espère que vous pourrez m'aider

  13. #13
    Membre averti
    Homme Profil pro
    Développeur blockchain
    Inscrit en
    Avril 2003
    Messages
    20
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur blockchain
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2003
    Messages : 20
    Par défaut
    Citation Envoyé par bootprog Voir le message
    Je viens de remarqué que j'ai oublié d'introduire le code de l'erreur

    Le voici:
    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
    42
    43
     
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'LocaliteManager' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Cannot create inner bean 'com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl#cc0e01' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl#cc0e01' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'LocaliteDAO' of bean class [com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl]: Bean property 'LocaliteDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl#cc0e01' defined in ServletContext resource [/WEB-INF/applicationContext-service.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'LocaliteDAO' of bean class [com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl]: Bean property 'LocaliteDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    org.springframework.beans.NotWritablePropertyException: Invalid property 'LocaliteDAO' of bean class [com.tw.fleetManagement.serviceImpl.LocaliteManagerImpl]: Bean property 'LocaliteDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:670)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:572)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:737)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:764)
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:753)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1057)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBeanDefinition(BeanDefinitionValueResolver.java:151)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:97)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1046)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
    	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    	at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    elle est générée lors de l'exécution de mon action (je travaile avec struts, hibernate et spring)
    voici mon action:
    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
    public class LocaliteAction extends Action{
     
    	public ActionForward execute(ActionMapping mapping, ActionForm form, 
    			HttpServletRequest request, HttpServletResponse response) throws Exception {
    			System.out.println("c bon, bellehi odhhor");
    			LocaliteForm locForm = (LocaliteForm) form;
    			try {
    				LocaliteManager  l = (LocaliteManager) FleetManagementUtil.getBean(request, LocaliteManager.managerId);
    				l.saveLocalite(locForm.getLocalite());
    			} catch (Exception e) {
    				e.printStackTrace();
    			}
     
     
     
     
     
     
    	return null;
     
        }
     
    }

    J'espère que vous pourrez m'aider
    Dans ton code où se trouve le bean ref="localiteDAO" ?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Servlet 3.0] Comment déclarer le dispatcher Spring MVC ?
    Par verbose dans le forum Servlets/JSP
    Réponses: 3
    Dernier message: 29/09/2013, 18h03
  2. Réponses: 9
    Dernier message: 18/04/2008, 14h56
  3. Réponses: 1
    Dernier message: 05/01/2008, 13h58
  4. [Débat] Spring MVC versus Struts
    Par alheim dans le forum Frameworks Web
    Réponses: 6
    Dernier message: 19/12/2005, 10h13
  5. [Spring MVC] Formulaire dynamique
    Par partyboy dans le forum Spring Web
    Réponses: 7
    Dernier message: 17/10/2005, 10h52

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo