Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 65015 invoked from network); 3 Aug 2010 11:59:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 Aug 2010 11:59:59 -0000 Received: (qmail 39065 invoked by uid 500); 3 Aug 2010 11:59:59 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 38681 invoked by uid 500); 3 Aug 2010 11:59:56 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 38673 invoked by uid 99); 3 Aug 2010 11:59:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 11:59:55 +0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Aug 2010 11:59:50 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OgG9a-00022n-Er for users@activemq.apache.org; Tue, 03 Aug 2010 04:59:30 -0700 Message-ID: <29334555.post@talk.nabble.com> Date: Tue, 3 Aug 2010 04:59:30 -0700 (PDT) From: Holger_ To: users@activemq.apache.org Subject: Re: SecurityException not delegated to Camel? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: sihlschm@googlemail.com References: <29305408.post@talk.nabble.com> Hi Gary, configuring sync send works great and results in the expected behaviour of Camel (i.e. the transaction is rolled back).=20 Thanks, Holger Gary Tully wrote: >=20 > If you can configure sync send on the connection factory, can do it > via the brokerURL: > vm://localhost?jms.alwaysSyncSend=3Dtrue > then the send exception will bubble back up to camel. The exception on > creating the producer will still be there as that is always send > async. > A standard javax.jms.ExceptionListener would be called if one was > registered when the async exception are received from the broker. >=20 > On 30 July 2010 13:04, Holger_ wrote: >> >> Hi, >> >> I started this topic on the camel-user list but was referred to this >> list: >> http://camel.465427.n5.nabble.com/JMS-Transactions-not-handling-Security= Exception-tp2256668p2256668.html >> >> I have a very simple Camel route consuming messages from an Active MQ >> queue >> and sending them to another one. The whole route should be transactional= , >> i.e. either the message is consumed and sent successfully or this proces= s >> is >> rolled back: >> >> from("activemq:queue:foo") >> =C2=A0 =C2=A0.transacted() >> =C2=A0 =C2=A0.to("activemq:queue:bar2"); >> >> foo is accessible by the user but bar2 is not accessible. When I send a >> message to the foo queue I get the following output: >> >> DEBUG DefaultMessageListenerContainer-1 >> org.apache.camel.component.jms.EndpointMessageListener - >> Endpoint[activemq://queue:foo] consumer receiving JMS message: >> ActiveMQTextMessage {commandId =3D 6, responseRequired =3D false, messag= eId =3D >> ID:HOLGERSNB-2175-1280308413512-2:61:1:1:1, originalDestination =3D null= , >> originalTransactionId =3D null, producerId =3D >> ID:HOLGERSNB-2175-1280308413512-2:61:1:1, destination =3D queue://foo, >> transactionId =3D TX:ID:HOLGERSNB-2175-1280308413512-2:61:1, expiration = =3D >> 0, >> timestamp =3D 1280308435389, arrival =3D 0, brokerInTime =3D 12803084353= 89, >> brokerOutTime =3D 1280308435405, correlationId =3D null, replyTo =3D nul= l, >> persistent =3D true, type =3D null, priority =3D 4, groupID =3D null, >> groupSequence >> =3D 0, targetConsumerId =3D null, compressed =3D false, userID =3D null,= content >> =3D >> null, marshalledProperties =3D null, dataStructure =3D null, >> redeliveryCounter =3D >> 0, size =3D 1039, properties =3D null, readOnlyProperties =3D true, >> readOnlyBody =3D >> true, droppable =3D false, text =3D Hello World} >> DEBUG DefaultMessageListenerContainer-1 >> org.apache.camel.spring.spi.TransactionErrorHandler - Transaction begin >> (0x1ca1837) for ExchangeId: ID:HOLGERSNB-2175-1280308413512-2:61:1:1:1 >> DEBUG DefaultMessageListenerContainer-1 >> org.apache.camel.processor.SendProcessor - >>>> >> Endpoint[activemq://queue:bar2] Exchange[JmsMessage: ActiveMQTextMessage >> {commandId =3D 6, responseRequired =3D false, messageId =3D >> ID:HOLGERSNB-2175-1280308413512-2:61:1:1:1, originalDestination =3D null= , >> originalTransactionId =3D null, producerId =3D >> ID:HOLGERSNB-2175-1280308413512-2:61:1:1, destination =3D queue://foo, >> transactionId =3D TX:ID:HOLGERSNB-2175-1280308413512-2:61:1, expiration = =3D >> 0, >> timestamp =3D 1280308435389, arrival =3D 0, brokerInTime =3D 12803084353= 89, >> brokerOutTime =3D 1280308435405, correlationId =3D null, replyTo =3D nul= l, >> persistent =3D true, type =3D null, priority =3D 4, groupID =3D null, >> groupSequence >> =3D 0, targetConsumerId =3D null, compressed =3D false, userID =3D null,= content >> =3D >> null, marshalledProperties =3D null, dataStructure =3D null, >> redeliveryCounter =3D >> 0, size =3D 1039, properties =3D null, readOnlyProperties =3D true, >> readOnlyBody =3D >> true, droppable =3D false, text =3D Hello World}] >> DEBUG DefaultMessageListenerContainer-1 >> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate - >> Executing >> callback on JMS Session: ActiveMQSession >> {id=3DID:HOLGERSNB-2175-1280308413512-2:64:1,started=3Dfalse} >> WARN VMTransport org.apache.activemq.broker.TransportConnection.Service = - >> Async error occurred: java.lang.SecurityException: User user is not >> authorized to write to: queue://bar2 >> java.lang.SecurityException: User user is not authorized to write to: >> queue://bar2 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.security.AuthorizationBroker.addProducer(Authorizati= onBroker.java:159) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.MutableBrokerFilter.addProducer(MutableBroker= Filter.java:97) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection.processAddProducer(Transp= ortConnection.java:494) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.command.ProducerInfo.visit(ProducerInfo.java:105) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection.service(TransportConnecti= on.java:300) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConn= ection.java:178) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorre= lator.java:116) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.= java:68) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:21= 0) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.jav= a:122) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:= 43) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wo= rker.runTask(Unknown >> Source) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wo= rker.run(Unknown >> Source) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.Thread.run(Unknown Source) >> DEBUG DefaultMessageListenerContainer-1 >> org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate - >> Sending >> JMS message to: queue://bar2 with message: ActiveMQTextMessage {commandI= d >> =3D >> 0, responseRequired =3D false, messageId =3D null, originalDestination = =3D >> null, >> originalTransactionId =3D null, producerId =3D null, destination =3D nul= l, >> transactionId =3D null, expiration =3D 0, timestamp =3D 0, arrival =3D 0= , >> brokerInTime =3D 0, brokerOutTime =3D 0, correlationId =3D null, replyTo= =3D >> null, >> persistent =3D true, type =3D null, priority =3D 4, groupID =3D null, >> groupSequence >> =3D 0, targetConsumerId =3D null, compressed =3D false, userID =3D null,= content >> =3D >> null, marshalledProperties =3D null, dataStructure =3D null, >> redeliveryCounter =3D >> 0, size =3D 0, properties =3D {CamelJmsDeliveryMode=3D2}, readOnlyProper= ties =3D >> false, readOnlyBody =3D false, droppable =3D false, text =3D Hello World= } >> WARN VMTransport org.apache.activemq.broker.TransportConnection.Service = - >> Async error occurred: java.lang.SecurityException: User user is not >> authorized to write to: queue://bar2 >> java.lang.SecurityException: User user is not authorized to write to: >> queue://bar2 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.security.AuthorizationBroker.send(AuthorizationBroke= r.java:182) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.= java:133) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection.processMessage(TransportC= onnection.java:446) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:6= 31) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection.service(TransportConnecti= on.java:300) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConn= ection.java:178) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorre= lator.java:116) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.= java:68) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:21= 0) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.jav= a:122) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:= 43) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wo= rker.runTask(Unknown >> Source) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wo= rker.run(Unknown >> Source) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.Thread.run(Unknown Source) >> DEBUG DefaultMessageListenerContainer-1 >> org.apache.camel.spring.spi.TransactionErrorHandler - Transaction commit >> (0x1ca1837) for ExchangeId: ID:HOLGERSNB-2175-1280308413512-2:61:1:1:1 >> WARN VMTransport org.apache.activemq.broker.TransportConnection.Service = - >> Async error occurred: java.lang.IllegalStateException: Cannot remove a >> producer that had not been registered: >> ID:HOLGERSNB-2175-1280308413512-2:64:1:1 >> java.lang.IllegalStateException: Cannot remove a producer that had not >> been >> registered: ID:HOLGERSNB-2175-1280308413512-2:64:1:1 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection.processRemoveProducer(Tra= nsportConnection.java:515) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.command.RemoveInfo.visit(RemoveInfo.java:78) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection.service(TransportConnecti= on.java:300) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConn= ection.java:178) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorre= lator.java:116) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.= java:68) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:21= 0) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.jav= a:122) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at >> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:= 43) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wo= rker.runTask(Unknown >> Source) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Wo= rker.run(Unknown >> Source) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.Thread.run(Unknown Source) >> INFO DefaultMessageListenerContainer-1 >> org.springframework.jms.listener.DefaultMessageListenerContainer - Setup >> of >> JMS message listener invoker failed for destination 'bar2' - trying to >> recover. Cause: User user is not authorized to read from: queue://bar2 >> INFO DefaultMessageListenerContainer-1 >> org.springframework.jms.listener.DefaultMessageListenerContainer - >> Successfully refreshed JMS Connection >> INFO DefaultMessageListenerContainer-2 >> org.springframework.jms.listener.DefaultMessageListenerContainer - Setup >> of >> JMS message listener invoker failed for destination 'bar2' - trying to >> recover. Cause: User user is not authorized to read from: queue://bar2 >> INFO DefaultMessageListenerContainer-2 >> org.springframework.jms.listener.DefaultMessageListenerContainer - >> Successfully refreshed JMS Connection >> >> >> The problem is that the message is consumed from the foo-queue and not >> rolled back within the transaction (the transaction commits before >> sending >> the message to the bar-queue). This seems to happen because the >> SecurityException exception is not propagated to Camel. >> >> Is there anything I am doing wrong? >> >> Thanks, >> Holger >> -- >> View this message in context: >> http://old.nabble.com/SecurityException-not-delegated-to-Camel--tp293054= 08p29305408.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> >=20 >=20 >=20 > --=20 > http://blog.garytully.com >=20 > Open Source Integration > http://fusesource.com >=20 >=20 --=20 View this message in context: http://old.nabble.com/SecurityException-not-d= elegated-to-Camel--tp29305408p29334555.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.