Announcement Announcement Module
Collapse
No announcement yet.
Existing transaction detected in JobRepository Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Existing transaction detected in JobRepository

    I am working on a project using Integration and Batch.

    Integration reads records from a table in system A, process them, write thenm out to a file. Batch then reads that file and inserts records into system B.

    Execution of the batch job results in the exception below.

    No explicit transactions are defined anywhere in the application, either through annotations or XML config. The application is really very simple.

    I can get around the error by mangling the classpath but that's really just storing up trouble for later. It will also makes deployment difficult.

    All help appreciated.

    PS: Sorry about the multiple posts but this was necessary due to the forum post limit of 10,000 characters.
    Last edited by trionic; Sep 19th, 2011, 08:12 AM.

  • #2
    Code:
    2011-09-19 12:51:24,599 DEBUG DataSourceTransactionManager: Creating new transaction with name [org.springframework.batch.core.repository.support.SimpleJobRepository.getLastJobExecution]: PROPAGATION_REQUIRES_NEW,ISOLATION_SERIALIZABLE
    2011-09-19 12:51:24,599 DEBUG DriverManagerDataSource: Creating new JDBC DriverManager Connection to [jdbc:oracle:thin:@localhost:1521:XE]
    2011-09-19 12:51:24,662 DEBUG DataSourceTransactionManager: Acquired Connection [oracle.jdbc.driver.T4CConnection@6f0725b4] for JDBC transaction
    2011-09-19 12:51:24,662 DEBUG DataSourceUtils: Changing isolation level of JDBC Connection [oracle.jdbc.driver.T4CConnection@6f0725b4] to 8
    2011-09-19 12:51:24,662 DEBUG DataSourceTransactionManager: Switching JDBC Connection [oracle.jdbc.driver.T4CConnection@6f0725b4] to manual commit
    2011-09-19 12:51:24,678 DEBUG JdbcTemplate: Executing prepared SQL query
    2011-09-19 12:51:24,678 DEBUG JdbcTemplate: Executing prepared SQL statement [SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ?]
    2011-09-19 12:51:24,678 DEBUG DataSourceTransactionManager: Initiating transaction commit
    2011-09-19 12:51:24,678 DEBUG DataSourceTransactionManager: Committing JDBC transaction on Connection [oracle.jdbc.driver.T4CConnection@6f0725b4]
    2011-09-19 12:51:24,678 DEBUG DataSourceUtils: Resetting isolation level of JDBC Connection [oracle.jdbc.driver.T4CConnection@6f0725b4] to 2
    2011-09-19 12:51:24,678 DEBUG DataSourceTransactionManager: Releasing JDBC Connection [oracle.jdbc.driver.T4CConnection@6f0725b4] after transaction
    2011-09-19 12:51:24,678 DEBUG DataSourceUtils: Returning JDBC Connection to DataSource
    2011-09-19 12:51:24,678 DEBUG DataSourceTransactionManager: Resuming suspended transaction after completion of inner transaction
    2011-09-19 12:51:24,678 DEBUG DataSourceTransactionManager: Initiating transaction rollback
    2011-09-19 12:51:24,678 DEBUG DataSourceTransactionManager: Rolling back JDBC transaction on Connection [oracle.jdbc.driver.T4CConnection@43b5699]
    2011-09-19 12:51:24,693 DEBUG DataSourceTransactionManager: Releasing JDBC Connection [oracle.jdbc.driver.T4CConnection@43b5699] after transaction
    2011-09-19 12:51:24,693 DEBUG DataSourceUtils: Returning JDBC Connection to DataSource
    2011-09-19 12:51:24,693 DEBUG DefaultListableBeanFactory: Returning cached instance of singleton bean 'errorChannel'
    2011-09-19 12:51:24,693 DEBUG PublishSubscribeChannel: preSend on channel 'errorChannel', message: [Payload=org.springframework.integration.MessageHandlingException: java.lang.IllegalStateException: Existing transaction detected in JobRepository. Please fix this and try again (e.g. remove @Transactional annotations from client).][Headers={timestamp=1316433084693, id=ece8ee45-8608-49f4-898a-0b7bbc2ca025}]
    2011-09-19 12:51:24,693 DEBUG LoggingHandler: (inner bean)#6 received message: [Payload=org.springframework.integration.MessageHandlingException: java.lang.IllegalStateException: Existing transaction detected in JobRepository. Please fix this and try again (e.g. remove @Transactional annotations from client).][Headers={timestamp=1316433084693, id=ece8ee45-8608-49f4-898a-0b7bbc2ca025}]
    2011-09-19 12:51:24,693 ERROR LoggingHandler: org.springframework.integration.MessageHandlingException: java.lang.IllegalStateException: Existing transaction detected in JobRepository. Please fix this and try again (e.g. remove @Transactional annotations from client).
       at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:76)
       at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:64)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:98)
       at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
       at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:137)
       at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
       at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
       at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
       at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
       at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
       at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
       at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
       at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:176)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
       at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
       at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
       at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
       at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
       at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
       at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:210)
       at org.springframework.integration.handler.MessageHandlerChain$ReplyForwardingMessageChannel.send(MessageHandlerChain.java:203)
       at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
       at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:176)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
       at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
       at org.springframework.integration.handler.MessageHandlerChain$1.send(MessageHandlerChain.java:154)
       at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
       at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:176)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
       at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
       at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
       at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:137)
       at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)

    Comment


    • #3
      Code:
      at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
         at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
         at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
         at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
         at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
         at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
         at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
         at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:220)
         at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
         at org.springframework.integration.handler.MessageHandlerChain$1.send(MessageHandlerChain.java:154)
         at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
         at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:176)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:115)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
         at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
         at org.springframework.integration.handler.MessageHandlerChain$1.send(MessageHandlerChain.java:154)
         at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
         at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:176)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
         at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
         at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
         at org.springframework.integration.handler.MessageHandlerChain.handleMessageInternal(MessageHandlerChain.java:137)
         at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
         at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
         at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
         at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
         at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
         at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
         at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
         at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
         at org.springframework.integration.endpoint.SourcePollingChannelAdapter.doPoll(SourcePollingChannelAdapter.java:102)
         at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
         at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
         at $Proxy13.call(Unknown Source)
         at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:207)
         at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
         at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
         at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:202)
         at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)
         at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.IllegalStateException: Existing transaction detected in JobRepository. Please fix this and try again (e.g. remove @Transactional annotations from client).
         at org.springframework.batch.core.repository.support.AbstractJobRepositoryFactoryBean$1.invoke(AbstractJobRepositoryFactoryBean.java:164)
         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
         at $Proxy15.createJobExecution(Unknown Source)
         at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:111)
         at integration.portal.UserBatchUpdateServiceActivator.process(UserBatchUpdateServiceActivator.java:54)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69)
         at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:110)
         at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
         at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
         at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:102)
         at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:126)
         at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:225)
         at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:125)
         at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:73)
         ... 108 more

      Comment


      • #4
        spring-applicationcontext.xml:
        Code:
        <beans xmlns="http://www.springframework.org/schema/beans"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:context="http://www.springframework.org/schema/context"
               xmlns:aop="http://www.springframework.org/schema/aop"
               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/aop
                                   http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
        
           <import resource="spring-datasource.xml" />
           <import resource="spring-dataaccess.xml" />
           <import resource="spring-transaction.xml" />
           <import resource="spring-integration.xml" />
           <import resource="spring-batch.xml" />
        
           <context:property-placeholder location="classpath:/ulm-conf.properties" />
           <context:annotation-config />
        
           <aop:aspectj-autoproxy />
        
        </beans>
        spring-datasource.xml:
        Code:
        <beans xmlns="http://www.springframework.org/schema/beans"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:jdbc="http://www.springframework.org/schema/jdbc"
               xsi:schemaLocation="http://www.springframework.org/schema/beans
                                   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                                   http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">
        
           <bean id="ulmDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
              <property name="driverClassName" value="${datasource.ulm.driverClassName}" />
              <property name="url" value="${datasource.ulm.url}" />
              <property name="username" value="${datasource.ulm.username}" />
              <property name="password" value="${datasource.ulm.password}" />
           </bean>
        
           <bean id="portalDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
              <property name="driverClassName" value="${datasource.portal.driverClassName}" />
              <property name="url" value="${datasource.portal.url}" />
              <property name="username" value="${datasource.portal.username}" />
              <property name="password" value="${datasource.portal.password}" />
           </bean>
        
           <bean id="loginManagementDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
              <property name="driverClassName" value="${datasource.loginmanagement.driverClassName}" />
              <property name="url" value="${datasource.loginmanagement.url}" />
              <property name="username" value="${datasource.loginmanagement.username}" />
              <property name="password" value="${datasource.loginmanagement.password}" />
           </bean>
        
        </beans>
        spring-dataaccess.xml:
        Code:
        <beans xmlns="http://www.springframework.org/schema/beans"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.springframework.org/schema/beans
                                   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
        
           <bean id="ulmSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
              <property name="dataSource" ref="ulmDataSource" />
        
              <property name="mappingResources">
                 <list>
                    <value>Recipient.hbm.xml</value>
                    <value>RecipientGroup.hbm.xml</value>
                    <value>RecipientGroupMember.hbm.xml</value>
                    <value>UserProperty.hbm.xml</value>
                 </list>
              </property>
        
              <property name="hibernateProperties">
                 <props>
                    <prop key="dialect">${hibernate.dialect}</prop>
                    <prop key="show_sql">${hibernate.logging.showsql}</prop>
                    <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl}</prop>
                 </props>
              </property>
           </bean>
        
           <bean id="portalSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
              <property name="dataSource" ref="portalDataSource" />
           </bean>
        
           <bean id="recipientGroupDataAccess" class="usersynchronisation.dataaccess.RecipientGroupDataAccess">
              <property name="ulmSessionFactory" ref="ulmSessionFactory" />
           </bean>
        
        </beans>
        spring-transaction.xml:
        Code:
        <beans xmlns="http://www.springframework.org/schema/beans"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.springframework.org/schema/beans
                                   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
        
           <bean id="portalDataSourceTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
              <property name="dataSource" ref="portalDataSource" />
           </bean>
        
           <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
              <property name="dataSource" ref="ulmDataSource" />
           </bean>
        
        </beans>

        Comment


        • #5
          spring-integration.xml:
          Code:
          <?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:si="http://www.springframework.org/schema/integration"
                 xmlns:si-xml="http://www.springframework.org/schema/integration/xml"
                 xmlns:jdbc="http://www.springframework.org/schema/integration/jdbc"
                 xmlns:file="http://www.springframework.org/schema/integration/file"
                 xsi:schemaLocation="http://www.springframework.org/schema/beans
                                     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                                     http://www.springframework.org/schema/integration
                                     http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
                                     http://www.springframework.org/schema/integration/jdbc
                                     http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc-2.0.xsd
                                     http://www.springframework.org/schema/integration/file
                                     http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd
                                     http://www.springframework.org/schema/integration/xml
                                     http://www.springframework.org/schema/integration/xml/spring-integration-xml-2.0.xsd">
          
             <bean id="userBeanRowMapper" class="integration.portal.UserUpdateBeanRowMapper" />
             <bean id="userSynchronisationService" class="usersynchronisation.service.UserSynchronisationService" />
             <bean id="xmlMarshaller" class="org.springframework.oxm.xstream.XStreamMarshaller" />
          
             <bean id="outboundUserUpdateMessageSplitter" class="core.integration.OutboundUserUpdateMessageSplitter">
                <property name="filenameExtension" value="${outbound.file.name.extension}" />
                <property name="filenamePattern" value="${outbound.file.name.pattern}" />
             </bean>
          
             <bean id="portalUserUpdateServiceActivator" class="integration.portal.PortalUserUpdateServiceActivator">
                <property name="userSynchronisationService" ref="userSynchronisationService" />
             </bean>
          
             <!-- Begin config for user updates from Login Management to Portal -->
             <jdbc:inbound-channel-adapter data-source="portalDataSource" channel="inboundPortalUserUpdateBeanChannel" row-mapper="userBeanRowMapper"
                query="${portal.inbound.jdbc.query}" update="${portal.inbound.jdbc.update}" max-rows-per-poll="${portal.inbound.poller.maxrowsperpoll}">
          
                <si:poller id="inboundPortalManagementChannelPoller" default="true" fixed-delay="${portal.inbound.poller.fixeddelay}">
                   <si:transactional transaction-manager="portalDataSourceTransactionManager" />
                </si:poller>
             </jdbc:inbound-channel-adapter>
          
             <si:chain input-channel="inboundPortalUserUpdateBeanChannel">
                <si:service-activator ref="portalUserUpdateServiceActivator" />
                <si:splitter ref="outboundUserUpdateMessageSplitter" />
                <si:header-value-router header-name="${message.header.name.recipient}">
                   <si:mapping value="${message.header.value.loginmanagement}" channel="outboundLoginManagementXmlTransformation" />
                   <si:mapping value="${message.header.value.arvalonline}" channel="nullChannel" />
                   <si:mapping value="${message.header.value.card}" channel="nullChannel" />
                   <si:mapping value="${message.header.value.drive}" channel="nullChannel" />
                </si:header-value-router>
             </si:chain>
          
             <si:chain input-channel="outboundLoginManagementXmlTransformation" output-channel="outboundLoginManagementUserXmlFileChannel">
                <si-xml:marshalling-transformer marshaller="xmlMarshaller" result-type="StringResult" />
                <si:object-to-string-transformer />
             </si:chain>
          
             <file:outbound-gateway id="outboundLoginManagementUserFileGateway" request-channel="outboundLoginManagementUserXmlFileChannel" reply-channel="loginManagementBatchUserUpdateChannel" directory="${outbound.file.drive}${outbound.file.path}" auto-create-directory="true" />
             <!-- End config for user updates from Login Management to Portal -->
          
          </beans>
          spring-batch.xml:
          Code:
          <?xml version="1.0" encoding="UTF-8"?>
          <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xmlns="http://www.springframework.org/schema/beans"
                       xmlns:batch="http://www.springframework.org/schema/batch"
                       xmlns:si="http://www.springframework.org/schema/integration"
                       xmlns:context="http://www.springframework.org/schema/context"
                       xsi:schemaLocation="http://www.springframework.org/schema/beans
                                           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                                           http://www.springframework.org/schema/batch
                                           http://www.springframework.org/schema/batch/spring-batch-2.1.xsd
                                           http://www.springframework.org/schema/integration
                                           http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
                                           http://www.springframework.org/schema/context
                                           http://www.springframework.org/schema/context/spring-context.xsd">
          
             <context:component-scan base-package="uk.co.arval.ulm" />
          
             <bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
                <property name="dataSource" ref="ulmDataSource" />
                <property name="transactionManager" ref="transactionManager" />
             </bean>
          
             <bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" />
             <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
                <property name="jobRepository" ref="jobRepository" />
             </bean>
          
             <bean id="jobRegistryBeanPostProcessor" class="org.springframework.batch.core.configuration.support.JobRegistryBeanPostProcessor">
                <property name="jobRegistry" ref="jobRegistry" />
             </bean>
          
             <bean id="jobLaunchingMessageHandler" class="org.springframework.batch.integration.launch.JobLaunchingMessageHandler">
                <constructor-arg name="jobLauncher" ref="jobLauncher" />
             </bean>
          
             <bean id="batchUserUpdateServiceActivator" class="integration.portal.UserBatchUpdateServiceActivator">
                <property name="batchUpdateFilePath" value="${outbound.file.drive}${outbound.file.path}" />
                <property name="batchUpdateSourceJobParameterKey" value="${batch.job.parameter.key.userupdatefile}" />
                <property name="batchUpdateFragmentRootElementJobParameterKey" value="${batch.job.parameter.key.fragmentRootElementName}" />
                <property name="jobRegistry" ref="jobRegistry" />
                <property name="jobLauncher" ref="jobLauncher" />
                <property name="jobNames">
                   <map>
                      <entry key="${message.header.value.loginmanagement}" value="${batch.job.userupdate.loginmanagement.name}" />
                   </map>
                </property>
             </bean>
          
             <bean id="xstreamUnmarshaller" class="org.springframework.oxm.xstream.XStreamMarshaller" />
          
             <bean id="userBatchUpdateReader" class="org.springframework.batch.item.xml.StaxEventItemReader" scope="step">
                <property name="fragmentRootElementName" value="#{jobParameters['root.element.name.userupdatebean']}" />
                <property name="resource" value="file://#{jobParameters['inbound.file.name']}" />
                <property name="unmarshaller" ref="xstreamUnmarshaller" />
             </bean>
          
          
             <bean id="loginManagementBatchItemWriter" class="org.springframework.batch.item.database.JdbcBatchItemWriter">
                <property name="dataSource" ref="loginManagementDataSource" />
                <property name="sql" value="${loginmanagement.outbound.batchupdate.sql}" />
                <property name="assertUpdates" value="true" />
                <property name="itemSqlParameterSourceProvider">
                   <bean class="org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider" />
                </property>
             </bean>
          
             <si:chain input-channel="loginManagementBatchUserUpdateChannel">
                <si:service-activator ref="batchUserUpdateServiceActivator" />
                <si:service-activator ref="jobLaunchingMessageHandler" />
             </si:chain>
          
             <batch:job id="loginManagementBatchUserUpdate">
                <batch:step id="updateStep">
                   <batch:tasklet>
                      <batch:chunk reader="userBatchUpdateReader" writer="loginManagementBatchItemWriter" commit-interval="${batch.job.userupdate.loginmanagement.commitinterval}" />
                   </batch:tasklet>
                </batch:step>
             </batch:job>
          
          </beans>

          Comment


          • #6
            The classpath:
            aopalliance-1.0:
            aopalliance.jar

            apache-log4j-1.2.16:
            log4j-1.2.16.jar

            aspectj-1.6.11:
            aspectjweaver.jar
            aspectjrt.jar

            cglib-2.2.2:
            cglib-nodep-2.2.2.jar

            commons-beanutils-1.8.3:
            commons-beanutils-1.8.3.jar

            commons-dbcp-1.4:
            commons-dbcp-1.4.jar

            commons-dbutils-1.3
            commons-dbutils-1.3.jar

            commons-lang3-3.0:
            commons-lang3-3.0.jar

            commons-logging-1.1.1:
            commons-logging-1.1.1.jar

            commons-pool-1.5.6:
            commons-pool-1.5.6.jar

            hibernate-distribution-3.6.6:
            antlr-2.7.6.jar
            commons-collections-3.1.jar
            dom4j-1.6.1.jar
            javassist-3.12.0.GA.jar
            jta-1.1.jar
            slf4j-api-1.6.1.jar
            hibernate3.jar
            hibernate-jpa-2.0-api-1.0.1.Final.jar

            junit4.8.2:
            junit-4.8.2.jar

            mockrunner-0.4.2:
            mockrunner-jdbc.jar

            Oracle 11.2.0
            ojdbc6.jar

            Sybase iAnywhere:
            jconn3.jar

            slf4j-1.6.1:
            slf4j-log4j12-1.6.1.jar

            spring-batch-2.1.8:
            spring-batch-infrastructure-2.1.8.RELEASE.jar
            spring-batch-core-2.1.8.RELEASE.jar

            spring-batch-integration-1.2.0:
            spring-batch-integration-1.2.0.RELEASE.jar

            spring-framework-3.0.5:
            org.springframework.aop-3.0.5.RELEASE.jar
            org.springframework.asm-3.0.5.RELEASE.jar
            org.springframework.aspects-3.0.5.RELEASE.jar
            org.springframework.beans-3.0.5.RELEASE.jar
            org.springframework.context-3.0.5.RELEASE.jar
            org.springframework.context.support-3.0.5.RELEASE.jar
            org.springframework.core-3.0.5.RELEASE.jar
            org.springframework.expression-3.0.5.RELEASE.jar
            org.springframework.instrument-3.0.5.RELEASE.jar
            org.springframework.instrument.tomcat-3.0.5.RELEASE.jar
            org.springframework.jdbc-3.0.5.RELEASE.jar
            org.springframework.jms-3.0.5.RELEASE.jar
            org.springframework.orm-3.0.5.RELEASE.jar
            org.springframework.transaction-3.0.5.RELEASE.jar
            org.springframework.test-3.0.5.RELEASE.jar
            org.springframework.oxm-3.0.5.RELEASE.jar

            spring-integration-2.0.5:
            spring-integration-xmpp-2.0.5.RELEASE.jar
            spring-integration-core-2.0.5.RELEASE.jar
            spring-integration-event-2.0.5.RELEASE.jar
            spring-integration-feed-2.0.5.RELEASE.jar
            spring-integration-file-2.0.5.RELEASE.jar
            spring-integration-ftp-2.0.5.RELEASE.jar
            spring-integration-groovy-2.0.5.RELEASE.jar
            spring-integration-http-2.0.5.RELEASE.jar
            spring-integration-httpinvoker-2.0.5.RELEASE.jar
            spring-integration-ip-2.0.5.RELEASE.jar
            spring-integration-jdbc-2.0.5.RELEASE.jar
            spring-integration-jms-2.0.5.RELEASE.jar
            spring-integration-jmx-2.0.5.RELEASE.jar
            spring-integration-mail-2.0.5.RELEASE.jar
            spring-integration-rmi-2.0.5.RELEASE.jar
            spring-integration-security-2.0.5.RELEASE.jar
            spring-integration-sftp-2.0.5.RELEASE.jar
            spring-integration-stream-2.0.5.RELEASE.jar
            spring-integration-test-2.0.5.RELEASE.jar
            spring-integration-twitter-2.0.5.RELEASE.jar
            spring-integration-ws-2.0.5.RELEASE.jar
            spring-integration-xml-2.0.5.RELEASE.jar

            spring-ws-2.0.2:
            spring-ws-support-2.0.2.RELEASE.jar
            spring-ws-core-2.0.2.RELEASE.jar
            spring-ws-security-2.0.2.RELEASE.jar
            spring-xml-2.0.2.RELEASE.jar

            xstream-1.3.1:
            xpp3_min-1.1.4c.jar
            xstream-1.3.1.jar
            jettison-1.0.1.jar

            Comment

            Working...
            X