When I start my web application, I get from init():
java.lang.ClassNotFoundException:org.springframework.context.ApplicationContext
maybe I miss something I my configuration files.
In pom.xml I have this 2 spring dependencies:
[...]
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6.SEC03</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
[...]
and in Datasource.xml I have beans and listener declared:
<bean id="dataSource" destroy-method="close"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost/Rubrica" />
<property name="username" value="user" />
<property name="password" value="pass" />
</bean>
<bean id="JDBC_Spring_EntryDAO" class="net.tirasa.jdbc_spring_addressbook.JDBC_Spring_EntryDAO">
<property name="JDBC_Spring_EntryDAO" ref="JDBC_Spring_EntryDAO" />
<property name="dataSource" ref="dataSource" />
</bean>
</beans>
<listener>
<listenerclass>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
The log message switched misteriously to
class path resource [Spring-Datasource.xml] cannot be opened because it does not exist
That is good to me, since it looks like I have to put the Spring-Datasource.xml file into the right path, or I have to specify the right path in the command line
ApplicationContext context = new ClassPathXmlApplicationContext("Spring-Datasource.xml");
dataSource = (DataSource) context.getBean("JDBC_Spring_EntryDAO");