intellij9, spring, hibernate dao unit test error

I get this error

java.lang.NoSuchMethodError: org.springframework.transaction.interceptor.TransactionAttribute.getQualifier

when I try to run this unit test in intellij

public class DefectDaoTest extends AbstractTransactionalJUnit4SpringContextTests {
    private DefectDao defectDao;
    private SessionFactory sessionFactory;

    public void testit() throws Exception {

    public void setDefectDao(DefectDao defectDao) {
        this.defectDao = defectDao;

    public void setSessionFactory(SessionFactory factory) {
        this.sessionFactory = factory;


My context file is

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

  <bean id="dataSource" destroy-method="close">
    <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
    <property name="url" value="jdbc:hsqldb:mem:test"/>
    <property name="username" value="sa"/>
    <property name="password" value=""/>

  <bean id="sessionFactory" >
    <property name="dataSource" ref="dataSource"/>
    <property name="annotatedClasses">
    <property name="hibernateProperties">
            <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="">create</prop>

    <bean id="tx" >
      <property name="sessionFactory">
        <ref bean="sessionFactory"/>

    <bean id="defectDao" >
        <property name="sessionFactory" ref="sessionFactory"/>

Yet if I run a maven install either from within intellij or from the command line the test passes.

I have googled and there is very little about this error

Does anyone have any idea what I am missing?

Comment actions Permalink

Hi David,

That looks like classpath problem. I see that there is no TransactionAttribute.getQualifier() method at spring 2.5 and it looks like it's introduced at spring 3. So, the most probable reason is that there is a mix of spring 2.5 and spring 3 jars at your environment.


Comment actions Permalink

Hi Denis,

You were right. Thanks



Please sign in to leave a comment.