Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-434

providers created with first listed constructor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.1.GA
    • 2.0-beta-4, 2.0.RC1, 2.0.GA
    • None
    • None

      Turn off scanning for providers. List your app's custom ones. Turn on
      scanning for resource classes. This should be a workaround until I can
      fix your bug.

      The problem is that the old App Engine SDK probably masked the problem
      in the RESTEasy code as it probablly returned the default constructor
      first in the list of constructors return from
      java.lang.Class.getDeclaredConstructors()

      OR

      The latest Jackson implementation added new constructors.

      OR

      Both

      olivier brand wrote:
      > > Bill,
      > >
      > > Thanks for the response, I have also upgraded the Google App Engine SDK,
      > > which may be the overall issue here. There may be a clash conflict. Does
      > > it make sense?
      > >
      > > I have enabled scan
      > >
      > > Olivier
      > >
      > > On Thu, Jul 29, 2010 at 3:36 PM, Bill Burke <bburke@redhat.com
      > > <bburke@redhat.com>> wrote:
      > >
      > > I have not changed anything for the Jackson provider other than
      > > upgrading to the latest Jackson version. It looks like RESTEasy is
      > > trying to load the Jackson provider class instead of the one
      > > provided by resteasy and using a non-empty constructor. Do you have
      > > scanning turned on or are you adding
      > > org.codehaus.jackson.jaxrs.JacksonJsonProvider manually to the
      > > deployment?
      > >
      > > I do see an error in the code, it is just getting the first
      > > available declared constructor class.getDeclaredConstructors[0] as
      > > the constructor, rather than looking for a default constructor, but
      > > if you are using the provided RESTEasy Jackson provider, you
      > > shouldn't see this problem.
      > >
      > >
      > > olivier brand wrote:
      > >
      > > I have upgraded to 2.0 today and get an error I was not getting
      > > before when consuming a resource exposed by a GET via my browser.
      > > Any idea where this is coming from?
      > >
      > >
      > > HTTP ERROR 500
      > >
      > > Problem accessing /....... Reason:
      > >
      > > Unable to instantiate MessageBodyReader
      > >
      > >
      > > Caused by:
      > >
      > > java.lang.RuntimeException: Unable to instantiate MessageBodyReader
      > > at
      > > org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:762)
      > >
      > > at
      > > org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:744)
      > > at
      > > org.jboss.resteasy.spi.ResteasyDeployment.registerProvider(ResteasyDeployment.java:371)
      > > at
      > > org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:249)
      > >
      > > at
      > > org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:185)
      > > at
      > > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:68)
      > > at
      > > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
      > >
      > > at
      > > org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
      > > at
      > > org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
      > > at
      > > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
      > >
      > > at
      > > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      > > at
      > > com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:51)
      > > at
      > > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      > >
      > > at
      > > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
      > > at
      > > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      > > at
      > > com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)
      > >
      > > at
      > > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      > > at
      > > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      > > at
      > > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      > >
      > > at
      > > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      > > at
      > > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      > > at
      > > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      > >
      > > at
      > > com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70)
      > > at
      > > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      > > at
      > > com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349)
      > >
      > > at
      > > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      > > at org.mortbay.jetty.Server.handle(Server.java:326)
      > > at
      > > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      > > at
      > > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
      > >
      > > at
      > > org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
      > > 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:582)
      > > Caused by: java.lang.RuntimeException: Illegal to inject a
      > > message body into a singleton into public
      > > org.codehaus.jackson.jaxrs.JacksonJsonProvider(org.codehaus.jackson.map.ObjectMapper,org.codehaus.jackson.jaxrs.Annotations[])
      > >
      > > at
      > > org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:157)
      > > at
      > > org.jboss.resteasy.core.ConstructorInjectorImpl.injectableArguments(ConstructorInjectorImpl.java:63)
      > > at
      > > org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:129)
      > >
      > > at
      > > org.jboss.resteasy.spi.ResteasyProviderFactory.getProviderInstance(ResteasyProviderFactory.java:1036)
      > > at
      > > org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:450)
      > > at
      > > org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:758)
      > >
      > > ... 33 more
      > >

              patriot1burke@gmail.com Bill Burke (Inactive)
              patriot1burke@gmail.com Bill Burke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: