Bonjour,
J'ai déjà réalisé quelques applications avec Spring (il y a un bout de temps) et je m'y remet cependant je tombe sur:

Cannot find class [Hello] for bean with name 'event' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: Hello

Sachant que ma classe hello ce situe à la racine de mon programme (avant j'avais un package) et le contenu du app-context.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
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
	    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
 
	<bean id="sessionFactory"
          class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" >
	<property name="dataSource" ref="dataSource" />
	</bean>
 	<bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
	    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
	    <property name="url" value="jdbc:mysql://localhost/events" />
	    <property name="username" value="root" />
	    <property name="password" value="root" />
	</bean>
 
    <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
 
    <tx:annotation-driven/>
    <!-- 
<bean id="services" class="services.Services" scope="singleton">
        <property name="sessionFactory" ref="sessionFactory"/>
 
 </bean> 
  -->
 <bean id="event" class="Hello"/>
 
</beans>