Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 68222 invoked from network); 28 Jun 2010 09:26:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jun 2010 09:26:03 -0000 Received: (qmail 94695 invoked by uid 500); 28 Jun 2010 09:26:02 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 93709 invoked by uid 500); 28 Jun 2010 09:25:58 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 93696 invoked by uid 99); 28 Jun 2010 09:25:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 09:25:56 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.161.42] (HELO mail-fx0-f42.google.com) (209.85.161.42) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 09:25:48 +0000 Received: by fxm4 with SMTP id 4so3274741fxm.15 for ; Mon, 28 Jun 2010 02:25:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.157.144 with SMTP id q16mr305767hbc.155.1277717127442; Mon, 28 Jun 2010 02:25:27 -0700 (PDT) Received: by 10.239.160.6 with HTTP; Mon, 28 Jun 2010 02:25:27 -0700 (PDT) X-Originating-IP: [193.29.76.38] In-Reply-To: References: Date: Mon, 28 Jun 2010 11:25:27 +0200 Message-ID: Subject: Re: Problems with JMS API From: Jakub Scholz To: users@qpid.apache.org Cc: Rajith Attapattu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Rajith, Thanks for the fix - the first three problems are working as expected with latest trunk. I used following address when I found these problems: amq.direct/CLIENT_X.56789; {create: receiver, link : {name : 'service.tmp.CLIENT_X.123456_resp', x-declare : { auto-delete: true, exclusive: true, 'qpid.max_size': 1000, 'qpid.policy_type': ring } } } Regarding the "access" right ... I believe in case it would be necessary, we can add the "access" right to the ACL list. The C++ API (version 0.5) and .NET API (version 0.6) are running successfully against the same ACL setup as I'm running this JMS based application. But these older versions of course don't use the new addressing scheme. From my point of view, it would be great to have a possibility to bypass this querying functionality (for example by another option in address). But I don't have enough knowledge about the APIs to know whether it is possible or isn't. Thanks & Regards Jakub Scholz On Fri, Jun 25, 2010 at 22:33, Rajith Attapattu wrote: > Hello Jakub, > > I have fixed the fist 3 problems in rev 958102 on qpid trunk. > Many thanks for bringing this to my attention. > > Could you also specify the address string that cause each of these proble= ms? > > As for problem 4, if you are using ACL then you need explicit > permission to access (query) or bind to an exchange. > When using type : queue then the "address" is taken as a queue and > then will be bound to any exchange explicitly specified in string. > (By default every queue created is bound to the nameless exchange with > queue name as the binding key). > > If using type : topic then address is considered as an exchange and > the client will try to see if an exchange by the name exists. Hence > the call to exchange query. > > I was a bit surprised when you mentioned that you don't get this with > the c++ API and .NET API. > Could you provide more details on that ? > > If ACL is used then permissions will determine who can access what. > > Regards, > > Rajith > > On Fri, Jun 25, 2010 at 1:46 PM, Jakub Scholz wrote: >> Hi Rajith, >> >> You don't need to apologize, I'm glad for any help. I builded the >> latest trunk and tried it again. The previous problem with the >> PropertiesFileInitialContextFactoryis indeed fixed. I run into few >> other problems regarding the addresses: >> >> 1) When I used the addresses you suggested, it was complaining about >> NullPointerException in AddressHelper.getLink >> >> WARNUNG: Unable to create destination:java.lang.NullPointerException >> java.lang.NullPointerException >> =A0 =A0 =A0 =A0at org.apache.qpid.client.messaging.address.AddressHelper= .getLink(AddressHelper.java:326) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQDestination.getInfoFromAddre= ss(AMQDestination.java:823) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQDestination.(AMQDestin= ation.java:157) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQAnyDestination.(AMQAny= Destination.java:52) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQDestination.createDestinatio= n(AMQDestination.java:669) >> =A0 =A0 =A0 =A0at org.apache.qpid.jndi.PropertiesFileInitialContextFacto= ry.createDestination(PropertiesFileInitialContextFactory.java:240) >> =A0 =A0 =A0 =A0at org.apache.qpid.jndi.PropertiesFileInitialContextFacto= ry.createDestinations(PropertiesFileInitialContextFactory.java:160) >> =A0 =A0 =A0 =A0at org.apache.qpid.jndi.PropertiesFileInitialContextFacto= ry.getInitialContext(PropertiesFileInitialContextFactory.java:117) >> =A0 =A0 =A0 =A0at javax.naming.spi.NamingManager.getInitialContext(Unkno= wn Source) >> =A0 =A0 =A0 =A0at javax.naming.InitialContext.getDefaultInitCtx(Unknown = Source) >> =A0 =A0 =A0 =A0at javax.naming.InitialContext.init(Unknown Source) >> =A0 =A0 =A0 =A0at javax.naming.InitialContext.(Unknown Source) >> =A0 =A0 =A0 =A0at org.apache.qpid.example.jmsexample.hello.Hello.runTest= (Hello.java:18) >> =A0 =A0 =A0 =A0at jms.Client.main(Client.java:329) >> >> This problem seems to be caused by missing capacity option in my >> Address. After i added capacity: 1000, this problem didn't appeared >> again. Maybe some default CAPACITY value should be added to the >> AddressHelper. >> >> 2) The qpid.policy-type option seems to be expecting integer instead >> of String. Therefore, when I tried to set policy-type to ring, I got >> following exception: >> >> java.lang.NumberFormatException: For input string: "ring" >> =A0 =A0 =A0 =A0at java.lang.NumberFormatException.forInputString(Unknown= Source) >> =A0 =A0 =A0 =A0at java.lang.Integer.parseInt(Unknown Source) >> =A0 =A0 =A0 =A0at java.lang.Integer.parseInt(Unknown Source) >> =A0 =A0 =A0 =A0at org.apache.qpid.configuration.Accessor$MapAccessor.get= Int(Accessor.java:101) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.messaging.address.AddressHelper= .getQpidQueueOptions(AddressHelper.java:132) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.messaging.address.AddressHelper= .createQueueNode(AddressHelper.java:273) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.messaging.address.AddressHelper= .getSourceNode(AddressHelper.java:300) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQDestination.rebuildTargetAnd= SourceNodes(AMQDestination.java:832) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.resolveAddressT= ype(AMQSession_0_10.java:1217) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.handleAddressBa= sedDestination(AMQSession_0_10.java:1144) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.registerConsumer(AMQ= Session.java:2606) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.access$500(AMQSessio= n.java:95) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1809) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1775) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnectionDelegate_0_10.exec= uteRetrySupport(AMQConnectionDelegate_0_10.java:278) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnection.executeRetrySuppo= rt(AMQConnection.java:765) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.failover.FailoverRetrySupport.e= xecute(FailoverRetrySupport.java:102) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumerImpl(A= MQSession.java:1773) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumer(AMQSe= ssion.java:921) >> =A0 =A0 =A0 =A0at org.apache.qpid.example.jmsexample.hello.Hello.runTest= (Hello.java:30) >> =A0 =A0 =A0 =A0at jms.Client.main(Client.java:329) >> >> After changing the args.getInt(...) to args.getString(...) on line 132 >> of AddressHelper class. >> >> 3) The last exception I run into was this: >> >> java.lang.NullPointerException >> =A0 =A0 =A0 =A0at org.apache.qpid.client.messaging.address.AddressHelper= .fillInCommonNodeArgs(AddressHelper.java:281) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.messaging.address.AddressHelper= .createQueueNode(AddressHelper.java:274) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.messaging.address.AddressHelper= .getSourceNode(AddressHelper.java:300) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQDestination.rebuildTargetAnd= SourceNodes(AMQDestination.java:832) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.resolveAddressT= ype(AMQSession_0_10.java:1217) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.handleAddressBa= sedDestination(AMQSession_0_10.java:1144) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.registerConsumer(AMQ= Session.java:2606) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.access$500(AMQSessio= n.java:95) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1809) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1775) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnectionDelegate_0_10.exec= uteRetrySupport(AMQConnectionDelegate_0_10.java:278) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnection.executeRetrySuppo= rt(AMQConnection.java:765) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.failover.FailoverRetrySupport.e= xecute(FailoverRetrySupport.java:102) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumerImpl(A= MQSession.java:1773) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumer(AMQSe= ssion.java:921) >> =A0 =A0 =A0 =A0at org.apache.qpid.example.jmsexample.hello.Hello.runTest= (Hello.java:30) >> =A0 =A0 =A0 =A0at jms.Client.main(Client.java:329) >> >> On the line 281 of AddressHelper, the null check is missing again. >> After verifying whether nodeProps !=3D null the problem seemed to be >> fixed. >> >> 4) The last problem I found so far was, that the JMS API needed the >> access right to the exchange I was binding. That is currently >> forbidden on our system. This right was not needed with the old Qpid >> API or in c++ and .NET APIs. I was getting following errors: >> >> INFO: Created session:org.apache.qpid.client.AMQSession_0_10@b1a4e2 >> org.apache.qpid.transport.SessionException: ch=3D0 id=3D0 >> ExecutionException(errorCode=3DNOT_ALLOWED, commandId=3D0, classCode=3D7= , >> commandCode=3D6, fieldIndex=3D0, description=3Dnot-allowed: ACL denied >> exchange bound request from client@QPID5318 >> (qpid/broker/SessionAdapter.cpp:238), errorInfo=3D{}) >> =A0 =A0 =A0 =A0at org.apache.qpid.transport.Session$ResultFuture.get(Ses= sion.java:847) >> =A0 =A0 =A0 =A0at org.apache.qpid.transport.Session$ResultFuture.get(Ses= sion.java:859) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.resolveAddressT= ype(AMQSession_0_10.java:1203) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.handleAddressBa= sedDestination(AMQSession_0_10.java:1144) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.registerConsumer(AMQ= Session.java:2606) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.access$500(AMQSessio= n.java:95) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1809) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1775) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnectionDelegate_0_10.exec= uteRetrySupport(AMQConnectionDelegate_0_10.java:278) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnection.executeRetrySuppo= rt(AMQConnection.java:765) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.failover.FailoverRetrySupport.e= xecute(FailoverRetrySupport.java:102) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumerImpl(A= MQSession.java:1773) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumer(AMQSe= ssion.java:921) >> =A0 =A0 =A0 =A0at org.apache.qpid.example.jmsexample.hello.Hello.runTest= (Hello.java:30) >> =A0 =A0 =A0 =A0at jms.Client.main(Client.java:329) >> >> I tried to force the node type with "node: { type: topic }", which >> gave me different error: >> >> INFO: Created session:org.apache.qpid.client.AMQSession_0_10@2016b0 >> org.apache.qpid.transport.SessionException: ch=3D0 id=3D0 >> ExecutionException(errorCode=3DNOT_ALLOWED, commandId=3D0, classCode=3D7= , >> commandCode=3D3, fieldIndex=3D0, description=3Dnot-allowed: ACL denied >> exchange query request from client@QPID5318 >> (qpid/broker/SessionAdapter.cpp:153), errorInfo=3D{}) >> =A0 =A0 =A0 =A0at org.apache.qpid.transport.Session$ResultFuture.get(Ses= sion.java:847) >> =A0 =A0 =A0 =A0at org.apache.qpid.transport.Session$ResultFuture.get(Ses= sion.java:859) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.isExchangeExist= (AMQSession_0_10.java:1041) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession_0_10.handleAddressBa= sedDestination(AMQSession_0_10.java:1165) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.registerConsumer(AMQ= Session.java:2606) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.access$500(AMQSessio= n.java:95) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1809) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession$4.execute(AMQSession= .java:1775) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnectionDelegate_0_10.exec= uteRetrySupport(AMQConnectionDelegate_0_10.java:278) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQConnection.executeRetrySuppo= rt(AMQConnection.java:765) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.failover.FailoverRetrySupport.e= xecute(FailoverRetrySupport.java:102) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumerImpl(A= MQSession.java:1773) >> =A0 =A0 =A0 =A0at org.apache.qpid.client.AMQSession.createConsumer(AMQSe= ssion.java:921) >> =A0 =A0 =A0 =A0at org.apache.qpid.example.jmsexample.hello.Hello.runTest= (Hello.java:30) >> =A0 =A0 =A0 =A0at jms.Client.main(Client.java:329) >> >> But I still need the access rights to the exchange to get it working. >> I tried to use the assert option, but it doesn't help. Can I somehow >> bypass this or is adding the access right for the exchange the only >> possibility? >> >> Thanks & Regards >> Jakub >> >> On Fri, Jun 25, 2010 at 16:06, Rajith Attapattu wro= te: >>> Hi Jakub, >>> >>> Apologies for the delay in replying to you. I was down with the flu >>> this week and it derailed most of my plans. >>> Anyways there was a bug (QPID-2696) in Qpid which cause the issue you r= eported. >>> I have fixed this in rev 957942 in trunk. >>> Please give it a try and let us know. >>> Again, very sorry for the delay in responding. >>> >>> Regards, >>> >>> Rajith >>> >> > > > > -- > Regards, > > Rajith Attapattu > Red Hat > http://rajith.2rlabs.com/ > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org