Norconex / collector-core

Collector-related code shared between different collector implementations
http://www.norconex.com/collectors/collector-core/
Apache License 2.0
7 stars 15 forks source link

[JobSuite] Implementing IJobLifeCycleListener requires MutableJobStatus #8

Closed sylvainroussy closed 7 years ago

sylvainroussy commented 7 years ago

Hi! I have a class wich implements IJobLifeCycleListener.

However, when an event is fired by the JobSuite an exception like the following is launched :

Caused by: java.lang.NoSuchMethodException: No such accessible method: jobProgressed()

The cause is the use of (in fire () method of JobSuite): MethodUtils.invokeExactMethod(l, methodName, argument); The argument here is a MutableJobStatus instead of IJobStatus declared in the IJobLifeCycleListener interface then the exception occured.

Duplicating all IJobLifeCycleListener interface methods in my implementation from: public void jobStarted(IJobStatus status) with public void jobStarted(MutableJobStatus status) works.

Is this really a prerequisite to call an invokeExactMethod() here ?

[edit : renaming IJobStatus interface by IJobLifeCycleListener interface ]

essiembre commented 7 years ago

This is fixed in a new JEF API snapshot release. Please confirm.

Norconex Collector Core/HTTP/Filesystem snapshot version were also all updated to contain this latest JEF API fix.

sylvainroussy commented 7 years ago

Fixed!