#1004 Niagara nHaystack Service - Install Troubleshooting

Robin Prussin Mon 15 Aug 2022

Hi ProjectHaystack community!

Having a stubborn issue installing the nHaystack plugin on a N4.11 head end.

The core of the issue is that the plugin is not automatically tagging history objects in the platform with the "his" tag.

So when my integration code is reaching into the API, I get the /about message without issue, and the debug logs shows nhaystack service was initialized.

The slot window shows only 1 site object and no his tags.

My read "his" request gets the following response: ver:"3.0" dis:"java.lang.ClassCastException: javax.baja.sys.BRelTime cannot be cast to javax.baja.sys.BNumber" errTrace:"java.lang.ClassCastException: javax.baja.sys.BRelTime cannot be cast to javax.baja.sys.BNumber\n at nhaystack.server.TagManager.getNumberFacet(TagManager.java:976)\n at nhaystack.server.TagManager.createPointTags(TagManager.java:829)\n at nhaystack.server.TagManager.createComponentTags(TagManager.java:492)\n at nhaystack.server.SpaceManager$CIterator.findNext(SpaceManager.java:230)\n at nhaystack.server.SpaceManager$CIterator.next(SpaceManager.java:211)\n at nhaystack.server.SpaceManager$CIterator.next(SpaceManager.java:190)\n at nhaystack.collection.CompositeIterator.findNext(CompositeIterator.java:67)\n at nhaystack.collection.CompositeIterator.next(CompositeIterator.java:39)\n at org.projecthaystack.server.HServer.onReadAll(HServer.java:115)\n at nhaystack.server.NHServer.onReadAll(NHServer.java:120)\n at org.projecthaystack.HProj.readAll(HProj.java:141)\n

There is more, but you get the point with this chunk.

When I investigated the server, the owner explained it was a 4.8 recently upgraded to 4.11

I checked the tagging library and noticed the Haystack library wasn't installed. Thinking this was likely part of the problem (need tag library to apply tags) we installed the tag library and tried the nHaystack initialization and cache rebuild again, but no list of "his" points appeared.

Taking a step back we then removed the nHaystackService from the station and restarted the server. Re-installed it by dragging the nHaystack service from the palett to the station, but the result was the same.

Getting pretty bogged down here and could use some advice.

How do I generate the tags automatically?

Or what stage of the install does this take place?

I've confirmed in the software management service that the -rt and -wb jar files are loaded and installed.

Not sure what else I can check before I start making his tags manually.

Thanks very much for your support. I'll do my best to provide any debug info you request.

Digo Garcia Tue 16 Aug 2022

The latest version of the nhaystack module for Niagara 4 is v3.2.0.4.10.1.36. Looks like this was last tested against 4.10U1 Did you try the latest? https://stackhub.org/download/nHaystack/3.2.0.4.10.1.36

Robin Prussin Tue 16 Aug 2022

Yes Digo, we used the latest 4.10.1.36 JAR files. Thanks for replying.

Paul Quinn Tue 29 Jul

Was there a resolution to this issue? I'm experiencing a similar problem when I make a nHaystack read request I get the following error: axon::EvalErr: Func failed: haystackReadAll(Expr conn,Expr filterExpr); args: (Literal,Var)

haystack::CallErr: java.lang.ClassCastException: javax.baja.sys.BRelTime cannot be cast to javax.baja.sys.BNumber [proj_temples::niagaraImportExploreHistories:29]

niagaraImportExploreHistories (proj_temples::niagaraImportExploreHistories:29)

=== Remote Trace === java.lang.ClassCastException: javax.baja.sys.BRelTime cannot be cast to javax.baja.sys.BNumber

at nhaystack.server.TagManager.getNumberFacet(TagManager.java:976)

Mike Melillo Wed 30 Jul

Full disclosure, I haven't seen this issue, but based on the error I think there is a BRelTime object in the station with a NumericHistory added to it, OR that BRelTime object is somehow getting added as a his point into the nHaystack Service cache.

If you have access to the station, I would start by digging in with some BQLs against your tagged nHaystack components and looking for B-Types that look out of place.

A little bit more thinking about it... but hopefully this general direction helps!

It looks like the haystack driver is trying to take a BRelTime that and convert it to a BNumber, but if you look into the Niagara api (assuming you have workbench): local:|module://docDeveloper/doc/baja-rt/javax/baja/sys/BSimple.bajadoc .. BRelTime and BNumber both descend from BSimple, but you wouldn't be able to directly cast one to the other.

So if one of those BRelTimes somehow ended up in your nHaystack Cache, it would not be able to call getNumberFacet to grab units etc or even the value as a standard Numeric. I've seen folks use BRelTime as the "out" slot on program objects, perhaps some weird edge case like that caused a nonstandard object to get tagged for pickup by nHaystack.

Login or Signup to reply.