Hi,
I resolved this problem by using autoReconnect=true in my dburl, but now I
am getting another weird problem. When I send message to a specific topic,
and continue to send to that topic, there is no error. However, when I send
message to topic that requires ibatis ( AgentLogin in my case ) and then
send message to another topic that does not require ibatis ( AgentLogout in
my case ), and then send another message to AgentLogin, I get error. After
the error occurs, I continue to get error no matter which topic I send the
message to. Does anyone know why? I would appreciate any help and advice
on solving this problem.
Here is the error:
payload =
<document><event><event-name>CUSTOM</event-name><action-name>consumer_start</action-name><uuid>891a5e47-da70-4551-bfcd-35c088239620</uuid><host>192.168.1.101</host><time>2009-01-11
02:25:29</time><caller-id>1000</caller-id><dest>0</dest><inbound></inbound><other-leg-uuid></other-leg-uuid><agent-sip-id>1000</agent-sip-id></event></document>
ERROR DeadLetterChannel - Failed delivery for exchangeId:
ID-localhost.localdomain/42721-1231625700365/0-2. On delivery attempt: 0
caught: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 26 ms ago.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 26 ms ago.
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
at
org.apache.camel.component.ibatis.IBatisProducer.process(IBatisProducer.java:52)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 26 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 24 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
... 32 more
DEBUG DefaultExceptionPolicyStrategy - Finding best suited exception policy
for thrown exception com.ibatis.common.jdbc.exception.NestedSQLException
DEBUG DefaultExceptionPolicyStrategy - No candidate found to be used as
exception policy
DEBUG RedeliveryPolicy - Sleeping for: 1000 millis until
attempting redelivery
ERROR DeadLetterChannel - Failed delivery for exchangeId:
ID-localhost.localdomain/42721-1231625700365/0-2. On delivery attempt: 1
caught: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 1054 ms ago.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 1054 ms ago.
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
at
org.apache.camel.component.ibatis.IBatisProducer.process(IBatisProducer.java:52)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 1054 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 24 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
... 32 more
DEBUG DefaultExceptionPolicyStrategy - Finding best suited exception policy
for thrown exception com.ibatis.common.jdbc.exception.NestedSQLException
DEBUG DefaultExceptionPolicyStrategy - No candidate found to be used as
exception policy
DEBUG RedeliveryPolicy - Sleeping for: 1000 millis until
attempting redelivery
ERROR DeadLetterChannel - Failed delivery for exchangeId:
ID-localhost.localdomain/42721-1231625700365/0-2. On delivery attempt: 2
caught: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 2063 ms ago.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 2063 ms ago.
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
at
org.apache.camel.component.ibatis.IBatisProducer.process(IBatisProducer.java:52)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 2063 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 24 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
... 32 more
DEBUG DefaultExceptionPolicyStrategy - Finding best suited exception policy
for thrown exception com.ibatis.common.jdbc.exception.NestedSQLException
DEBUG DefaultExceptionPolicyStrategy - No candidate found to be used as
exception policy
DEBUG RedeliveryPolicy - Sleeping for: 1000 millis until
attempting redelivery
ERROR DeadLetterChannel - Failed delivery for exchangeId:
ID-localhost.localdomain/42721-1231625700365/0-2. On delivery attempt: 3
caught: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 3069 ms ago.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 3069 ms ago.
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
at
org.apache.camel.component.ibatis.IBatisProducer.process(IBatisProducer.java:52)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 3069 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 24 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
... 32 more
DEBUG DefaultExceptionPolicyStrategy - Finding best suited exception policy
for thrown exception com.ibatis.common.jdbc.exception.NestedSQLException
DEBUG DefaultExceptionPolicyStrategy - No candidate found to be used as
exception policy
DEBUG RedeliveryPolicy - Sleeping for: 1000 millis until
attempting redelivery
ERROR DeadLetterChannel - Failed delivery for exchangeId:
ID-localhost.localdomain/42721-1231625700365/0-2. On delivery attempt: 4
caught: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 4077 ms ago.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 4077 ms ago.
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
at
org.apache.camel.component.ibatis.IBatisProducer.process(IBatisProducer.java:52)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 4077 ms ago.
at sun.reflect.GeneratedConstructorAccessor18.newInstance(Unknown
Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 24 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
... 32 more
DEBUG DefaultExceptionPolicyStrategy - Finding best suited exception policy
for thrown exception com.ibatis.common.jdbc.exception.NestedSQLException
DEBUG DefaultExceptionPolicyStrategy - No candidate found to be used as
exception policy
DEBUG RedeliveryPolicy - Sleeping for: 1000 millis until
attempting redelivery
ERROR DeadLetterChannel - Failed delivery for exchangeId:
ID-localhost.localdomain/42721-1231625700365/0-2. On delivery attempt: 5
caught: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 5083 ms ago.
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 5083 ms ago.
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
at
org.apache.camel.component.ibatis.IBatisProducer.process(IBatisProducer.java:52)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 5083 ms ago.
at sun.reflect.GeneratedConstructorAccessor18.newInstance(Unknown
Source)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3246)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1917)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
... 24 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3227)
... 32 more
DEBUG DefaultExceptionPolicyStrategy - Finding best suited exception policy
for thrown exception com.ibatis.common.jdbc.exception.NestedSQLException
DEBUG DefaultExceptionPolicyStrategy - No candidate found to be used as
exception policy
ERROR DeadLetterChannel -
Exchange[BodyType:com.yht.activemq.ibatis.Event,
Body:com.yht.activemq.ibatis.ev...@61562]
DEBUG DeadLetterChannel - This exchange is not handled so its
marked as failed: Exchange[JmsMessage: ActiveMQTextMessage {commandId = 7,
responseRequired = false, messageId =
ID:localhost.localdomain-40407-1231625696940-4:0:-1:1:5, originalDestination
= null, originalTransactionId = null, producerId =
ID:localhost.localdomain-40407-1231625696940-4:0:-1:1, destination =
topic://AgentLogin, transactionId = null, expiration = 0, timestamp =
1231625770024, arrival = 0, brokerInTime = 1231625770024, brokerOutTime =
1231625770024, correlationId = null, replyTo = null, persistent = false,
type = null, priority = 0, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
size = 1024, properties = null, readOnlyProperties = true, readOnlyBody =
true, droppable = false, text =
<document><event><event-name>CUSTOM</event-na...ocument>
}]
ERROR DeadLetterChannel - Failed delivery for exchangeId:
ID-localhost.localdomain/42721-1231625700365/0-2. Handled by the failure
processor: RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]
DEBUG Pipeline - Message exchange has failed so
breaking out of pipeline: Exchange[JmsMessage: ActiveMQTextMessage
{commandId = 7, responseRequired = false, messageId =
ID:localhost.localdomain-40407-1231625696940-4:0:-1:1:5, originalDestination
= null, originalTransactionId = null, producerId =
ID:localhost.localdomain-40407-1231625696940-4:0:-1:1, destination =
topic://AgentLogin, transactionId = null, expiration = 0, timestamp =
1231625770024, arrival = 0, brokerInTime = 1231625770024, brokerOutTime =
1231625770024, correlationId = null, replyTo = null, persistent = false,
type = null, priority = 0, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
size = 1024, properties = null, readOnlyProperties = true, readOnlyBody =
true, droppable = false, text =
<document><event><event-name>CUSTOM</event-na...ocument>
}] exception: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 5083 ms ago. fault: null
WARN EndpointMessageListener - Endpoint[activemq:topic:AgentLogin]
consumer caught an exception while processing JMS message:
ActiveMQTextMessage {commandId = 7, responseRequired = false, messageId =
ID:localhost.localdomain-40407-1231625696940-4:0:-1:1:5, originalDestination
= null, originalTransactionId = null, producerId =
ID:localhost.localdomain-40407-1231625696940-4:0:-1:1, destination =
topic://AgentLogin, transactionId = null, expiration = 0, timestamp =
1231625770024, arrival = 0, brokerInTime = 1231625770024, brokerOutTime =
1231625770024, correlationId = null, replyTo = null, persistent = false,
type = null, priority = 0, groupID = null, groupSequence = 0,
targetConsumerId = null, compressed = false, userID = null, content = null,
marshalledProperties = null, dataStructure = null, redeliveryCounter = 0,
size = 1024, properties = null, readOnlyProperties = true, readOnlyBody =
true, droppable = false, text =
<document><event><event-name>CUSTOM</event-na...ocument>
}
org.apache.camel.RuntimeCamelException:
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Last packet sent to the server was 5083 ms ago.
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:724)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:81)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/yht/activemq/ibatis/resource/Event.xml.
--- The error occurred while applying a parameter map.
--- Check the agentPark-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
Communications link failure
Here is my SqlMapConfig:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMapConfig
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<transactionManager type="JDBC" commitRequired="false">
<dataSource type="SIMPLE">
<property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
<property name="JDBC.ConnectionURL" value="jdbc:mysql://
192.168.1.105/app"/>
<property name="JDBC.Username" value="root"/>
<property name="JDBC.Password" value="xxx"/>
</dataSource>
</transactionManager>
<sqlMap resource="Event.xml"/>
</sqlMapConfig>
Here is my Event.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="EventHandler">
<typeAlias alias="Event" type="com.yht.activemq.ibatis.Event"/>
<typeAlias alias="Caller" type="com.yht.activemq.ibatis.Caller"/>
<resultMap id="nextCaller" class="Caller">
<result property="ip" column="host" />
<result property="uuid" column="uuid" />
</resultMap>
<!-- Insert example, using the Account parameter class -->
<insert id="agentPark" parameterClass="Event">
insert into agent_park_status (
agent_id, uuid, host, time)
Select agent_id, #uuid#,#host#, #time# from agent where sip_user =
#agentUsername#
</insert>
<delete id="agentUnpark" parameterClass="Event">
delete from agent_park_status where agent_id = (select agent_id from
agent where sip_user = #agentUsername#)
</delete>
<insert id="agentLogin" parameterClass="Event">
insert into agent_log ( agent_id,login_time, channel_uuid) select
agent_id ,
#time#,#uuid# from agent where sip_user = #agentUsername#
</insert>
<update id="agentLogout" parameterClass="Event">
update agent_log set logout_time = #time# where agent_id = (select
agent_id from agent where sip_user = #agentUsername#)
</update>
</sqlMap>
Here is my routing
<from uri="activemq:topic:AgentLogin"/>
<process ref="eventProcessor"/>
<to uri="ibatis:agentPark"/>
</route>
<route>
<from uri="activemq:topic:AgentLogout"/>
<process ref="eventProcessor"/>
</route>
<route>