qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Wall (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPID-4874) Alternate exchange unable to set from REST
Date Thu, 03 Oct 2013 17:21:46 GMT

    [ https://issues.apache.org/jira/browse/QPID-4874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13785378#comment-13785378
] 

Keith Wall commented on QPID-4874:
----------------------------------

When tested against trunk today (0.25), with Michal's addr:, I don't see endless exchange
output from a  REST calls that he reported (I tested /exchange and /structure), but I do see
the following exception as it tries to serialise the (Qpid) SecurityManager.

It seems wrong that the ExchangeAdapter object is exposing the o.a.q.s.e.Exchange - it should
be exposing the Exchange model object.  This would then following the same pattern as QueueAdapter#ALTERNATE_EXCHANGE
attribute.

{code}
2013-10-03 18:00:58,112 ERROR [qtp2123954626-50] (rest.AbstractServlet) - Unable to perform
action
java.security.PrivilegedActionException: org.codehaus.jackson.map.JsonMappingException: No
serializer found for class org.apache.qpid.server.security.SecurityManager and no properties
discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS)
) (through reference chain: java.util.ArrayList[0]->java.util.LinkedHashMap["exchanges"]->java.util.ArrayList[4]->java.util.LinkedHashMap["alternateExchange"]->org.apache.qpid.server.exchange.FanoutExchange["virtualHost"]->org.apache.qpid.server.virtualhost.StandardVirtualHost["securityManager"])
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.doWithSubjectAndActor(AbstractServlet.java:208)
        at org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.doGet(AbstractServlet.java:74)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1320)
        at org.apache.qpid.server.management.plugin.filter.ForbiddingAuthorisationFilter.doFilter(ForbiddingAuthorisationFilter.java:90)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1291)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:443)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1044)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:367)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.codehaus.jackson.map.JsonMappingException: No serializer found for class org.apache.qpid.server.security.SecurityManager
and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS)
) (through reference chain: java.util.ArrayList[0]->java.util.LinkedHashMap["exchanges"]->java.util.ArrayList[4]->java.util.LinkedHashMap["alternateExchange"]->org.apache.qpid.server.exchange.FanoutExchange["virtualHost"]->org.apache.qpid.server.virtualhost.StandardVirtualHost["securityManager"])
        at org.codehaus.jackson.map.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:52)
{code}

> Alternate exchange unable to set from REST
> ------------------------------------------
>
>                 Key: QPID-4874
>                 URL: https://issues.apache.org/jira/browse/QPID-4874
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: 0.20
>            Reporter: Michal Zerola
>             Fix For: Future
>
>         Attachments: alternate_exch_fix.patch
>
>
> This is a follow-up on the discussion started on:
> http://mail-archives.apache.org/mod_mbox/qpid-users/201303.mbox/%3CCAFitrpTiPo_yMhitGBM-1=QiW8xnKz3O2tqgSP3xbooDDC=yvQ@mail.gmail.com%3E
> I haven't seen any JIRA covering this issue yet. Setting an alternate exchange on the
exchange is not possible now from the REST interface (e.g. using curl / web management).
> The only way how one can set an alternate exchange is using the proper address from the
JMS client and passing it to the _MessageProducer_:
> {noformat}
> "ADDR:test-exch; {create: always, node:{type: topic,x-declare: {alternate-exchange:'amq.fanout'}}}"
> {noformat}
> The exchange _test-exch_ will then keep reference to the alternate exchange _amq.fanout_.
However, listing the exchange using the _curl_ will fail (produce endless output). I assume
that the problem is caused by Json mapper, having problems to write object which is not _ConfiguredObject_
(in this case it is _FanoutExchange_). This problem is reproducible by creating the exchange
with alternate exchange reference using the address above and listing the exchange(s) with
curl command. I think the solution can be to return the alternate exchange name (and not an
object) from the _ExchangeAdapter.java_ as I illustrated in the attached patch.
> Thank you,
> Michal



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message