salve delivers NPE at 1st startup

2 views
Skip to first unread message

Christoph

unread,
May 19, 2010, 5:07:22 PM5/19/10
to Salve
Hi,
I have following class :

@Singleton
public class PoiLoader implements Serializable, IPoiLoader {

private Multimap<TouristType, Poi>
poisRelatedToSpecificTouristType = ArrayListMultimap.create();


@Inject
private CatadvisorProperties properties;

@Dependency
private OntologyHelper ontHelper;

@Dependency
private WorkManager workManager;

@Dependency
private ITouristTypeVectorDao daoTouristTypeVector;
private Map<Resource, Poi> pois = Maps.newHashMap();
private final List<String> allConcepts = Lists.newArrayList();

@Deprecated
protected PoiLoader() {

}

@Override
public void initialize() {
// this.workManager = wrapper.wrap(workManager);
workManager.beginWork();
etc.....

I recognized that if I change an @inject to an @dependency annotation,
I am getting the error "context [] startup failed due to previous
errors because of a NPE of workManager. If I run it a 2nd time, it
works. Does someone know the reason for that behavior?

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 19, 2010, 5:16:58 PM5/19/10
to salve...@googlegroups.com
Npe usually means your code has not been instrumented

-igor

Christoph

unread,
May 19, 2010, 5:56:57 PM5/19/10
to Salve
Igor - thanks for your answer.
There is the information that it gets instrumented. By the way, also
when I change an @dependency to an @inject annotation, I get the first
time a NPE at the field of work manager, only at the 2nd startup it
works.

Are the target classes not updated correctly?

Thanks, Christoph

On 19 Mai, 23:16, Igor Vaynberg <igor.vaynb...@gmail.com> wrote:
> Npe usually means your code has not been instrumented
>
> -igor
>
> For more options, visit this group athttp://groups.google.com/group/salve-disc?hl=en.

Igor Vaynberg

unread,
May 19, 2010, 6:05:09 PM5/19/10
to salve...@googlegroups.com
well, if you are seeing the same behavior with just @Inject then the
problem is somewhere in your guice-related code.

-igor
Reply all
Reply to author
Forward
0 new messages