You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by hammod <mh...@gmail.com> on 2017/03/23 15:58:11 UTC

Unable to Catch an Exception in Netty

I have a Netty interface that accepts a message and puts this message in a
queue (ActiveMQ), if the connection to the queue is down while camel is
running then there is an exception happening in Netty after receiving the
caller's message that I can't catch in any OnException and any ErrorHandler,
I tried using LoadBalance and failover but still the same issue, the problem
in this case is the caller is waiting until timeout and even if the
connection to the queue is restored, Camel is losing the caller's message
and not continuing the route ( which is the worst issue).

My Routes : 

		<route id="GetHl7Request">
			<from uri="hl7listener" />
			<transacted />
			<multicast>
				<to uri="direct:SaveRequestInMQChannel" />
				<to uri="direct:AckToOrderSrcChannel" />
			</multicast>
		</route>

		<route id="SendRequestToMQ">
			<from uri="direct:SaveRequestInMQChannel" />
			<inOnly uri="inboundMQ" />
			<log logName="{{camel.general.info.logname}}" loggingLevel="INFO"
				message="HL7 Request from OrderSrc has been Saved to MQ" />
		</route>

		<route id="AckToOrderSrcHL7Request">
			<from uri="direct:AckToOrderSrcChannel" />
			<to uri="bean:HL7Processor?method=sendAckToOrderSrc" />
		</route>

Stack Trace :

[ #22 - NettyEventExecutorGroup] TransactionErrorHandler        WARN 
Transaction rollback (0x443253a6) redelivered(unknown) for (MessageId:
ID-Mohammadt-460-57273-1490283881916-0-1 on ExchangeId:
ID-Mohammadt-460-57273-1490283881916-0-2) caught: Could not create JMS
transaction; nested exception is javax.jms.JMSException: Error while
attempting to add new Connection to the pool
[ead #21 - NettyServerTCPWorker] NettyConsumer                  WARN  Caused
by: [org.apache.camel.CamelExchangeException - Cannot write response to
/127.0.0.1:57441. Exchange[ID-Mohammadt-460-57273-1490283881916-0-2]. Caused
by: [io.netty.handler.codec.EncoderException -
org.springframework.transaction.CannotCreateTransactionException: Could not
create JMS transaction; nested exception is javax.jms.JMSException: Error
while attempting to add new Connection to the pool]]
org.apache.camel.CamelExchangeException: Cannot write response to
/127.0.0.1:57441. Exchange[ID-Mohammadt-460-57273-1490283881916-0-2]. Caused
by: [io.netty.handler.codec.EncoderException -
org.springframework.transaction.CannotCreateTransactionException: Could not
create JMS transaction; nested exception is javax.jms.JMSException: Error
while attempting to add new Connection to the pool]
	at
org.apache.camel.component.netty4.handlers.ServerResponseFutureListener.operationComplete(ServerResponseFutureListener.java:54)
[camel-netty4-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerResponseFutureListener.operationComplete(ServerResponseFutureListener.java:36)
[camel-netty4-2.18.2.jar:2.18.2]
	at
io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:507)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:481)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:420)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:122)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.internal.PromiseNotificationUtil.tryFailure(PromiseNotificationUtil.java:64)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.notifyOutboundHandlerException(AbstractChannelHandlerContext.java:837)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:741)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:731)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:38)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1090)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:1137)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1079)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:445)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
Caused by: io.netty.handler.codec.EncoderException:
org.springframework.transaction.CannotCreateTransactionException: Could not
create JMS transaction; nested exception is javax.jms.JMSException: Error
while attempting to add new Connection to the pool
	at
io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:125)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:739)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	... 10 more
Caused by: org.springframework.transaction.CannotCreateTransactionException:
Could not create JMS transaction; nested exception is
javax.jms.JMSException: Error while attempting to add new Connection to the
pool
	at
org.springframework.jms.connection.JmsTransactionManager.doBegin(JmsTransactionManager.java:216)
~[spring-jms-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:114)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:138)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:109)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:354)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	... 2 more
Caused by: javax.jms.JMSException: Error while attempting to add new
Connection to the pool
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createJmsException(PooledConnectionFactory.java:266)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:225)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:204)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.springframework.jms.connection.JmsTransactionManager.createConnection(JmsTransactionManager.java:288)
~[spring-jms-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.jms.connection.JmsTransactionManager.doBegin(JmsTransactionManager.java:186)
~[spring-jms-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:114)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:138)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:109)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:354)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	... 2 more
Caused by: javax.jms.JMSException: Could not connect to broker URL:
tcp://localhost:61616. Reason: java.net.ConnectException: Connection
refused: connect
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:374)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:275)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:95)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:92)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1041)
~[commons-pool2-2.4.2.jar:2.4.2]
	at
org.apache.commons.pool2.impl.GenericKeyedObjectPool.addObject(GenericKeyedObjectPool.java:1221)
~[commons-pool2-2.4.2.jar:2.4.2]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:221)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:204)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.springframework.jms.connection.JmsTransactionManager.createConnection(JmsTransactionManager.java:288)
~[spring-jms-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.jms.connection.JmsTransactionManager.doBegin(JmsTransactionManager.java:186)
~[spring-jms-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:114)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:138)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:109)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:354)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	... 2 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
~[?:1.8.0_91]
	at
java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
~[?:1.8.0_91]
	at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
~[?:1.8.0_91]
	at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
~[?:1.8.0_91]
	at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
~[?:1.8.0_91]
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[?:1.8.0_91]
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[?:1.8.0_91]
	at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_91]
	at
org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:525)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:488)
~[activemq-client-5.14.3.jar:5.14.3]
	at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.transport.AbstractInactivityMonitor.start(AbstractInactivityMonitor.java:169)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.transport.InactivityMonitor.start(InactivityMonitor.java:52)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:354)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244)
~[activemq-client-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:275)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:95)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory$1.makeObject(PooledConnectionFactory.java:92)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.commons.pool2.impl.GenericKeyedObjectPool.create(GenericKeyedObjectPool.java:1041)
~[commons-pool2-2.4.2.jar:2.4.2]
	at
org.apache.commons.pool2.impl.GenericKeyedObjectPool.addObject(GenericKeyedObjectPool.java:1221)
~[commons-pool2-2.4.2.jar:2.4.2]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:221)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.apache.activemq.jms.pool.PooledConnectionFactory.createConnection(PooledConnectionFactory.java:204)
~[activemq-jms-pool-5.14.3.jar:5.14.3]
	at
org.springframework.jms.connection.JmsTransactionManager.createConnection(JmsTransactionManager.java:288)
~[spring-jms-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.jms.connection.JmsTransactionManager.doBegin(JmsTransactionManager.java:186)
~[spring-jms-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
~[spring-tx-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:176)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:136)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:105)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:114)
~[camel-spring-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
~[camel-core-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:138)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:109)
~[camel-netty4-2.18.2.jar:2.18.2]
	at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:38)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:354)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	at
io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
~[netty-all-4.1.7.Final.jar:4.1.7.Final]
	... 2 more



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by hammod <mh...@gmail.com>.
Any help ?



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796302.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by hammod <mh...@gmail.com>.
I found this thread also, so maybe it is a bug in Camel.
http://camel.465427.n5.nabble.com/exception-handling-of-transacted-servlet-route-td5779274.html



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796446.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by hammod <mh...@gmail.com>.
doTry didn't help either, as the error "Could not create JMS transaction" I
think is happening before starting the route, so it is not being caught in
doCatch or ErrorHandlers 



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796445.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by hammod <mh...@gmail.com>.
doTry didn't help either, as the error "Could not create JMS transaction" I
think is happening before starting the route, so it is not being caught in
doCatch or ErrorHandlers



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796447.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by souciance <so...@gmail.com>.
What happens if you add a doTry() and doCatch(Exception.class) around the
part which throws the exception? Does this catch the exception?

On Mon, Mar 27, 2017 at 9:38 PM, hammod [via Camel] <
ml-node+s465427n5796442h65@n5.nabble.com> wrote:

> I found this thread, it is the same problem I think, also the OP in that
> thread said he is getting exception handling working when he is removing
> transaction notation
> http://camel.465427.n5.nabble.com/Problem-with-exception-
> handler-onException-on-Camel-2-12-X-routes-td5742605.html
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-
> tp5796040p5796442.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796443.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by hammod <mh...@gmail.com>.
I found this thread, it is the same problem I think, also the OP in that
thread said he is getting exception handling working when he is removing
transaction notation 
http://camel.465427.n5.nabble.com/Problem-with-exception-handler-onException-on-Camel-2-12-X-routes-td5742605.html



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796442.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by hammod <mh...@gmail.com>.
		<onException>
			<exception>java.lang.Exception</exception>
			<handled>
				<constant>true</constant>
			</handled>
			<log logName="Exception" loggingLevel="ERROR"
				message="An Exception Happened While Trying to Receive the Message" />
			<to uri="bean:HL7Proc?method=sendArReply" />
		</onException>



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796441.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by souciance <so...@gmail.com>.
Can you share your OnException code as well`?

On Mon, Mar 27, 2017 at 9:16 PM, hammod [via Camel] <
ml-node+s465427n5796438h41@n5.nabble.com> wrote:

> I just found that the OnExcpetion is working when I remove the
> <transacted/> part form the routes, unfortunately I need this route to be
> transacted
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-
> tp5796040p5796438.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796440.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unable to Catch an Exception in Netty

Posted by hammod <mh...@gmail.com>.
I just found that the OnExcpetion is working when I remove the <transacted/>
part form the routes, unfortunately I need this route to be transacted 



--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-Catch-an-Exception-in-Netty-tp5796040p5796438.html
Sent from the Camel - Users mailing list archive at Nabble.com.