r Ravish
on

 

I am trying to validate  define.xml file. The software crashes with following bug:

16:06:53.208 [RxCachedThreadScheduler-1] INFO  org.opencdisc.define.Connector - Here with Beginning Validation, Processing
16:06:58.494 [RxCachedThreadScheduler-1] INFO  org.opencdisc.define.Connector - Here with Validating defineedited.xml..., Processing
16:07:00.817 [RxCachedThreadScheduler-1] ERROR org.opencdisc.define.Connector - Unexpected exception acting on control event
java.lang.NullPointerException
    at org.opencdisc.define.validator.ContentValidator.validateAllOrigins(ContentValidator.java:855) ~[define-generator-1.1.7.jar:?]
    at org.opencdisc.define.validator.ContentValidator.validate(ContentValidator.java:90) ~[define-generator-1.1.7.jar:?]
    at org.opencdisc.define.validator.DefineValidator.validateContent(DefineValidator.java:216) ~[define-generator-1.1.7.jar:?]
    at org.opencdisc.define.Connector$1.start(Connector.java:147) ~[define-generator-1.1.7.jar:?]
    at org.opencdisc.define.Connector$1.onNext(Connector.java:61) [define-generator-1.1.7.jar:?]
    at org.opencdisc.define.Connector$1.onNext(Connector.java:45) [define-generator-1.1.7.jar:?]
    at rx.Observable$35.onNext(Observable.java:7439) [rxjava-1.0.7.jar:1.0.7]
    at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:130) [rxjava-1.0.7.jar:1.0.7]
    at rx.internal.operators.NotificationLite.accept(NotificationLite.java:150) [rxjava-1.0.7.jar:1.0.7]
    at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:191) [rxjava-1.0.7.jar:1.0.7]
    at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.access$000(OperatorObserveOn.java:65) [rxjava-1.0.7.jar:1.0.7]
    at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:155) [rxjava-1.0.7.jar:1.0.7]
    at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:47) [rxjava-1.0.7.jar:1.0.7]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.7.0_45]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.7.0_45]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [?:1.7.0_45]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.7.0_45]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_45]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_45]

 

Can you provide the cause of this issue?

Forums: Define.xml

s Sergiy
on June 28, 2018

Hi Ravish, 

It looks like you have a reference to variable which does not exist.

Regards, 

Sergiy

r Ravish
on July 6, 2018

Hi Sergiy,

Thank you for your reply. You mean some content is missing in define.xml file? Or is it just that a runtime instance is missing in the executing program?

j Jozef
on July 6, 2018

I tested the use case of referencing a variable that does not exist, i.e. an ItemRef pointing to an ItemDef by OID, but no ItemDef with that OID present.
In that case, the validation completes, and one gets an error "OD012": "Invalid root element".

If you contact me personally, I can look up why the software crashes as I do know the source code pretty well.

j Jozef
on July 6, 2018

By looking into the source code, I could easily find out (and reproduce): SEE IMAGE BELOW:

Image removed.

The error is occurring at line 550 in class "ContentValidator". It occurs in the case of a "ValueList-ItemRef" pointing to an ItemDef (by OID) but the corresponding ItemDef (with that OID) is not present. In such a case, the method "itemDefs.get(itemRefOID)" returns "null", and a "null" value cannot be split of course. So this is about valuelist variable definitions.
Essentially, the software should first check whether an ItemDef is present for the given ItemRef, and if not, provide an error message. It should not crash.
The error does not occur when it is an "ItemGroupDef-ItemRef" and the ItemDef is not present. See my prior entry.

@Ravish: you can always contact me for more details and how to correct this.

r Ravish
on July 6, 2018

Hi Jozef,

You are right!!. One of the itemrefs in define.xml was missing an equivalent itemdef. That was causing the application to crash.

Thank you so much for your input. It was really helpful.

j Jozef
on July 6, 2018

Thanks Ravish!

Can you contact me? I can take care of a software bug-fix.

Want a demo?

Let’s Talk.

We're eager to share and ready to listen.

Cookie Policy

Pinnacle 21 uses cookies to make our site easier for you to use. By continuing to use this website, you agree to our use of cookies. For more info visit our Privacy Policy.