One of '{"http://www.mulesoft.org/schema/mule/jdbc":abstract-query}' is expected - jdbc

I am trying implement XA Transaction with oracle database connector in Mule Studio. When I try to deploy this mule application on MuleStudio server I am getting below exception.
Exception:
"Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'url' of bean class [oracle.jdbc.xa.client.OracleXADataSource]: Bean property 'url' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?"
Mule Configuration xml file:
<jdbc-ee:oracle-data-source name="Oracle_Data_Source" user="system" password="manager" url="jdbc:oracle:thin:#//localhost:1521/xe" transactionIsolation="UNSPECIFIED" doc:name="Oracle Data Source"/>
<jdbc-ee:connector name="Database" dataSource-ref="oracleJdbcBean" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/>
<jbossts:transaction-manager doc:name="Transaction Manager"/>
<spring:beans>
<spring:bean id="oracleJdbcBean" name="oracleJdbcBean" class="oracle.jdbc.xa.client.OracleXADataSource">
<spring:property name="user" value="system"/>
<spring:property name="password" value="manager"/>
<spring:property name="url" value="jdbc:oracle:thin:#localhost:1521:xe"/>
</spring:bean>
</spring:beans>
<flow name="oraclexatransactionFlow1" doc:name="oraclexatransactionFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" path="testTable" doc:name="HTTP"/>
<ee:xa-transactional action="ALWAYS_BEGIN" doc:name="Transactional">
<jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="testQuery" queryTimeout="-1" connector-ref="Database" doc:name="Database">
<xa-transaction action="ALWAYS_JOIN"/>
<jdbc-ee:query key="testQuery" value="select * from test"/>
</jdbc-ee:outbound-endpoint>
</ee:xa-transactional>
</flow>
I have followed the above configuration for other application to make xa transaction work with oracle database but I am getting different exception as below:
Caused by: org.xml.sax.SAXParseException; lineNumber: 195; columnNumber: 55; cvc-complex-type.2.4.a: Invalid content was found starting with element 'xa-transaction'. One of '{"http://www.mulesoft.org/schema/mule/jdbc":abstract-query}' is expected.
Please correct me if I configured anything wrong.

Url property should probably be
<spring:property name="url" value="jdbc:oracle:thin:#//localhost:1521/XE"/>

Uppercase of "URL" worked for me to resolve the first problem i.e.,
<spring:property name="URL" value="jdbc:oracle:thin:#localhost:1521:xe" />
And the second problem was resolved by placing the "xa-transaction" element before the query as below.
<jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="testQuery" queryTimeout="-1" connector-ref="Database" doc:name="Database">
<xa-transaction action="NONE" />
<jdbc-ee:query key="testQuery" value="select * from test" />

Related

Spring Batch - Sporadic issues with Custom FileItemWriter

We have multiple jobs running in Linux environment where jobs run in parallel. We process files with multi-hundred thousands of records in each of these batches. Following is our job steps.xml. This job runs daily but it fails sporadically. It runs 95% of times without any issues but when it fails it fails with below error. Can someone please check what is wrong with our configuration and tell how to address this?
Error:
"org.springframework.batch.item.ItemStreamException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.com.xxx.xx.batchsync.BatchsyncExtractFileItemWriter': Initialization of bean failed; nested exception is java.lang.IllegalStateException: **Not allowed to access field 'outputFile2': java.lang.IllegalAccessException: Class org.springframework.batch.core.jsr.launch.support.BatchPropertyBeanPostProcessor$1 can not access a member of class com.xxx.xx.std.StdFileItemWriter with modifiers "private"**
at org.springframework.batch.jsr.item.CheckpointSupport.open(CheckpointSupport.java:65)
at org.springframework.batch.item.support.CompositeItemStream.open(CompositeItemStream.java:96)
at org.springframework.batch.core.step.tasklet.TaskletStep.open(TaskletStep.java:310)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:197)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)
at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)
at org.springframework.batch.core.jsr.job.flow.support.state.JsrStepState.handle(JsrStepState.java:53)
at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169)
at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
at org.springframework.batch.core.jsr.job.flow.JsrFlowJob.doExecute(JsrFlowJob.java:82)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306)
at org.springframework.batch.core.jsr.launch.JsrJobOperator$2.run(JsrJobOperator.java:675)
at java.lang.Thread.run(Thread.java:809)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.com.xxx.xx.batchsync.BatchsyncExtractFileItemWriter': Initialization of bean failed; nested exception is java.lang.IllegalStateException: Not allowed to access field 'outputFile2': java.lang.IllegalAccessException: Class org.springframework.batch.core.jsr.launch.support.BatchPropertyBeanPostProcessor$1 can not access a member of class com.xxx.xx.std.StdFileItemWriter with modifiers "private"
at org.springframework.beans.factory.support.AbstractAutowireCapa"
Steps.xml:
enter code here
<step id="#{jobParameters['STEPNAME']}-Step1">
<properties>
<property name="JOB_FILE_NAME" value="BatchsyncExtract"/>
<property name="JOBNAME" value="#{jobParameters['JOBNAME']}"/>
<property name="STEPNAME" value="#{jobParameters['STEPNAME']}"/>
<property name="APPL" value="#{jobParameters['APPL']}"/>
<property name="BANK" value="#{jobParameters['BANK']}"/>
<property name="ODATE" value="#{jobParameters['ODATE']}"/>
<property name="PREVENT_JOB_RESTART" value="#{jobParameters['PREVENT_JOB_RESTART']}"/>
<property name="BATCH_ROOT" value="#{jobParameters['BATCH_ROOT']}"/>
<property name="WSBATCH_HOME" value="#{jobParameters['WSBATCH_HOME']}"/>
<property name="BATCH_LOG_FOLDER" value="#{jobParameters['BATCH_ROOT']}/batch/logs"/>
<property name="BUSINESS_MAIN" value="com.xxx.xx.BatchsyncExtractBusinessmain"/>
<property name="PROGRAM_NAME" value="IV-IpBatchsyncExtract"/>
<property name="TODAY" value="#{jobParameters['TODAY']}"/>
....
<property name="PARTITION" value="#{jobParameters['WSBATCH_HOME']}/partinfo/BatchsyncExtract_LdbidIpIdPartition_#{jobParameters['BANK']}.xml"/>
<property name="CHUNKSIZE" value="#{jobParameters['CHUNKSIZE']}" />
</properties>
<listeners>
<listener ref="com.xxx.xx.std.StdStepListener">
</listener>
<listener ref="com.xxx.xx.std.StdChunkListener">
</listener>
</listeners>
<chunk checkpoint-policy="custom" >
<reader ref="com.xxx.xx.BatchsyncExtractInputBDS">
</reader>
<processor ref="com.xxx.xx.std.StdJobStepCursorBased"/>
<writer ref="com.xxx.xx.BatchsyncExtractFileItemWriter">
<properties>
<property name="outputFile1" value="#{jobParameters['BATCH_ROOT']}/batch/import/#{jobParameters['APPL']}/batchsync_extract_#{jobParameters['BANK']}_#{jobParameters['ODATE']}_#{jobParameters['RUN']};default;default" />
<property name="outputFile2" value="#{jobParameters['BATCH_ROOT']}/batch/import/#{jobParameters['APPL']}/batchsync_extract_totals_#{jobParameters['BANK']}_#{jobParameters['ODATE']}_#{jobParameters['RUN']};default;default" />
</properties>
</writer>
<checkpoint-algorithm ref="com.xxx.xx.batch.utils.CustomCheckPointAlgoritmn">
<properties>
<property name="chunkSize" value="#{jobParameters['CHUNKSIZE']}" />
<!--property name="timeInterval" value="#{jobParameters['TIMEINTERVAL']}" /-->
</properties>
</checkpoint-algorithm>
</chunk>
</step>

Spring-integration-ftp polls file even when my application is stopped

As a follow up to the question -
Same file gets picked up again and again in spring-ftp but with different names
I have the following configuration in my application.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:int="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:file="http://www.springframework.org/schema/integration/file"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/file
http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
http://www.springframework.org/schema/integration/ftp
http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<int:poller id="poller" task-executor="synchTaskExecutor" default="true" fixed-delay="1000" />
<beans:bean id="ftpClientFactory"
class="com.everge.springframework.integration.ftp.session.EvergeFtpSessionFactory">
<beans:property name="host" value="111.93.128.170"/>
<beans:property name="port" value="21"/>
<beans:property name="username" value="singha"/>
<beans:property name="password" value="singha16"/>
<beans:property name="clientMode" value="2"></beans:property>
</beans:bean>
<beans:bean id="ftpOutClientFactory"
class="org.springframework.integration.ftp.session.DefaultFtpSessionFactory">
<beans:property name="host" value="111.93.128.170"/>
<beans:property name="port" value="21"/>
<beans:property name="username" value="singha"/>
<beans:property name="password" value="singha16"/>
<beans:property name="clientMode" value="2"></beans:property>
</beans:bean>
<beans:bean id="synchTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<beans:property name="corePoolSize" value="1"></beans:property>
<beans:property name="maxPoolSize" value="1"></beans:property>
<beans:property name="queueCapacity" value="1"></beans:property>
</beans:bean>
<beans:bean id="pqqFtpClientFactory"
class="com.everge.springframework.integration.ftp.session.PqqEvergeFtpSessionFactory">
<beans:property name="host" value="111.93.128.170"/>
<beans:property name="port" value="21"/>
<beans:property name="username" value="singha"/>
<beans:property name="password" value="singha16"/>
<beans:property name="clientMode" value="2"></beans:property>
</beans:bean>
<int:channel id="ftpChannel">
<int:queue/>
</int:channel>
<beans:bean id="acceptAllFileListFilter" class="com.everge.file.processing.EvergeFileListFilter"/>
<beans:bean id="pqqHandler" class="com.everge.pqq.PqqFileHandler">
<beans:property name="config" ref="baseConfig"></beans:property>
</beans:bean>
<beans:bean id="handler" scope="prototype" class="com.everge.integration.client.FileHandler">
<beans:property name="config" ref="baseConfig"></beans:property>
</beans:bean>
<beans:bean id="baseConfig" class="com.everge.config.BaseConfig" />
<beans:bean id="ftpSplitter" class="com.everge.service.FtpSplitter" />
<beans:bean id="fileSplitter" class="com.everge.file.processing.FileSplitter" />
<int-ftp:outbound-channel-adapter id="notifFtpOutBound"
channel="pl"
remote-directory="/ADPWG/PRCSD1"
session-factory="ftpOutClientFactory" auto-startup="true">
<int-ftp:request-handler-advice-chain>
<int:retry-advice />
</int-ftp:request-handler-advice-chain>
</int-ftp:outbound-channel-adapter>
<int-ftp:outbound-channel-adapter id="ftpOutbound"
channel="pqqOutputFileChannel"
remote-directory="/ADPWG/PRCSD"
session-factory="ftpOutClientFactory" auto-startup="true">
<int-ftp:request-handler-advice-chain>
<int:retry-advice />
</int-ftp:request-handler-advice-chain>
</int-ftp:outbound-channel-adapter>
<file:inbound-channel-adapter prevent-duplicates="false" id="filesIn1" directory="file:/Users/abhisheksingh/ddrive/everge_ws/f" auto-startup="true">
<int:poller id="poller" task-executor="synchTaskExecutor" fixed-delay="1000"></int:poller>
</file:inbound-channel-adapter>
<int:service-activator input-channel="filesIn1" ref="handler" />
<file:inbound-channel-adapter prevent-duplicates="false" id="pqqInputFileChannel" directory="file:/Users/abhisheksingh/ddrive/everge_ws/pqqReq" auto-startup="true">
<int:poller id="poller" task-executor="synchTaskExecutor" fixed-delay="1000" />
</file:inbound-channel-adapter>
<int:service-activator input-channel="pqqInputFileChannel" ref="pqqHandler" />
<file:inbound-channel-adapter id="pqqOutputFileChannel" directory="/Users/abhisheksingh/ddrive/everge_ws/pqqResp">
<int:poller id="poller" task-executor="synchTaskExecutor" fixed-delay="10000" />
</file:inbound-channel-adapter>
<int-ftp:inbound-channel-adapter id="ftpInbound"
channel="ftpChannel"
session-factory="ftpClientFactory"
auto-create-local-directory="true"
delete-remote-files="false"
local-filter="acceptAllFileListFilter"
local-directory="file:/Users/abhisheksingh/ddrive/everge_ws/f" auto-startup="true" >
<int:poller id="poller" task-executor="synchTaskExecutor" fixed-delay="1000" />
</int-ftp:inbound-channel-adapter>
<int-ftp:inbound-channel-adapter id="pqqFtpInbound"
channel="ftpChannel"
session-factory="pqqFtpClientFactory"
auto-create-local-directory="true"
delete-remote-files="false"
local-filter="acceptAllFileListFilter"
local-directory="file:/Users/abhisheksingh/ddrive/everge_ws/pqqReq" auto-startup="true" >
<int:poller id="poller" task-executor="synchTaskExecutor" fixed-delay="1000" />
</int-ftp:inbound-channel-adapter>
<file:inbound-channel-adapter id="pl" directory="file:/Users/abhisheksingh/ddrive/everge_ws/notifFile" auto-startup="true">
<int:poller id="poller" task-executor="synchTaskExecutor" fixed-delay="1000" />
</file:inbound-channel-adapter>
</beans:beans>
So there is a ftp location which I poll and the polled file gets placed at the following directory on my local machine-
/Users/abhisheksingh/ddrive/test/f
Now sometimes because I found a bug and have to fix it, I stop the tomcat server. I delete the files from my local so that next time I start my server , the same file can be polled again. But I find that the same file gets polled again. My server is stopped! This should not happen as far as I know. Thats why I have posted my application.xml to know if there is something here which keeps the threads hanging. Or is it that the spring-integration-ftp starts a daemon thread which does not depend on the application. Please let me solve this riddle.
I see the following exception in the tomcat logs -
Feb 17, 2017 11:49:24 PM org.apache.catalina.loader.WebappClassLoaderBase loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load UNIX Type: L8. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1777)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory.createFileEntryParser(DefaultFTPFileEntryParserFactory.java:88)
at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:2263)
at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2046)
at org.springframework.integration.ftp.session.FtpSession.list(FtpSession.java:70)
at org.springframework.integration.ftp.session.FtpSession.list(FtpSession.java:43)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:236)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:232)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:435)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:232)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:193)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:59)
at org.springframework.integration.endpoint.AbstractMessageSource.receive(AbstractMessageSource.java:134)
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:224)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:245)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:58)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:190)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:186)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:353)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:51)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:344)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
I am pretty much sure at this point that the spring-integration ftp poller does not let the tomcat stop properly.
I did investigate more using jvisualvm. I see that there are task-scheduler threads started which do not close with ./shutdown.sh call to stop the tomcat.
Interesting thing to observe is that if I remove either of the pl or pqqOutputFileChannel adapter, these schedulers dont get created.
Here is the structure of my ear file -
Following is the log which keeps on rolling in the log file even when
shutdown has been called on the tomcat -
541576 DEBUG o.s.i.c.PublishSubscribeChannel - postSend (sent=true) on
channel 'errorChannel', message: ErrorMessage
[payload=org.springframework.core.task.TaskRejectedException: Executor
[java.util.concurrent.ThreadPoolExecutor#6d6033da[Running, pool size =
1, active threads = 0, queued tasks = 0, completed tasks = 1114]] did
not accept task:
org.springframework.integration.util.ErrorHandlingTaskExecutor$1#570e117d,
headers={id=71d77a8b-17ea-7011-3cb3-ddbf7591321f,
timestamp=1487870801603}] 541575 DEBUG o.s.i.c.PublishSubscribeChannel
- postSend (sent=true) on channel 'errorChannel', message: ErrorMessage
[payload=org.springframework.core.task.TaskRejectedException: Executor
[java.util.concurrent.ThreadPoolExecutor#6d6033da[Running, pool size =
1, active threads = 0, queued tasks = 1, completed tasks = 1113]] did
not accept task:
org.springframework.integration.util.ErrorHandlingTaskExecutor$1#44210f79,
headers={id=74a26d65-4b42-da1f-cdf1-b77fea8bfdb7,
timestamp=1487870801603}] 541576 ERROR o.s.i.handler.LoggingHandler -
org.springframework.core.task.TaskRejectedException: Executor
[java.util.concurrent.ThreadPoolExecutor#6d6033da[Running, pool size =
1, active threads = 0, queued tasks = 1, completed tasks = 1113]] did
not accept task:
org.springframework.integration.util.ErrorHandlingTaskExecutor$1#7d7cc2a4
at
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.execute(ThreadPoolTaskExecutor.java:296)
at
org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:51)
at
org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:344)
at
org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at
org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) Caused by:
java.util.concurrent.RejectedExecutionException: Task
org.springframework.integration.util.ErrorHandlingTaskExecutor$1#7d7cc2a4
rejected from
java.util.concurrent.ThreadPoolExecutor#6d6033da[Running, pool size =
1, active threads = 0, queued tasks = 1, completed tasks = 1113] at
java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
at
java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
at
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.execute(ThreadPoolTaskExecutor.java:293)
... 11 more
**541576 DEBUG o.s.i.c.PublishSubscribeChannel - postSend (sent=true) on channel 'errorChannel', message: ErrorMessage
[payload=org.springframework.core.task.TaskRejectedException: Executor
[java.util.concurrent.ThreadPoolExecutor#6d6033da[Running, pool size =
1, active threads = 0, queued tasks = 1, completed tasks = 1113]] did
not accept task:
org.springframework.integration.util.ErrorHandlingTaskExecutor$1#7d7cc2a4,
headers={id=26e6de67-2b70-cd7d-0c64-d21e1f8d1726,
timestamp=1487870801603}] 541611 DEBUG
c.e.s.i.f.s.PqqEvergeFtpSessionFactory - Connected to server
[111.93.128.170:21] 541638 INFO
c.e.s.i.f.s.PqqEvergeFtpSessionFactory - Inside
postProcessClientAfterConnect of PqqEvergeFtpSessionFactory 541778
INFO o.s.i.ftp.session.FtpSession - File has been successfully
transferred from: TEST4.PQQ 541778 DEBUG
o.s.i.f.i.FtpInboundFileSynchronizer - 1 files transferred 541779 INFO
c.e.f.p.EvergeFileListFilter - Check if the file has already been
processed /Users/abhisheksingh/ddrive/everge_ws/pqqArchive/TEST4.PQQ
541779 INFO c.e.f.p.EvergeFileListFilter - Archive file name is
541779 INFO c.e.f.p.EvergeFileListFilter - Input file name is TEST4
541779 INFO c.e.f.p.EvergeFileListFilter - Archive file name is TEST4
541779 INFO c.e.f.p.EvergeFileListFilter - Input file name is TEST4
541779 INFO c.e.f.p.EvergeFileListFilter - The file is already
processed TEST4 541779 ERROR c.e.f.p.EvergeFileListFilter - PQQ file
has already been processed. 541779 DEBUG
o.s.i.e.SourcePollingChannelAdapter - Received no Message during the
poll, returning 'false' 541974 DEBUG
o.s.i.e.SourcePollingChannelAdapter - Received no Message during the
poll, returning 'false'

How to fix java.lang.IllegalArgumentException: null source?

In mule flow, I have configured XA datasource for XA transaction as following and also jboss transaction management
<jbossts:transaction-manager doc:name="Transaction Manager">
<property key="com.arjuna.ats.arjuna.coordinator.defaultTimeout"
value="3000" />
<property key="com.arjuna.ats.arjuna.coordinator.txReaperTimeout"
value="300000" />
</jbossts:transaction-manager>
<spring:beans>
<spring:bean id="mySqlXADataSource" name="MySqlXADataSource"
class="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource">
<spring:property name="user" value="${ftp.db.user}" />
<spring:property name="password" value="${ftp.db.password}" />
<spring:property name="url"
value="${ftp.db.url}" />
</spring:bean>
</spring:beans>
<jdbc-ee:connector name="FTPDatabase" dataSource-ref="mySqlXADataSource"
validateConnections="true" queryTimeout="-1" pollingFrequency="0"
doc:name="Database">
<reconnect blocking="false" frequency="10000" count="3" />
</jdbc-ee:connector>
But i am facing following exception at runtime
Exception stack is:
1. null source (java.lang.IllegalArgumentException)
java.util.EventObject:56 (null)
2. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=jdbc://FetchFTPConfig, connector=EEJdbcConnector
{
name=FTPDatabase
lifecycle=start
this=3dbe005a
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=false
connected=true
supportedProtocols=[jdbc]
serviceOverrides=<none>
}
, name='endpoint.jdbc.FetchFTPConfig', mep=REQUEST_RESPONSE, properties={queryTimeout=-1, queries=merged: {FetchFTPConfig=SELECT SRC.C_BSF_ACKNWLDGMNT AS C_BSF_ACKNWLDGMNT, FTP.C_BFA_IPADDR AS C_BFA_IPADDR, FTP.C_BFA_PORT AS C_BFA_PORT, FTP.C_BFA_OWNR AS C_BFA_OWNR, FTP.C_BFA_PATH AS C_BFA_PATH, FTP.C_BFA_PSSWRD AS C_BFA_PSSWRD, FTP.C_BFA_USRNM AS C_BFA_USRNM,SRC.C_BSF_FILE_TYPE_ID AS C_BSF_FILE_TYPE_ID from T_BMRS_SRC_FILES AS SRC,T_BMRS_FILETYPE AS FTYPE,T_BMRS_FTP_ACCNTS FTP where SRC.C_BSF_FILE_TYPE_ID=FTYPE.C_BFT_ID and FTYPE.C_BFT_BFA_KEY=FTP.C_BFA_KEY and SRC.C_BSF_FILE_UNIQUEID=#[flowVars.FileId];}}, transactionConfig=Transaction{factory=org.mule.transaction.XaTransactionFactory#3726423c, action=BEGIN_OR_JOIN, timeout=30000}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: NotifyESBRequest (org.mule.api.transport.DispatchException)
org.mule.transport.AbstractMessageDispatcher:105 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(EventObject.java:56)
at javax.sql.StatementEvent.<init>(StatementEvent.java:64)
at com.mysql.jdbc.jdbc2.optional.JDBC4PreparedStatementWrapper.close(JDBC4PreparedStatementWrapper.java:70)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
Mysql connector i am using is mysql-connector-java-5.1.36 jar.

How to pass Mule expression to spring property

I'm looking for a way to assign an exception message to spring property at runtime in mule flow (Mule 3.3.0)
This is how my code-snippet looks like:
<catch-exception-strategy>
<logger message="----->Exception is #[exception.causeException]"
level="INFO" />
<custom-transformer
class="com.company.transformer.VelocityMessageTransformer">
<spring:property name="velocityEngine" ref="velocityEngine" />
<spring:property name="templateName" value="soap11Fault.vm" />
<spring:property name="beanClass">
<spring:bean parent="abstractSoap11ClientFault">
<spring:property name="faultString" value="Invalid Request" />
<spring:property name="detail" value="${exception.causeException}" />
</spring:bean>
</spring:property>
</custom-transformer>
</catch-exception-strategy>
I want to assign exception cause to detail property here:
<spring:property name="detail" value="${exception.causeException}" />
but spring is looking for this property in properties file. I tried doing this also
<spring:property name="detail" value="${#[exception.causeException]}" /> but doesn't work.
Is there a way to pass Mule expression at run-time to Spring property?
Properties are set during the application initialization: the value you want to pass is evaluated at runtime, so that can't work.
What you need to do is make com.company.transformer.VelocityMessageTransformer extend org.mule.transformer.AbstractMessageTransformer. You will then have to override transformMessage(MuleMessage message, String outputEncoding), which will give you access to the current message and its associated exception payload. The exception payload is what you get with the #[exception] expression.

Mybatis configuration with typeAliases

I'm developing a Java EE application based on Mybatis 3.0.5, Mybatis-spring 1.0.1 and Spring 3.0.5.RELEASE and I've found a problem using Alias in mybatis-config.xml. The trace is:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sqlSessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
Invocation of init method failed; nested exception is org.springframework.core.NestedIOException:
Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException:
Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException:
Error registering typeAlias for 'accesoUsuario'. Cause: java.lang.ClassNotFoundException:
Cannot find class: [PACKAGE OMITTED BY ME].AccesoUsuario
How can I resolve this problem?
This is my mybatis-config.xml (MYPACKAGE = es.my.package).
<settings>
<setting name="lazyLoadingEnabled" value="false" />
</settings>
<typeAliases>
<typeAlias alias="accesoUsuario" type="MYPACKAGE.persistencia.entidades.AccesoUsuario" />
<typeAlias alias="agrupacion" type="MYPACKAGE.persistencia.entidades.Agrupacion" />
<typeAlias alias="consulta" type="MYPACKAGE.persistencia.entidades.Consulta" />
<typeAlias alias="consultaDim" type="MYPACKAGE.persistencia.entidades.ConsultaDim" />
<typeAlias alias="consultaFiltro" type="MYPACKAGE.persistencia.entidades.ConsultaFiltro" />
<typeAlias alias="dato" type="MYPACKAGE.persistencia.entidades.Dato" />
<typeAlias alias="dimension" type="MYPACKAGE.persistencia.entidades.Dimension" />
<typeAlias alias="dominio" type="MYPACKAGE.persistencia.entidades.Dominio" />
<typeAlias alias="dominioDep" type="MYPACKAGE.persistencia.entidades.DominioDep" />
<typeAlias alias="entidad" type="MYPACKAGE.persistencia.entidades.Entidad" />
<typeAlias alias="error" type="MYPACKAGE.persistencia.entidades.ErrorProceso" />
<typeAlias alias="informe" type="MYPACKAGE.persistencia.entidades.Informe" />
<typeAlias alias="informeCabecera" type="MYPACKAGE.persistencia.entidades.InformeCabecera" />
<typeAlias alias="informeSeccion" type="MYPACKAGE.persistencia.entidades.InformeSeccion" />
<typeAlias alias="restriVariable" type="MYPACKAGE.persistencia.entidades.RestriVariable" />
<typeAlias alias="usuario" type="MYPACKAGE.persistencia.entidades.Usuario" />
<!-- ... -->
<typeAlias alias="cadena" type="java.lang.String" />
</typeAliases>
Without seeing some of the actual source code, I doubt we can pinpoint any errors, but it might help to take a look at this example on DZone.
One thing they point out in particular is that if you do not follow the correct order in the mybatis-config.xml file, it can cause an exception. It could be that something is just in the wrong place in that file.
If you want to post more of the code, I can try to be of more help.
You package is no available for myBatis. You need to define it using configuration:
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="es.your.packacke"/>
</bean>

Resources