2 Replies Latest reply on Apr 12, 2011 11:20 AM by David Hosier

    REST Interface Topic Push Subscription Problem

    David Hosier Newbie

      I'm using JBoss AS 6 Final which I have upgraded with HornetQ 2.2.2 Final. I am trying to follow along in the documentation with the instructions for creating a push subscription to a topic, and I am getting an error. Everything seems to be in order from the request side, but I cannot get it to work. I was hoping someone could shed some light for me.

       

      I am POSTing the following XML to http://localhost:8080/hornetq-rest/topics/jms.topic.test/push-subscriptions which I obtained from the HEAD call as indicated in the documentation:

       

      {code:xml}<push-registration>

                <link href='http://localhost:8089' type='application/json' method='PUT' />

      </push-registration>{code}

       

      The error I get in response is:

       

      {noformat}

      12:56:07,904 WARN  [org.jboss.resteasy.core.SynchronousDispatcher] Failed executing POST /topics/jms.topic.test/push-subscriptions: org.jboss.resteasy.spi.InternalServerErrorException: Bad arguments passed to public javax.ws.rs.core.Response org.hornetq.rest.topic.PushSubscriptionsResource.create(javax.ws.rs.core.UriInfo,org.hornetq.rest.topic.PushTopicRegistration)  ( org.jboss.resteasy.specimpl.UriInfoImpl org.jboss.resteasy.specimpl.UriInfoImpl@7221373f, org.hornetq.rest.queue.push.xml.PushRegistration PushRegistration{id='null', durable=false, target=XmlLink{className='null', rel='null', href='http://localhost:8089', type='application/json', method='PUT'}, authenticationMechanism=null, headers=[], destination='null', selector='null', retryWaitMillis=1000, disableOnFailure=false, maxRetries=10, enabled=true} )

                at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:181) [:6.0.0.Final]

                at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:252) [:6.0.0.Final]

                at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:217) [:6.0.0.Final]

                at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:151) [:6.0.0.Final]

                at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:106) [:6.0.0.Final]

                at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:146) [:6.0.0.Final]

                at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91) [:6.0.0.Final]

                at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:503) [:6.0.0.Final]

                at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:480) [:6.0.0.Final]

                at org.jboss.resteasy.core.SynchronousDispatcher.invokePropagateNotFound(SynchronousDispatcher.java:139) [:6.0.0.Final]

                at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:211) [:6.0.0.Final]

                at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:59) [:6.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]

                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]

                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]

                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]

                at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]

                at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]

                at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]

                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]

                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]

                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]

                at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]

                at java.lang.Thread.run(Thread.java:680) [:1.6.0_22]

      Caused by: java.lang.IllegalArgumentException: argument type mismatch

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

                at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

                at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) [:6.0.0.Final]

                ... 30 more

      {noformat}