Configuration problem: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serverId' threw exception; nested exception is java.lang.IllegalStateException: cannot change the configuration while the transaction manager is running

classic Classic list List threaded Threaded
3 messages Options
LJD
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Configuration problem: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serverId' threw exception; nested exception is java.lang.IllegalStateException: cannot change the configuration while the transaction manager is running

LJD
Hello,

I am new to Bitronix and trying to configure the transaction manager. Our project uses Spring, Hibernate, Tomcat and (currently) an Oracle Database. I can't get the configuration working correctly, as the server always fails to start with an exception:

PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serverId' threw exception; nested exception is java.lang.IllegalStateException: cannot change the configuration while the transaction manager is running

I think Hibernate is starting BTM before Spring does, based on this debug log:

DEBUG [localhost-startStop-1] (InjectionMetadata.java:85) - Processing injected method of bean 'customerRefDataDAO': AutowiredFieldElement for protected org.hibernate.SessionFa
id.hm.services.referencedata.impl.AbstractHibernateDAO.sessionFactory
DEBUG [localhost-startStop-1] (DefaultSingletonBeanRegistry.java:217) - Creating shared instance of singleton bean 'btmConfig'
DEBUG [localhost-startStop-1] (AbstractAutowireCapableBeanFactory.java:430) - Creating instance of bean 'btmConfig'
DEBUG [localhost-startStop-1] (AbstractAutowireCapableBeanFactory.java:504) - Eagerly caching bean 'btmConfig' to allow for resolving potential circular references
 INFO [localhost-startStop-1] (DefaultSingletonBeanRegistry.java:433) - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@201787a6:
.... <<snip>>
ERROR [localhost-startStop-1] (FrameworkServlet.java:457) - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'referenceDataService': Injection of autowired dependencies failed; nested exception is org.springframework.beans
.factory.BeanCreationException: Could not autowire field: private uk.gov.scotland.rpid.hm.services.referencedata.dao.CustomerRefDataDAO uk.gov.scotland.rpid.hm.services.referencedata.impl.ReferenceDat
aServiceImpl.customerRefDataDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerRefDataDAO': Injection of autowired dependencies fa
iled; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory uk.gov.scotland.rpid.hm.services.referencedata.impl.
AbstractHibernateDAO.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'btmConfig' defined in class path resource [datasource-c
onnection.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serverId' threw exception; nested exception is java.lang.IllegalStateException: cannot change the configuration while the transaction manager is running
Here is my Spring configuration:

<?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:p="http://www.springframework.org/schema/p"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:util="http://www.springframework.org/schema/util" xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util-3.0.xsd
        http://www.springframework.org/schema/tx 
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        ">

        <context:annotation-config />
       

       

        <bean id="ConnectionFactory" class="bitronix.tm.resource.jms.PoolingConnectionFactory"
                init-method="init" destroy-method="close" depends-on="btmConfig">
                <property name="className"
                        value="org.apache.activemq.ActiveMQXAConnectionFactory" />
                <property name="uniqueName" value="activemq" />
                <property name="maxPoolSize" value="3" />
                <property name="driverProperties">
                        <props>
                                <prop key="brokerURL">vm://localhost</prop>
                        </props>
                </property>
        </bean>

       
        <bean id="sessionFactory"
                class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
                depends-on="btmConfig,ConnectionFactory">
                <property name="dataSource" ref="HMdataSource" />
                <property name="configLocation" value="classpath:/hm-hibernate.cfg.xml" />
                <property name="packagesToScan" value="uk.gov.scotland.rpid.hm.model.datamodel" />
        </bean>

        <bean id="HMdataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource">
                <property name="className" value="oracle.jdbc.xa.client.OracleXADataSource" />
                <property name="uniqueName" value="jdbc/hm" />
                <property name="minPoolSize" value="0" />
                <property name="maxPoolSize" value="5" />
                <property name="allowLocalTransactions" value="true" />
                <property name="testQuery" value="select sysdate from dual" />
                <property name="driverProperties">
                        <props>
                               
                                <prop key="URL">[REDACTED]</prop>
                                <prop key="user">[REDACTED]</prop>
                                <prop key="password">[REDACTED]</prop>
                        </props>
                </property>
        </bean>

        <bean id="BitronixTransactionManager" factory-method="getTransactionManager"
                class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig,ConnectionFactory"
                destroy-method="shutdown" />

        <bean id="transactionManager"
                class="org.springframework.transaction.jta.JtaTransactionManager" depends-on="btmConfig,ConnectionFactory">
                <property name="transactionManager" ref="BitronixTransactionManager" />
                <property name="userTransaction" ref="BitronixTransactionManager" />
        </bean>

        <bean id="btmConfig" factory-method="getConfiguration"
                class="bitronix.tm.TransactionManagerServices">
                <property name="serverId" value="spring-btm-sender" />
        </bean>
</beans>

(Note that every bean depends on btmConfig using depends-on="btmConfig").

Here is my Hibernate Peristance configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
        <session-factory>
                <property name="show_sql">true</property>
                <property name="format_sql">true</property>
                <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>

                <property name="connection.datasource">jdbc/hm</property>
                <property name="connection.release_mode">after_statement</property>
                <property name="current_session_context_class">jta</property>
               

               
                <property name="jta.UserTransaction">BTMUserTransaction</property>
                <property name="hibernate.jndi.class">bitronix.tm.jndi.BitronixInitialContextFactory</property>

               
                <property name="hibernate.cache.region.factory_class">
                        net.sf.ehcache.hibernate.EhCacheRegionFactory</property>
                <property name="hibernate.cache.use_second_level_cache">true</property>
                <property name="hibernate.cache.use_query_cache">true</property>

               
  <property name="transaction.manager_lookup_class">org.hibernate.transaction.BTMTransactionManagerLookup</property>

        </session-factory>
</hibernate-configuration>

I've been fighting this for days. This is my first transaction manager so am very much a newbie.

Thanks,

Liam
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration problem: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serverId' threw exception; nested exception is java.lang.IllegalStateException: cannot change the configuration while the transaction manager is running

Peter Giles-2
This looks vaguely familiar to me.  Maybe you've already given this a shot, but I'll throw it out there anyway:  as a starting point for tracking it down, I'd put a break point in the BitronixTransactionManager constructor so you can trace what is causing it to be created before the btmConfig bean is initialized by walking the stack with your debugger.  I've had some troubleshooting success in the past by looking at the state of the Spring classes involved in bean initialization to determine why things are happening in the order they are, hopefully you will too.

Good luck!
- Peter


On Wed, Jan 9, 2013 at 1:38 AM, LJD <[hidden email]> wrote:

Hello,

I am new to Bitronix and trying to configure the transaction manager. Our
project uses Spring, Hibernate, Tomcat and (currently) an Oracle Database. I
can't get the configuration working correctly, as the server always fails to
start with an exception:

PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property 'serverId'
threw exception; nested exception is java.lang.IllegalStateException: cannot
change the configuration while the transaction manager is running

I think Hibernate is starting BTM before Spring does, based on this debug
log:

DEBUG [localhost-startStop-1] (InjectionMetadata.java:85) - Processing
injected method of bean 'customerRefDataDAO': AutowiredFieldElement for
protected org.hibernate.SessionFa
id.hm.services.referencedata.impl.AbstractHibernateDAO.sessionFactory
DEBUG [localhost-startStop-1] (DefaultSingletonBeanRegistry.java:217) -
Creating shared instance of singleton bean 'btmConfig'
DEBUG [localhost-startStop-1] (AbstractAutowireCapableBeanFactory.java:430)
- Creating instance of bean 'btmConfig'
DEBUG [localhost-startStop-1] (AbstractAutowireCapableBeanFactory.java:504)
- Eagerly caching bean 'btmConfig' to allow for resolving potential circular
references
 INFO [localhost-startStop-1] (DefaultSingletonBeanRegistry.java:433) -
Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@201787a6:
.... <<snip>>
ERROR [localhost-startStop-1] (FrameworkServlet.java:457) - Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'referenceDataService': Injection of autowired dependencies
failed; nested exception is org.springframework.beans
.factory.BeanCreationException: Could not autowire field: private
uk.gov.scotland.rpid.hm.services.referencedata.dao.CustomerRefDataDAO
uk.gov.scotland.rpid.hm.services.referencedata.impl.ReferenceDat
aServiceImpl.customerRefDataDAO; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'customerRefDataDAO': Injection of autowired dependencies fa
iled; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: protected org.hibernate.SessionFactory
uk.gov.scotland.rpid.hm.services.referencedata.impl.
AbstractHibernateDAO.sessionFactory; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'btmConfig' defined in class path resource [datasource-c
onnection.xml]: Error setting property values; nested exception is
org.springframework.beans.PropertyBatchUpdateException; nested
PropertyAccessExceptions (1) are:
PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property 'serverId'
threw exception; nested exception is java.lang.IllegalStateException: cannot
change the configuration while the transaction manager is running
Here is my Spring configuration:

<?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:p="http://www.springframework.org/schema/p"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:util="http://www.springframework.org/schema/util"
xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util-3.0.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        ">

        <context:annotation-config />
        <!-- <tx:annotation-driven /> -->

        <!-- <bean id="ConnectionFactory" factory-bean="ConnectionFactoryBean"
factory-method="createResource"
                /> -->

        <bean id="ConnectionFactory"
class="bitronix.tm.resource.jms.PoolingConnectionFactory"
                init-method="init" destroy-method="close" depends-on="btmConfig">
                <property name="className"
                        value="org.apache.activemq.ActiveMQXAConnectionFactory" />
                <property name="uniqueName" value="activemq" />
                <property name="maxPoolSize" value="3" />
                <property name="driverProperties">
                        <props>
                                <prop key="brokerURL">vm://localhost</prop>
                        </props>
                </property>
        </bean>

        <!-- define session factory -->
        <bean id="sessionFactory"

class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
                depends-on="btmConfig,ConnectionFactory">
                <property name="dataSource" ref="HMdataSource" />
                <property name="configLocation" value="classpath:/hm-hibernate.cfg.xml" />
                <property name="packagesToScan"
value="uk.gov.scotland.rpid.hm.model.datamodel" />
        </bean>

        <bean id="HMdataSource"
class="bitronix.tm.resource.jdbc.PoolingDataSource">
                <property name="className"
value="oracle.jdbc.xa.client.OracleXADataSource" />
                <property name="uniqueName" value="jdbc/hm" />
                <property name="minPoolSize" value="0" />
                <property name="maxPoolSize" value="5" />
                <property name="allowLocalTransactions" value="true" />
                <property name="testQuery" value="select sysdate from dual" />
                <property name="driverProperties">
                        <props>
                                <!-- <prop key="driverClassName">oracle.jdbc.OracleDriver</prop> -->
                                <prop key="URL">[REDACTED]</prop>
                                <prop key="user">[REDACTED]</prop>
                                <prop key="password">[REDACTED]</prop>
                        </props>
                </property>
        </bean>

        <bean id="BitronixTransactionManager"
factory-method="getTransactionManager"
                class="bitronix.tm.TransactionManagerServices"
depends-on="btmConfig,ConnectionFactory"
                destroy-method="shutdown" />

        <bean id="transactionManager"
                class="org.springframework.transaction.jta.JtaTransactionManager"
depends-on="btmConfig,ConnectionFactory">
                <property name="transactionManager" ref="BitronixTransactionManager" />
                <property name="userTransaction" ref="BitronixTransactionManager" />
        </bean>

        <bean id="btmConfig" factory-method="getConfiguration"
                class="bitronix.tm.TransactionManagerServices">
                <property name="serverId" value="spring-btm-sender" />
        </bean>
</beans>

(Note that every bean depends on btmConfig using depends-on="btmConfig").

Here is my Hibernate Peristance configuration:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
        <session-factory>
                <property name="show_sql">true</property>
                <property name="format_sql">true</property>
                <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>

                <property name="connection.datasource">jdbc/hm</property>
                <property name="connection.release_mode">after_statement</property>
                <property name="current_session_context_class">jta</property>
                <!-- <property name="current_session_context_class">thread</property> -->

                <!-- <property name="jta.UserTransaction">jta/userTransaction</property>
-->
                <property name="jta.UserTransaction">BTMUserTransaction</property>
                <property
name="hibernate.jndi.class">bitronix.tm.jndi.BitronixInitialContextFactory</property>

                <!-- Caching -->
                <property name="hibernate.cache.region.factory_class">
                        net.sf.ehcache.hibernate.EhCacheRegionFactory</property>
                <property name="hibernate.cache.use_second_level_cache">true</property>
                <property name="hibernate.cache.use_query_cache">true</property>

                <!-- Transactions -->
                <property
name="transaction.manager_lookup_class">org.hibernate.transaction.BTMTransactionManagerLookup</property>

        </session-factory>
</hibernate-configuration>

I've been fighting this for days. This is my first transaction manager so am
very much a newbie.

Thanks,

Liam

--
View this message in context: http://old.nabble.com/Configuration-problem%3A-PropertyAccessException-1%3A-org.springframework.beans.MethodInvocationException%3A-Property-%27serverId%27-threw-exception--nested-exception-is-java.lang.IllegalStateException%3A-cannot-change-the-configuration-while-the-transaction-manager-is-running-tp34877100p34877100.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Peter Giles  |  Kuali Rice dev team  |  UW Information Management
LJD
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration problem: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serverId' threw exception; nested exception is java.lang.IllegalStateException: cannot change the configuration while the transaction manager is running

LJD
We finally managed to resolve this issue. It turns out that there was nothing wrong with the configuration of Bitronix or Hibernate, and in fact there was an error in servlet-dispatcher.xml (yes, all the way up there) that was causing all beans to be loaded twice. The debugger helped us find the root cause, so thank you.

Liam

Peter Giles-2 wrote
This looks vaguely familiar to me.  Maybe you've already given this a shot,
but I'll throw it out there anyway:  as a starting point for tracking it
down, I'd put a break point in the BitronixTransactionManager constructor
so you can trace what is causing it to be created before the btmConfig bean
is initialized by walking the stack with your debugger.  I've had some
troubleshooting success in the past by looking at the state of the Spring
classes involved in bean initialization to determine why things are
happening in the order they are, hopefully you will too.

Good luck!
- Peter


On Wed, Jan 9, 2013 at 1:38 AM, LJD <Liam.davison@scotland.gsi.gov.uk>wrote:

>
> Hello,
>
> I am new to Bitronix and trying to configure the transaction manager. Our
> project uses Spring, Hibernate, Tomcat and (currently) an Oracle Database.
> I
> can't get the configuration working correctly, as the server always fails
> to
> start with an exception:
>
> PropertyAccessException 1:
> org.springframework.beans.MethodInvocationException: Property 'serverId'
> threw exception; nested exception is java.lang.IllegalStateException:
> cannot
> change the configuration while the transaction manager is running
>
> I think Hibernate is starting BTM before Spring does, based on this debug
> log:
>
> DEBUG [localhost-startStop-1] (InjectionMetadata.java:85) - Processing
> injected method of bean 'customerRefDataDAO': AutowiredFieldElement for
> protected org.hibernate.SessionFa
> id.hm.services.referencedata.impl.AbstractHibernateDAO.sessionFactory
> DEBUG [localhost-startStop-1] (DefaultSingletonBeanRegistry.java:217) -
> Creating shared instance of singleton bean 'btmConfig'
> DEBUG [localhost-startStop-1] (AbstractAutowireCapableBeanFactory.java:430)
> - Creating instance of bean 'btmConfig'
> DEBUG [localhost-startStop-1] (AbstractAutowireCapableBeanFactory.java:504)
> - Eagerly caching bean 'btmConfig' to allow for resolving potential
> circular
> references
>  INFO [localhost-startStop-1] (DefaultSingletonBeanRegistry.java:433) -
> Destroying singletons in
>
> org.springframework.beans.factory.support.DefaultListableBeanFactory@201787a6
> :
> .... <<snip>>
> ERROR [localhost-startStop-1] (FrameworkServlet.java:457) - Context
> initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'referenceDataService': Injection of autowired dependencies
> failed; nested exception is org.springframework.beans
> .factory.BeanCreationException: Could not autowire field: private
> uk.gov.scotland.rpid.hm.services.referencedata.dao.CustomerRefDataDAO
> uk.gov.scotland.rpid.hm.services.referencedata.impl.ReferenceDat
> aServiceImpl.customerRefDataDAO; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'customerRefDataDAO': Injection of autowired dependencies fa
> iled; nested exception is
> org.springframework.beans.factory.BeanCreationException: Could not autowire
> field: protected org.hibernate.SessionFactory
> uk.gov.scotland.rpid.hm.services.referencedata.impl.
> AbstractHibernateDAO.sessionFactory; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'btmConfig' defined in class path resource [datasource-c
> onnection.xml]: Error setting property values; nested exception is
> org.springframework.beans.PropertyBatchUpdateException; nested
> PropertyAccessExceptions (1) are:
> PropertyAccessException 1:
> org.springframework.beans.MethodInvocationException: Property 'serverId'
> threw exception; nested exception is java.lang.IllegalStateException:
> cannot
> change the configuration while the transaction manager is running
> Here is my Spring configuration:
>
> <?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:p="http://www.springframework.org/schema/p"
>         xmlns:context="http://www.springframework.org/schema/context"
>         xmlns:util="http://www.springframework.org/schema/util"
> xmlns:tx="http://www.springframework.org/schema/tx"
>         xsi:schemaLocation="
>         http://www.springframework.org/schema/beans
>         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>         http://www.springframework.org/schema/context
>
> http://www.springframework.org/schema/context/spring-context-3.0.xsd
>         http://www.springframework.org/schema/util
>         http://www.springframework.org/schema/util/spring-util-3.0.xsd
>         http://www.springframework.org/schema/tx
>         http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
>         ">
>
>         <context:annotation-config />
>        
>
>        
>
>         <bean id="ConnectionFactory"
> class="bitronix.tm.resource.jms.PoolingConnectionFactory"
>                 init-method="init" destroy-method="close"
> depends-on="btmConfig">
>                 <property name="className"
>
> value="org.apache.activemq.ActiveMQXAConnectionFactory" />
>                 <property name="uniqueName" value="activemq" />
>                 <property name="maxPoolSize" value="3" />
>                 <property name="driverProperties">
>                         <props>
>                                 <prop key="brokerURL">vm://localhost</prop>
>                         </props>
>                 </property>
>         </bean>
>
>        
>         <bean id="sessionFactory"
>
>
> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
>                 depends-on="btmConfig,ConnectionFactory">
>                 <property name="dataSource" ref="HMdataSource" />
>                 <property name="configLocation"
> value="classpath:/hm-hibernate.cfg.xml" />
>                 <property name="packagesToScan"
> value="uk.gov.scotland.rpid.hm.model.datamodel" />
>         </bean>
>
>         <bean id="HMdataSource"
> class="bitronix.tm.resource.jdbc.PoolingDataSource">
>                 <property name="className"
> value="oracle.jdbc.xa.client.OracleXADataSource" />
>                 <property name="uniqueName" value="jdbc/hm" />
>                 <property name="minPoolSize" value="0" />
>                 <property name="maxPoolSize" value="5" />
>                 <property name="allowLocalTransactions" value="true" />
>                 <property name="testQuery" value="select sysdate from
> dual" />
>                 <property name="driverProperties">
>                         <props>
>                                
>                                 <prop key="URL">[REDACTED]</prop>
>                                 <prop key="user">[REDACTED]</prop>
>                                 <prop key="password">[REDACTED]</prop>
>                         </props>
>                 </property>
>         </bean>
>
>         <bean id="BitronixTransactionManager"
> factory-method="getTransactionManager"
>                 class="bitronix.tm.TransactionManagerServices"
> depends-on="btmConfig,ConnectionFactory"
>                 destroy-method="shutdown" />
>
>         <bean id="transactionManager"
>
> class="org.springframework.transaction.jta.JtaTransactionManager"
> depends-on="btmConfig,ConnectionFactory">
>                 <property name="transactionManager"
> ref="BitronixTransactionManager" />
>                 <property name="userTransaction"
> ref="BitronixTransactionManager" />
>         </bean>
>
>         <bean id="btmConfig" factory-method="getConfiguration"
>                 class="bitronix.tm.TransactionManagerServices">
>                 <property name="serverId" value="spring-btm-sender" />
>         </bean>
> </beans>
>
> (Note that every bean depends on btmConfig using depends-on="btmConfig").
>
> Here is my Hibernate Peristance configuration:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
> Configuration DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
>
> <hibernate-configuration>
>         <session-factory>
>                 <property name="show_sql">true</property>
>                 <property name="format_sql">true</property>
>                 <property
> name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
>
>                 <property name="connection.datasource">jdbc/hm</property>
>                 <property
> name="connection.release_mode">after_statement</property>
>                 <property
> name="current_session_context_class">jta</property>
>                
>
>                
>                 <property
> name="jta.UserTransaction">BTMUserTransaction</property>
>                 <property
>
> name="hibernate.jndi.class">bitronix.tm.jndi.BitronixInitialContextFactory</property>
>
>                
>                 <property name="hibernate.cache.region.factory_class">
>
> net.sf.ehcache.hibernate.EhCacheRegionFactory</property>
>                 <property
> name="hibernate.cache.use_second_level_cache">true</property>
>                 <property
> name="hibernate.cache.use_query_cache">true</property>
>
>                
>                 <property
>
> name="transaction.manager_lookup_class">org.hibernate.transaction.BTMTransactionManagerLookup</property>
>
>         </session-factory>
> </hibernate-configuration>
>
> I've been fighting this for days. This is my first transaction manager so
> am
> very much a newbie.
>
> Thanks,
>
> Liam
>
> --
> View this message in context:
> http://old.nabble.com/Configuration-problem%3A-PropertyAccessException-1%3A-org.springframework.beans.MethodInvocationException%3A-Property-%27serverId%27-threw-exception--nested-exception-is-java.lang.IllegalStateException%3A-cannot-change-the-configuration-while-the-transaction-manager-is-running-tp34877100p34877100.html
> Sent from the Bitronix Transaction Manager mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


--
Peter Giles  |  Kuali Rice dev team  |  UW Information Management
Loading...