1 Reply Latest reply on Dec 16, 2010 7:45 AM by Christian Scharr

    locator-path-problem using REST-interface of HornetQ

    Christian Scharr Newbie

      Due to some design specific rules I try to embed HornetQ along with the REST interface into my also embedded run-time configured Jetty7 webserver without any *.war-architecture or something similar. Therefore I wrote a little javax.ws.rs.core.Application class to handle the binding of the annotated classes of the HornetQ REST interface. Now it seems there goes something wrong with this annotations, because I get the following failures at run-time:

       

      09:14:59.098 [main] DEBUG org.eclipse.jetty.util.log - EXCEPTION
      org.jboss.resteasy.spi.LoggableFailure: You cannot have 2 locators for same path: {queue-name}
      at org.jboss.resteasy.core.registry.RootSegment.addPath(RootSegment.java:67) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.core.registry.RootSegment.addPath(RootSegment.java:97) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.core.registry.RootSegment.addPath(RootSegment.java:258) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodRegistry.java:174) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:123) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:106) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.processApplication(ServletContainerDispatcher.java:153) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:91) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.init(FilterDispatcher.java:39) ~[resteasy-jaxrs-2.0.1.GA.jar:na]
      at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:98) ~[jetty-servlet-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) [jetty-util-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:739) ~[jetty-servlet-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:244) ~[jetty-servlet-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:576) ~[jetty-server-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) [jetty-util-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:226) ~[jetty-server-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:164) ~[jetty-server-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) [jetty-util-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:93) [jetty-server-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.server.Server.doStart(Server.java:243) [jetty-server-7.2.1.v20101111.jar:7.2.1.v20101111]
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) [jetty-util-7.2.1.v20101111.jar:7.2.1.v20101111]

       

      Any ideas how to solve this problem?

      When I look into the sourcecode at http://fisheye.jboss.org/browse/Hornetq/trunk/hornetq-rest/hornetq-rest/src/main/java/org/hornetq/rest/queue/QueueDestinationsResource.java?hb=true I can see that there are two @Path("/{queue-name}") annotations (line 102 and line 140).