Ok got it semi working:
By doing this in my module:
install(new ServletModule() {
@Override
protected void configureServlets() {
bind(MyResource.class);
Map<String, String> params = new HashMap<String, String>();
params.put(PackagesResourceConfig.PROPERTY_PACKAGES,
"unbound");
serve("/*").with(GuiceContainer.class, params);
}
But notice I have to register myResource, would've been nice if it could be
picked up automaticly..
Again thanks for the help.
Now on to JDBC with guice. Have a case where I have to be able to look in
"generic" tables... Meaning my application should be able to hook into any
database and provide table content via REST ..
regards
Nino
2010/3/5 nino martinez wael <[email protected]>
> Thanks i'll digg into it. And come back with the result..
>
> 2010/3/5 Eelco Hillenius <[email protected]>
>
> > SEVERE: service exception:
>> > java.lang.NullPointerException
>> > at com.netdesign.rest.MyResource.getIt(MyResource.java:58)
>> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > at
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> > at
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> > at java.lang.reflect.Method.invoke(Method.java:585)
>> > at
>> >
>>
>> Not sure what's wrong, but you may be best of trying to follow the
>> documentation you can find here:
>>
>> https://jersey.dev.java.net/nonav/apidocs/1.1.5/contribs/jersey-guice/index.html
>>
>>
>> Eelco
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-guice" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-guice%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-guice?hl=en.
>>
>>
>
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.