i'm playing karyon , i've hitting problem jersey , not governator trying instantiate rest resource classes. i'm trying more robust hello world example can specify own guice modules injection.
if use @injectparam annotation jersey finds , says missing mapping constructor. if use @inject annotation jersey, not guice, complains can't inject constructor.
i found thread, https://java.net/projects/jersey/lists/users/archive/2011-01/message/102, describes problem i'm having using aspect of jersey. i'm not sure equivalent problem class in karyon is. has else had problem when creating own modules?
begining of rest resource
@path("/") public class crudroot { private final crudservice service; @inject public crudroot(crudservice service) { super(); this.service = service; my module
protected void configure() { bind(crudservice.class).to(inmemcrudservice.class); } web.xml
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee "> <servlet> <servlet-name>karyoncrud</servlet-name> <servlet-class> com.sun.jersey.spi.container.servlet.servletcontainer </servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.example.karyon.server</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>karyoncrud</servlet-name> <url-pattern>/rest/v1/*</url-pattern> </servlet-mapping> <filter> <filter-name>guicefilter</filter-name> <filter-class>com.google.inject.servlet.guicefilter</filter-class> </filter> <filter-mapping> <filter-name>guicefilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>com.example.karyon.server.crudservletcontextlistener</listener-class> </listener> </web-app>
this post has moved karyon-users google group.
https://groups.google.com/forum/#!topic/karyon-users/rm2iivgnkxi
Comments
Post a Comment