@dependency on hashmap

9 views
Skip to first unread message

Christoph

unread,
May 20, 2010, 4:19:24 AM5/20/10
to Salve
Hi all,
In a class I have a Map<Resource, Poi> pois;
Resource is as Jena Resource and not serializable. Can I add an
@Dependency annotation on the map? In this case, however, I am getting
a NPE on the first field that should be instrumented.

Thanks, Christoph

--
You received this message because you are subscribed to the Google Groups "Salve" group.
To post to this group, send email to salve...@googlegroups.com.
To unsubscribe from this group, send email to salve-disc+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/salve-disc?hl=en.

Igor Vaynberg

unread,
May 20, 2010, 11:22:51 AM5/20/10
to salve...@googlegroups.com
as i said prior, an NPE when accessing a @dependency field in salve
means the class has not been instrumented. if salve cannot find a
matching bean it will throw a DependencyNotFoundException, not return
a null. so i think you should get your instrumentation figured out
first.

as far as injecting a hashmap, what would happen if you replace
@dependency with @inject, would guice know how to inject it? if not
then salve wont either as it simply delegates the lookup to your ioc
container of choice.

-igor
Reply all
Reply to author
Forward
0 new messages