Démarage d'une application sous tomcat
Bonjour,
J'ai un souci avec un Listner qui n'arrive à démarrer, je m'explique :
Je suis entraine de suivre un tutorial sur Spring MVC et Hibernate, le context de l'application(un fichier applicationContext.xml qui definisse les beans à charger) doit être démarrer via un Listner mais le probléme c'est que ce Listner n'arrive pas lui aussi de démarrer
voilà Mon fichier web.xml
Code:
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
| <?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/war/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- The dispatcher that will control all our requests -->
<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- all requests terminated by .htm will be controlled by the dispatcher above-->
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<!-- Declaration of my welcome page -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/WEB-INF/tld/spring-form.tld</taglib-location>
</taglib>
</jsp-config>
</web-app> |
et voilà mon fichier applicationContext.xml:
Code:
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
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<!-- a dao bean -->
<bean id="userDao" class="springapp.dao.UserDaoImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- a business bean -->
<bean id="userManager" class="springapp.service.UserManagerImpl">
<property name="userDao">
<ref bean="userDaoTarget" />
</property>
</bean>
<!-- the session factory for the dao bean inheriting from HibernateDaoSupport-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
</bean>
<!-- declaration of the transaction -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- declaration of the general proxy for transaction that the all transactional beans must inherit from -->
<bean id="transactionProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED, readOnly</prop>
</props>
</property>
</bean>
<!-- making the dao as a transactional bean -->
<bean id="userDaoTarget" parent="transactionProxy">
<property name="target">
<ref bean="userDao"/>
</property>
<property name="transactionAttributeSource">
<bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>
</property>
</bean>
</beans> |
et Voilà la trace de demarrage de tomcat (Sous Linux Mandriva):
Code:
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
| 11 mars 2009 14:41:53 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
11 mars 2009 14:41:54 org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initialisation de Coyote HTTP/1.1 sur http-8080
11 mars 2009 14:41:54 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1398 ms
11 mars 2009 14:41:54 org.apache.catalina.core.StandardService start
INFO: Démarrage du service Catalina
11 mars 2009 14:41:54 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.27
11 mars 2009 14:41:54 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
11 mars 2009 14:41:55 org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/opt/tomcat/webapps/springapp/WEB-INF/lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
11 mars 2009 14:41:56 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
11 mars 2009 14:41:56 org.apache.catalina.core.StandardContext start
GRAVE: Erreur de démarrage du contexte [/springapp] suite aux erreurs précédentes
11 mars 2009 14:41:57 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Démarrage de Coyote HTTP/1.1 sur http-8080
11 mars 2009 14:41:58 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
11 mars 2009 14:41:58 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/111 config=null
11 mars 2009 14:41:58 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
11 mars 2009 14:41:58 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4330 ms
~ |
Merci de votre aide