cmathrusse
Oct 4th, 2006, 02:00 PM
I'm running Spring 2.0 rc4 with JDK 1.5_05.
I've been having problems with the @Transaction annotations and I think that it might have something to do with this error message:
11:51:05,843 [DEBUG,DefaultListableBeanFactory] Invoking BeanPostProcessors after initialization of bean 'org.springframework.aop.config.internalAutoProxyC reator'
11:51:05,843 [INFO ,XmlWebApplicationContext] Bean 'org.springframework.aop.config.internalAutoProxyC reator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)11:51:05,843 [INFO ,XmlWebApplicationContext] Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMess ageSource@10275fa]
I've trimmed down the xml files loaded by my application to a very simplistic one. All that I have being declared are three beans. Once I include the
<tx:annotation-driven element I receive this error. If I remove this element then no error.
Here is my conext.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Application context definition for Cosmos's business layer.
- Contains bean references to the transaction manager and to the DAOs in
- dataAccessContext-jta.xml (see web.xml's "contextConfigLocation").
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- Main JNDI DataSource for J2EE environments -->
<!-- Refers to the ciim database -->
<bean id="ciimDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/ciim"/>
</bean>
<bean id="vertexDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/vertex"/>
</bean>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransaction Manager">
<property name="userTransactionName" value="java:comp/UserTransaction"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
Could this message be associated to my transaction problem? The behavior that I'm seeing in my transactions is the following: When I start my application I can see the container associating the PointCuts to the beans. But in AopUtils (line 212) in the method canApply, when a method matches the methodMatcher the code returns. This does not give the other methods within the class the opportunity to match the methodMatcher. The end result is that only the first matching method is identified. In my case this means that only the first matching method is eligable for a Transaction. All others seem to be ignored. I'm uncertain if this is associated to the warning message above.
I've been having problems with the @Transaction annotations and I think that it might have something to do with this error message:
11:51:05,843 [DEBUG,DefaultListableBeanFactory] Invoking BeanPostProcessors after initialization of bean 'org.springframework.aop.config.internalAutoProxyC reator'
11:51:05,843 [INFO ,XmlWebApplicationContext] Bean 'org.springframework.aop.config.internalAutoProxyC reator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)11:51:05,843 [INFO ,XmlWebApplicationContext] Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMess ageSource@10275fa]
I've trimmed down the xml files loaded by my application to a very simplistic one. All that I have being declared are three beans. Once I include the
<tx:annotation-driven element I receive this error. If I remove this element then no error.
Here is my conext.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Application context definition for Cosmos's business layer.
- Contains bean references to the transaction manager and to the DAOs in
- dataAccessContext-jta.xml (see web.xml's "contextConfigLocation").
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- Main JNDI DataSource for J2EE environments -->
<!-- Refers to the ciim database -->
<bean id="ciimDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/ciim"/>
</bean>
<bean id="vertexDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/vertex"/>
</bean>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransaction Manager">
<property name="userTransactionName" value="java:comp/UserTransaction"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
Could this message be associated to my transaction problem? The behavior that I'm seeing in my transactions is the following: When I start my application I can see the container associating the PointCuts to the beans. But in AopUtils (line 212) in the method canApply, when a method matches the methodMatcher the code returns. This does not give the other methods within the class the opportunity to match the methodMatcher. The end result is that only the first matching method is identified. In my case this means that only the first matching method is eligable for a Transaction. All others seem to be ignored. I'm uncertain if this is associated to the warning message above.