[rules-users] java.lang.NullPointerException at org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:56)

Carolina Pellecchia carolina.pellecchia at gmail.com
Mon Jul 23 09:24:14 EDT 2012


Hello,

first of all, I would like to thank you for suggestions.

I tried loading drl from file and all work fine. The issue append when the
application load from Guvnor5.3.0 the pkg.

In particular the exception (I mentioned above) happens before calling the
method "SituationManager.createAccessControlEvent":



*public* *static* Event *createAccessControlEvent(*ACObservation obs,
String description, *int* threat_level, Geometry location, *int* sensorid) {

            Event event = *new* AccessControlEvent(description,
threat_level, (Geometry)location.clone(), sensorid, obs.getLoginfo(),
obs.getErrno(), obs.getPersonelId());

            event.addObservation(obs.getServiceIdentification());

            *return* event;

      }


I opened the source code at line 56 of
org.drools.reteoo.ReteooFactHandleFactory (I'm using Drools 5.3.0 final):


 45. *protected* *final* InternalFactHandle newFactHandle(*final* *int* id,


46.                                                     *final* Object object,


47.                                                     *final* *long* recency,


48.                                                     *final*
ObjectTypeConf conf,


49.                                                     *final*
InternalWorkingMemory workingMemory,


50.                                                     *final*
WorkingMemoryEntryPoint wmEntryPoint) {


51.        *if* ( conf != *null* && conf.isEvent() ) {

52.            TypeDeclaration type = conf.getTypeDeclaration();

53.            *long* timestamp;

56.            *if* ( type.getTimestampExtractor() != *null* ) {

57.                *if* ( Date.*class*.isAssignableFrom(
type.getTimestampExtractor().getExtractToClass() ) ) {


58.                    timestamp = ((Date)
type.getTimestampExtractor().getValue( workingMemory,


59.

       object )).getTime();


60.                } *else* {



it seems that "type" is null.



Regards

Carolina

2012/7/23 Wolfgang Laun <wolfgang.laun at gmail.com>

> On 23/07/2012, Vincent LEGENDRE <vincent.legendre at eurodecision.com> wrote:
> > are you sure that your " SituationManager.createAccessControlEvent"
> method
> > returns something not null ?
>
> An insert of null is handled by insert(): nothing is done, null is
> returned. NP
> -W
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120723/c8e15561/attachment-0001.html 


More information about the rules-users mailing list