Announcement Announcement Module
Collapse
No announcement yet.
unable to use JtaTransactionManager -- please help Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • unable to use JtaTransactionManager -- please help

    I am trying to deploy a spring 3.0.5 App in JBoss 5.1 AS.
    First of all, when I add any @Transactional annotated methods for insert or update operations the app fails to deploy since autowiring fails.
    I have tried declarative transactions both via transactional annotations and aop based xml declarations, both fail to deploy.

    Can someone please help or point me in the right direction?

    Here's my spring-config xml

    Code:
    	<jee:jndi-lookup id="entityManagerFactory" jndi-name="java:/ties-2EntityManagerFactory">
    	</jee:jndi-lookup>
    	<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" />
    	 
    	<aop:config>
    	  <aop:pointcut id="allTransactions" expression="execution(* com.rtd.ties2.dao.*.*(..))"/>
          <aop:advisor pointcut-ref="allTransactions" advice-ref="txAdvice" />
        </aop:config>
    
        <tx:advice id="txAdvice" transaction-manager="transactionManager">
          <tx:attributes>
            <tx:method name="save*" propagation="REQUIRED"/>
            <tx:method name="merge*" propagation="REQUIRED"/>
            <tx:method name="delete*" propagation="REQUIRED"/>        
            <tx:method name="*" propagation="SUPPORTS" read-only="true"/>
          </tx:attributes>
        </tx:advice>
    persistence.xml

    Code:
       <persistence-unit name="ties-2" transaction-type="JTA">
          <provider>org.hibernate.ejb.HibernatePersistence</provider>
          <jta-data-source>java:/ties-2Datasource</jta-data-source>
          <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR -->
    
          <properties>
             <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
             <property name="hibernate.show_sql" value="true"/>
             <property name="hibernate.format_sql" value="true"/>
             <property name="jboss.entity.manager.factory.jndi.name" value="java:/ties-2EntityManagerFactory"/>
               
          </properties>
       </persistence-unit>
        
    </persistence>
    JBoss logs

    Code:
    14:57:12,611 INFO  [TilesAccess] Publishing TilesContext for context: org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory$SpringWildcardServletTilesApplicationContext
    14:57:12,783 INFO  [STDOUT] 14:57:12,783 INFO  [EntryPointInjectionBeanPostProcessor] Selecting AuthenticationEntryPoint for use in ExceptionTranslationFilter
    14:57:12,798 INFO  [STDOUT] 14:57:12,798 INFO  [EntryPointInjectionBeanPostProcessor] Using main configured AuthenticationEntryPoint.
    14:57:12,798 INFO  [STDOUT] 14:57:12,798 INFO  [EntryPointInjectionBeanPostProcessor] Using bean 'org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint@1b9f652' as the entry point.
    14:57:12,845 INFO  [STDOUT] 14:57:12,845 INFO  [AbstractSecurityInterceptor] Validated configuration attributes
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] Checking sorted filter chain: [org.springframework.security.context.HttpSessionContextIntegrationFilter[ order=200; ], org.springframework.security.ui.logout.LogoutFilter[ order=300; ], OrderedFilterDecorator[ delegate=com.rtddenver.security.TiesAuthenticationProcessingFilter[ order=700; ]; order=700], org.springframework.security.ui.basicauth.BasicProcessingFilter[ order=1000; ], org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter[ order=1100; ], org.springframework.security.ui.ExceptionTranslationFilter[ order=1400; ], org.springframework.security.ui.SessionFixationProtectionFilter[ order=1600; ], org.springframework.security.intercept.web.FilterSecurityInterceptor@114d291]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] Filter chain...
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [0] - org.springframework.security.context.HttpSessionContextIntegrationFilter[ order=200; ]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [1] - org.springframework.security.ui.logout.LogoutFilter[ order=300; ]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [2] - com.rtddenver.security.TiesAuthenticationProcessingFilter[ order=700; ]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [3] - org.springframework.security.ui.basicauth.BasicProcessingFilter[ order=1000; ]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [4] - org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter[ order=1100; ]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [5] - org.springframework.security.ui.ExceptionTranslationFilter[ order=1400; ]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [6] - org.springframework.security.ui.SessionFixationProtectionFilter[ order=1600; ]
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] [7] - org.springframework.security.intercept.web.FilterSecurityInterceptor@114d291
    14:57:12,939 INFO  [STDOUT] 14:57:12,939 INFO  [FilterChainProxyPostProcessor] Checking whether login URL '/login.do' is accessible with your configuration
    14:57:12,955 INFO  [STDOUT] 14:57:12,955 INFO  [FilterChainProxyPostProcessor] FilterChainProxy: FilterChainProxy[ UrlMatcher = org.springframework.security.util.AntUrlPathMatcher[requiresLowerCase='true']; Filter Chains: {/login.do*=[], /**=[org.springframework.security.context.HttpSessionContextIntegrationFilter[ order=200; ], org.springframework.security.ui.logout.LogoutFilter[ order=300; ], com.rtddenver.security.TiesAuthenticationProcessingFilter[ order=700; ], org.springframework.security.ui.basicauth.BasicProcessingFilter[ order=1000; ], org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter[ order=1100; ], org.springframework.security.ui.ExceptionTranslationFilter[ order=1400; ], org.springframework.security.ui.SessionFixationProtectionFilter[ order=1600; ], org.springframework.security.intercept.web.FilterSecurityInterceptor@114d291]}]
    14:57:13,095 INFO  [STDOUT] 14:57:13,095 INFO  [DefaultListableBeanFactory] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1416f4a: defining beans [applicationProps,entityManagerFactory,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,allTransactions,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,txAdvice,dataSource,txMgr,messageSource,crystalConnect,contextApplicationContextProvider,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,userAdminService,userDataEntryFactory,routeService,dynamicParametersService,serviceTypeService,voteAdminService,crystalRptsUtils,selectableBizObj,runboardService,domainService,securityService,headwayService,reportService,divisionService,voteService,dynamicParametersDAO,routeDAO,divisionDAO,serviceTypeDAO,runboardDAO,etlDAO,userDAO,voteAdminDAO,headwayDAO,holidayDAO,reportDAO,org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping#0,/login.do,/app/home.do,/app/gwt.do,/report.do,/app/uploadPrivateCarriers.do,tilesViewResolver,tilesConfigurer,multipartResolver,_authenticationManager,_filterChainProxy,_httpSessionContextIntegrationFilter,_filterChainProxyPostProcessor,_filterChainList,_securityContextHolderAwareRequestFilter,_accessManager,_portMapper,_exceptionTranslationFilter,_filterSecurityInterceptor,_sessionFixationProtectionFilter,_logoutFilter,_basicAuthenticationEntryPoint,_basicAuthenticationFilter,_entryPointInjectionBeanPostProcessor,_userServiceInjectionPostProcessor,authenticationProcessingFilter,authenticationProcessingFilterEntryPoint,tiesUserDetailsService,org.springframework.security.providers.dao.DaoAuthenticationProvider#0,org.springframework.security.config.AuthenticationProviderBeanDefinitionParser$AuthenticationProviderCacheResolver#0,tiesEmployeesDao,tiesVoteScheduleEntriesDaoJpa,tiesVotesDao,employeeService]; root of factory hierarchy
    14:57:13,111 INFO  [TilesAccess] Removing TilesContext for context: org.springframework.web.servlet.view.tiles2.SpringTilesApplicationContextFactory$SpringWildcardServletTilesApplicationContext
    14:57:13,126 INFO  [STDOUT] 14:57:13,111 ERROR [ContextLoader] Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.rtddenver.gwt.server.service.EmployeeServiceImpl.setTiesEmployeesDaoJpa(com.rtd.ties2.dao.TiesEmployeesDaoJpa); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.rtd.ties2.dao.TiesEmployeesDaoJpa] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
Working...
X