Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-2993

RESTEasy examples, spring-hibernate-contacts: Example does not work for contact detail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EAP_EWP 5.1.1
    • EAP 5.0.0.CR5, EAP 5.0.1.CR2, EAP_EWP 5.1.0_CR3
    • RESTEasy
    • None
    • Release Notes
    • Hide
      The spring-hibernate-contacts example failed with the error:

      java.lang.IllegalArgumentException: object is not an instance of declaring class

      This occurred because the getContactById(@PathParam("id") Long id) method in the ContactServiceImpl class was missing the @GET annotation. This error has been corrected, and the example code now works as expected.
      Show
      The spring-hibernate-contacts example failed with the error: java.lang.IllegalArgumentException: object is not an instance of declaring class This occurred because the getContactById(@PathParam("id") Long id) method in the ContactServiceImpl class was missing the @GET annotation. This error has been corrected, and the example code now works as expected.
    • Documented as Resolved Issue

      I have compiled example and started Jetty server according instructions in README.txt.

      README.txt contains URL for manual testing:

      60524 [239468736@qtp-260440278-0] ERROR org.jboss.resteasy.core.SynchronousDispatcher - Unknown exception while executing GET /contactservice/contacts/1
      java.lang.IllegalArgumentException: object is not an instance of declaring class
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:65)
      at org.jboss.resteasy.core.ResourceLocator.createResource(ResourceLocator.java:54)
      at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91)
      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:359)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:336)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:103)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:114)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:380)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:324)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

              mlinhard Michal Linhard (Inactive)
              pslavice@redhat.com Pavel Slavicek
              Laura Bailey Laura Bailey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: