Announcement Announcement Module
Collapse
No announcement yet.
IncompatibleClassChangeError Exception When using simple transactionProxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • IncompatibleClassChangeError Exception When using simple transactionProxy

    I've searched hi and low for a solution to this but I haven't come across anything similar. I am trying to utilize basic transaction management with hibernate and i get the following error:

    Initialization of bean failed; nested exception is java.lang.IncompatibleClassChangeError: null
    java.lang.IncompatibleClassChangeError
    at org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean.getProxy(TransactionProxyFac toryBean.java:338)
    at org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean.afterPropertiesSet(Transacti onProxyFactoryBean.java:310)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1058)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:363)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:176)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:105)

    etc...

    here is my xml file...

    <bean id="loginFormController" class="web.LoginFormController">
    <property name="sessionForm"><value>true</value></property>
    <property name="formView"><value>loginForm</value></property>
    <property name="successView"><value>userOptions.htm</value></property>
    <property name="validator"><ref bean="loginValidator"/></property>
    <property name="commandName"><value>loginAttempt</value></property>
    <property name="commandClass"><value>bus.auth.LoginAttempt</value></property>
    <property name="authenticationService">
    <ref bean="txService"/>
    </property>
    </bean>

    <bean id="loginValidator" class="bus.auth.LoginValidator">

    </bean>

    <bean id="gusDaoSession" class="org.gusdb.model.dao.GusDaoSession" >
    <property name="sessionFactory" ref="mySessionFactory"/>
    </bean>

    <bean id="authenticationServiceTarget" class="bus.auth.AuthenticationServiceImpl" >
    <property name="gusDaoSession" ref="gusDaoSession"/>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <property name="sessionFactory"><ref bean="mySessionFactory"/></property>
    </bean>

    <bean id="txService" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager"><ref bean="transactionManager"/></property>
    <property name="target"><ref bean="authenticationServiceTarget"/></property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>


    <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="hibDataSource"/>
    <property name="mappingResources">
    <list>
    <value>gusdb.hbm.xml</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.Post greSQLDialect</prop>
    </props>
    </property>
    </bean>


    Anyone have any ideas? I'm using tomcat 5.5, spring 1.2.4, hibernate 3 jars, jdk 1.5. I can post more code, too.

    Thanks,
    Dave

  • #2
    Try to set the 'proxyInterfaces' property of the bean 'txService' with the interface 'bus.auth.AuthenticationService'

    Kind regards
    Juergen

    Comment


    • #3
      Yeah, that didn't work either. I figured out the problem though. It turns out that I was missing a couple spring jars in my lib folder. It was either db-ojb-1.0.3 or commons-pool,dbcp, or lang that was the problem. I ended up figuring it out by just copying all the jars over from the petclinic example and working from there.

      Thanks,
      Dave

      Comment


      • #4
        Hi,

        Im with the same problem, but I copied the jars to libs folder and
        the bean for TransactionProxy is:

        Code:
        	<bean id="actionDAO"
        		  class="model.dao.register.hibernate.HibernateActionDAO">
        		<property name="sessionFactory">
        			<ref bean="sessionFactory"/>
        		</property>
        	</bean>
        
        	<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        		<property name="sessionFactory"><ref bean="sessionFactory"/></property>
        	</bean>
        
        	<bean id="txProxyActionDAO" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">		
        		
        		<property name="transactionManager"><ref bean="txManager"/></property>
        		<property name="target"><ref bean="actionDAO"/></property>
        		
        		<property name="proxyInterfaces"><value>model.dao.register.ActionDAO</value></property>
        				
        		<property name="transactionAttributes">
        			<props>
        				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
        				<prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
        				<prop key="create*">PROPAGATION_REQUIRED</prop>
        			</props>
        		</property>
        	</bean>
        What occurs?

        thanks

        Comment

        Working...
        X