SEVERE: Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener
java.lang.RuntimeException: Unable to find a public constructor for class Foo
at org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.registered(POJOResourceFactory.java:35)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:120)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:106)
at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83)
at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72)
It appears to me that it is trying to locate a default no-args constructor and is ignoring the constructor in Foo that takes a Bar as a parameter. And finally, it doesn't appear to now how to map that to the @Provides defined in the module that builds the object when requested.
Am I missing something? Could this simply be a problem in the Resteasy Guice implementation? Or is it just something basic about Guice that I'm not understanding? All the examples I've downloaded and scanned seem to always use very simple objects with default constructors. I know there's a way to do this. I've tried adding @Named("Bar") to my @Provides method and the corresponding @Inject method parameter. Still does not work.
Any help would be greatly appreciated.
Thanks,
Michael
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice...@googlegroups.com.
To post to this group, send email to google...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.
<context-param>
<param-name>resteasy.scan</param-name>
<param-value>false</param-value>
</context-param>
<!-- NEEDED TO REMOVE THE RESTEASY RESOURCE LIST
<context-param>
<param-name>resteasy.resources</param-name>
<param-value>Foo</param-value>
</context-param>
-->
<context-param>
<param-name>resteasy.guice.modules</param-name>
<param-value>FooModule</param-value>
</context-param>