Impossible de trouver une classe avec un bean : NoClassDefFoundError
Bonjour je suis un tuto et je bloque : j'ai un probleme quand je fait le lien avec la classe associé a mon bean. Il met met init machin c'est qu'il faut que je redefinisse la methode init?
la définition de mon bean :
Code:
1 2 3 4 5 6 7
|
<!-- la classe dao -->
<bean id="dao" class="PackageDAO.DaoImplCommon">
<property name="sqlMapClient">
<ref local="sqlMapClient"/>
</property>
</bean> |
L'appel de mon bean :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
public class MainTestDaoFirebird {
public static void main(String[] args) {
ClassPathResource res = new ClassPathResource("spring-config-test-dao-firebird.xml");
IDao dao = (IDao) (new XmlBeanFactory(res)).getBean("dao");
// liste actuelle
Collection personnes = dao.getAll();
// affichage console
Iterator iter = personnes.iterator();
while (iter.hasNext()) {
System.out.println(iter.next());
}
}
} |
l'implementation de l'interface :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
package PackageDAO;
import PackageClasse.Personne;
import java.util.Collection;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
/**
*
* @author Administrateur
*/
public class DaoImplCommon extends SqlMapClientDaoSupport implements IDao {
....
} |
et l'erreur que j'obtiens :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
15 juil. 2008 05:34:56 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [spring-config-test-dao-firebird.xml]
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao' defined in class path resource [spring-config-test-dao-firebird.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [PackageDAO.DaoImplCommon]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/ibatis/sqlmap/client/SqlMapExecutor at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:917)
.....
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at test.MainTestDaoFirebird.main(MainTestDaoFirebird.java:21)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [PackageDAO.DaoImplCommon]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/ibatis/sqlmap/client/SqlMapExecutor
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:98)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:911)
... 10 more
Caused by: java.lang.NoClassDefFoundError: com/ibatis/sqlmap/client/SqlMapExecutor
at org.springframework.orm.ibatis.support.SqlMapClientDaoSupport.<init>(SqlMapClientDaoSupport.java:45)
at PackageDAO.DaoImplCommon.<init>(DaoImplCommon.java:18)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) |
Je ne vois pas trop d'ou viens le probleme exactement si quelqu'un pouvait me mettre sur la piste...