You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "massive.boisson" <ma...@gmail.com> on 2006/11/01 00:17:42 UTC

Re: receiving async exception when not appropriate

I tried to test this with ActiveMQ 4.0.1 and regular security settings as per
page: http://incubator.apache.org/activemq/security.html, and I received the
same results as in previous attempt - I receive asynch exception after send
executes without exception as if message has been indeed sent.

Any ideas what's going on?

--MB


massive.boisson wrote:
> 
> Hi,
> 
> I am using AMQs securty with ssl authorization and authentication features
> provided by recent changes to AMQ 4.1. So I am in fact using what Sepand
> and my collegue ngcutura have done recently. 
> 
> When I send a message to queue that I have no privilages to neither create
> nor write to (the queue does not even exist to begin with), the call to
> amqProducer.send(myDest, jmsMessage) passes successfully! 
> I only get exception throught exception listener. Obviously this is a big
> problem for me, because my program continiues to function as if all is ok,
> loosing the data from the message that it thought it sent. 
> 
> The url my clien connects to is:
> failover:(ssl://localhost:61616)?soTimeout=10000&connectionTimeout=0&trace=false&jms.closeTimeout=15000&jms.useAsyncSend=false&jms.copyMessageOnSend=false&jms.optimizeAcknowledge=false&wireFormat.maxInactivityDuration=30000&wireFormat.stackTraceEnabled=true&wireFormat.tightEncodingEnabled=true
> 
> Well long, but it does say: jms.useAsyncSend=false!
> 
> The async exception I get is:
> javax.jms.JMSException: User KB is not authorized to write to:
> queue://APPLICATIONS
> 	at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:46)
> 	at
> org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1487)
> 	at
> org.apache.activemq.ActiveMQConnection$2.run(ActiveMQConnection.java:1460)
> 	at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.SecurityException: User KB is not authorized to write
> to: queue://APPLICATIONS
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
> 	at
> org.apache.activemq.openwire.v2.BaseDataStreamMarshaller.createThrowable(BaseDataStreamMarshaller.java:216)
> 	at
> org.apache.activemq.openwire.v2.BaseDataStreamMarshaller.tightUnmarsalThrowable(BaseDataStreamMarshaller.java:176)
> 	at
> org.apache.activemq.openwire.v2.ConnectionErrorMarshaller.tightUnmarshal(ConnectionErrorMarshaller.java:69)
> 	at
> org.apache.activemq.openwire.OpenWireFormat.doUnmarshal(OpenWireFormat.java:349)
> 	at
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:275)
> 	at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:136)
> 	at java.lang.Thread.run(Unknown Source)
> 
> 
> Any ideas what is going on? I looked for the similar bug on the JIRA, but
> found none. 
> 
> Is this intended behaviour?
> 
> --MB
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/receiving-async-exception-when-not-appropriate-tf2545596.html#a7105036
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: receiving async exception when not appropriate

Posted by "massive.boisson" <ma...@gmail.com>.
Thanks for reply, I guess it's only because of the usual promptness of team
ActiveMQ, that I was so confused with lack of reply. 



nmittler wrote:
> 
> What exactly do you expect to happen when you send to a queue that you're
> not authorized to send on?  I don't think it's acceptable to throw an
> exception from within the send() method, because that would require
> waiting
> for the broker to respond to the message before proceeding - essentially
> making the model RPC rather than messaging.
> 
Hm, as I am using persistent queues and transacted sync sends, don't I have
to wait for it to be written anyway? I don't think this makes it RPC model.


nmittler wrote:
> 
> So if you don't want to lose the data in the message, you'll have to know
> what destinations you have write permissions on before sending.
> 
As a workarround I could do this, but I don't know how. My queues are
created dynamically, and permissons are given dynamically, and thus I cannot
know this unless there is a dynamic way to check. And I have not been able
to find one?

Another possible workarround would be if feature I requested some time ago
would be implented:  https://issues.apache.org/activemq/browse/AMQ-751
https://issues.apache.org/activemq/browse/AMQ-751 . Essentially it would
allow onException method to receive the offending message as well. 

But primarily, I still think persistent transacted synch send to a queue
should fail if I dont have write privileges for that queue. No?!

I've been using jms for only 4 months, so I am by no means an expert. Let me
know if I am talking nonsense.

Thanks a lot and regards, 

--MB
-- 
View this message in context: http://www.nabble.com/receiving-async-exception-when-not-appropriate-tf2545596.html#a7306428
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: receiving async exception when not appropriate

Posted by Nathan Mittler <na...@gmail.com>.
After reading your JIRA issue a little closer, it looks like this is a
different problem ...  so don't bother testing out that buid.

What exactly do you expect to happen when you send to a queue that you're
not authorized to send on?  I don't think it's acceptable to throw an
exception from within the send() method, because that would require waiting
for the broker to respond to the message before proceeding - essentially
making the model RPC rather than messaging.

So if you don't want to lose the data in the message, you'll have to know
what destinations you have write permissions on before sending.

Does this make sense?

Regards,
Nate

On 11/12/06, Nathan Mittler <na...@gmail.com> wrote:
>
> Hi,
> Appologies that no one has responded - the AMQ developer community is a
> busy bunch and as a result, an occasional e-mail gets dropped in the shuffle
> :(.
>
> The good news is that others have been raising this problem as well.  I
> took a crack at a fix from the latest trunk build (as of yesterday).  The
> tarball is here:
>
> http://people.apache.org/~nmittler/<http://people.apache.org/%7Enmittler/>apache-activemq-4.2-incubator-SNAPSHOT.tar.gz
>
> <http://people.apache.org/%7Enmittler/apache-activemq-4.2-incubator-SNAPSHOT.tar.gz>
>
> Please give it a try and let me know how it goes.
>
> Thanks,
> Nate
>
> On 11/12/06, massive.boisson <ma...@gmail.com> wrote:
> >
> >
> > Dear good people of ActiveMQ, I am begging you for any comment on this
> > problem. It's been 2 weeks since I raised JIRA  (
> > https://issues.apache.org/activemq/browse/AMQ-1022
> > https://issues.apache.org/activemq/browse/AMQ-1022 ).
> >
> > Any thoughts?
> >
> > Thanks,
> >
> > --MB
> >
> >
> > massive.boisson wrote:
> > >
> > > Hi All,
> > >
> > > can somebody please comment on this.
> > > Am I getting something wrong (ie this is working as it should) or is
> > this
> > > a real problem?
> > >
> > > Please, somebody let me know,
> > >
> > > Thanks
> > >
> > > --MB
> > >
> > >
> > >
> > >
> > > massive.boisson wrote:
> > >>
> > >> I have raised an JIRA issue for this -
> > >> http://issues.apache.org/activemq/browse/AMQ-1022 .
> > >> I think this is a real problem.
> > >>
> > >> I can provide more information for whoever is interested in this, for
> > >> example the tests that I used, activemq.xml file.....
> > >>
> > >> --MB
> > >>
> > >>
> > >>
> > >>
> > >> massive.boisson wrote:
> > >>>
> > >>> I tried to test this with ActiveMQ 4.0.1 and regular security
> > settings
> > >>> as per page: http://incubator.apache.org/activemq/security.html, and
> > I
> > >>> received the same results as in previous attempt - I receive asynch
> > >>> exception after send executes without exception as if message has
> > been
> > >>> indeed sent.
> > >>>
> > >>> Any ideas what's going on?
> > >>>
> > >>> --MB
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/receiving-async-exception-when-not-appropriate-tf2545596.html#a7301211
> > Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >
> >
>

Re: receiving async exception when not appropriate

Posted by Nathan Mittler <na...@gmail.com>.
Hi,
Appologies that no one has responded - the AMQ developer community is a busy
bunch and as a result, an occasional e-mail gets dropped in the shuffle :(.


The good news is that others have been raising this problem as well.  I took
a crack at a fix from the latest trunk build (as of yesterday).  The tarball
is here:

http://people.apache.org/~nmittler/
apache-activemq-4.2-incubator-SNAPSHOT.tar.gz<http://people.apache.org/%7Enmittler/apache-activemq-4.2-incubator-SNAPSHOT.tar.gz>

Please give it a try and let me know how it goes.

Thanks,
Nate

On 11/12/06, massive.boisson <ma...@gmail.com> wrote:
>
>
> Dear good people of ActiveMQ, I am begging you for any comment on this
> problem. It's been 2 weeks since I raised JIRA  (
> https://issues.apache.org/activemq/browse/AMQ-1022
> https://issues.apache.org/activemq/browse/AMQ-1022 ).
>
> Any thoughts?
>
> Thanks,
>
> --MB
>
>
> massive.boisson wrote:
> >
> > Hi All,
> >
> > can somebody please comment on this.
> > Am I getting something wrong (ie this is working as it should) or is
> this
> > a real problem?
> >
> > Please, somebody let me know,
> >
> > Thanks
> >
> > --MB
> >
> >
> >
> >
> > massive.boisson wrote:
> >>
> >> I have raised an JIRA issue for this -
> >> http://issues.apache.org/activemq/browse/AMQ-1022.
> >> I think this is a real problem.
> >>
> >> I can provide more information for whoever is interested in this, for
> >> example the tests that I used, activemq.xml file.....
> >>
> >> --MB
> >>
> >>
> >>
> >>
> >> massive.boisson wrote:
> >>>
> >>> I tried to test this with ActiveMQ 4.0.1 and regular security settings
> >>> as per page: http://incubator.apache.org/activemq/security.html, and I
> >>> received the same results as in previous attempt - I receive asynch
> >>> exception after send executes without exception as if message has been
> >>> indeed sent.
> >>>
> >>> Any ideas what's going on?
> >>>
> >>> --MB
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/receiving-async-exception-when-not-appropriate-tf2545596.html#a7301211
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: receiving async exception when not appropriate

Posted by "massive.boisson" <ma...@gmail.com>.
Dear good people of ActiveMQ, I am begging you for any comment on this
problem. It's been 2 weeks since I raised JIRA  (
https://issues.apache.org/activemq/browse/AMQ-1022
https://issues.apache.org/activemq/browse/AMQ-1022 ).

Any thoughts?

Thanks,

--MB


massive.boisson wrote:
> 
> Hi All,
> 
> can somebody please comment on this. 
> Am I getting something wrong (ie this is working as it should) or is this
> a real problem?
> 
> Please, somebody let me know,
> 
> Thanks
> 
> --MB
> 
> 
> 
> 
> massive.boisson wrote:
>> 
>> I have raised an JIRA issue for this -
>> http://issues.apache.org/activemq/browse/AMQ-1022. 
>> I think this is a real problem. 
>> 
>> I can provide more information for whoever is interested in this, for
>> example the tests that I used, activemq.xml file..... 
>> 
>> --MB
>> 
>> 
>> 
>> 
>> massive.boisson wrote:
>>> 
>>> I tried to test this with ActiveMQ 4.0.1 and regular security settings
>>> as per page: http://incubator.apache.org/activemq/security.html, and I
>>> received the same results as in previous attempt - I receive asynch
>>> exception after send executes without exception as if message has been
>>> indeed sent.
>>> 
>>> Any ideas what's going on?
>>> 
>>> --MB
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/receiving-async-exception-when-not-appropriate-tf2545596.html#a7301211
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: receiving async exception when not appropriate

Posted by "massive.boisson" <ma...@gmail.com>.
Hi All,

can somebody please comment on this. 
Am I getting something wrong (ie this is working as it should) or is this a
real problem?

Please, somebody let me know,

Thanks

--MB




massive.boisson wrote:
> 
> I have raised an JIRA issue for this -
> http://issues.apache.org/activemq/browse/AMQ-1022. 
> I think this is a real problem. 
> 
> I can provide more information for whoever is interested in this, for
> example the tests that I used, activemq.xml file..... 
> 
> --MB
> 
> 
> 
> 
> massive.boisson wrote:
>> 
>> I tried to test this with ActiveMQ 4.0.1 and regular security settings as
>> per page: http://incubator.apache.org/activemq/security.html, and I
>> received the same results as in previous attempt - I receive asynch
>> exception after send executes without exception as if message has been
>> indeed sent.
>> 
>> Any ideas what's going on?
>> 
>> --MB
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/receiving-async-exception-when-not-appropriate-tf2545596.html#a7220114
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: receiving async exception when not appropriate

Posted by "massive.boisson" <ma...@gmail.com>.
I have raised an JIRA issue for this -
http://issues.apache.org/activemq/browse/AMQ-1022. 
I think this is a real problem. 

I can provide more information for whoever is interested in this, for
example the tests that I used, activemq.xml file..... 

--MB




massive.boisson wrote:
> 
> I tried to test this with ActiveMQ 4.0.1 and regular security settings as
> per page: http://incubator.apache.org/activemq/security.html, and I
> received the same results as in previous attempt - I receive asynch
> exception after send executes without exception as if message has been
> indeed sent.
> 
> Any ideas what's going on?
> 
> --MB
> 
> 

-- 
View this message in context: http://www.nabble.com/receiving-async-exception-when-not-appropriate-tf2545596.html#a7133214
Sent from the ActiveMQ - User mailing list archive at Nabble.com.