Foren

Liferay 7: More than one *IndexerPostProcessor for an entity?

thumbnail
Andrew Jardine, geändert vor 6 Jahren.

Liferay 7: More than one *IndexerPostProcessor for an entity?

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi All,

I think I know the answer to this one, but I am going to post anyway. When working with past versions of LIferay there were occasions when I had more than one model listener for the same model. Personally, I liked this approach because it felt more "modular" ... enabling or disabling a feature was just a matter of deploying or undeploying a plugin. I mean, I am pretty sure that I have done this in the past -- I haven't gone back through all my projects to confirm to be honest.

I am trying to do this in 7. I have two separate (service) modules, both referring to the BlogsEntry entity. At runtime though, only one of the components is running. I am assuming that this is correct because I have no service rankings specified so the OSGI runtime is making its choice. The obvious work around is to just merge the two together, but what I was wonder is just what the title says ...

Is it possible to have more than one IndexerPostProcessor or the same entity model, and then have them execute in sequence (without using a service tracker to do it manually I mean)?
thumbnail
Andrew Jardine, geändert vor 6 Jahren.

RE: Liferay 7: More than one *IndexerPostProcessor for an entity?

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Yep -- I'm a dork. Both my classes were running, just that I was getting a NPE in one of them. Not that I want to project onto anyone else, but the NPE is being swallowed so there was no way for me to see it without debugging and stepping. I was referencing a custom field that wasn't setup yet. I have an startup event to create/set it up. The module was deployed but I hadn't restarted yet so it wasn't there (in the old days, hooks ran first time when you deployed them).

Reboot and all is back to normal. Multiple indexer post processors running.