I am getting NullpointerException ResourceServiceBroker

Hi All,

ResourceServiceBroker broker = HippoServiceRegistry.getService(ResourceServiceBroker.class);

We are using CMS 11.2.0 version, configured crisp api for external calls.
I am using 1.0.4 version of CRISP API.
I am getting NullpointerException, do i need to do any configuration for this, please let me know the steps.

I am using hippo-services:3.2.0 version for ResourceServiceBroker.

thanks & regards
Ganesh

Hi,
what about using CrispHstServices instead, something like

ResourceServiceBroker broker = CrispHstServices.getDefaultResourceServiceBroker();

Does this work for you?

HI Giacomolm,

It’s works for, i am getting another exception :
Caused by: java.lang.NoClassDefFoundError: org/hippoecm/hst/site/HstServices

I have added maven dependencies but no use.

please let me know, what i have to do here.

thanks & regards
Ganesh

Are you trying to use CRISP within your site application, as example from an HST component?

Hi Giacomolm,

thank you.
I have removed that dependency from site module, but still getting same kind of stuff.

] Caused by: java.lang.NoClassDefFoundError: org/hippoecm/hst/site/HstServices

[ INFO ] [talledLocalContainer] at org.onehippo.cms7.crisp.hst.module.CrispHstServices.getModuleComponent(CrispHstServices.java:50)

thanks & regards
Ganesh

Hi,
I would suggest to have a look at the crisp demo project freely available here [1]

Specifically I would like suggest to check 2 things:

  • If the CRISP dependencies defined in your project are correct: please compare them with the example here [2]
  • if the CRISP library is used as expected inside your HST components: please check this here [3]

HTH

[1] https://code.onehippo.org/cms-community/hippo-addon-crisp/tree/hippo-addon-crisp-1.0.4/demo
[2] https://code.onehippo.org/cms-community/hippo-addon-crisp/blob/hippo-addon-crisp-1.0.4/demo/site/pom.xml
[3] https://code.onehippo.org/cms-community/hippo-addon-crisp/blob/hippo-addon-crisp-1.0.4/demo/site/src/main/java/org/onehippo/cms7/crisp/demo/components/NewsContentComponent.java

Hi Ganesh,

HstServices class is in hst-commons-*.jar. So try to find where the jar is located in your (local cargo) tomcat folder. Also, compare it with the demo project when you run the demo project for v11.

Regards,

Woonsan

HI Giacomolm,

thanks for your time and support, i will try and let you know.

regards
Ganesh

Hi Woonsanko,

thank you, i will try and get back to you.

regards
Ganesh

Hi Woonsanko,

i am getting below exception, please let me know what i have to do to fix this.

Caused by: java.lang.IllegalStateException: HST Services unavailable.

[ INFO ] [talledLocalContainer] at org.onehippo.cms7.crisp.hst.module.CrispHstServices.getModuleComponent(CrispHstServices.java:51)

[ INFO ] [talledLocalContainer] at org.onehippo.cms7.crisp.hst.module.CrispHstServices.getDefaultResourceServiceBroker(CrispHstServices.java:64)

[ INFO ] [talledLocalContainer] at com.lbrands.cms.facade.MasterStyleIdFacade.findDocumentById(MasterStyleIdFacade.java:158)

[ INFO ] [talledLocalContainer] at com.lbrands.cms.facade.MasterStyleIdFacade.getFieldExternalDocuments(MasterStyleIdFacade.java:89)

thanks & regards
Gaensh

HI Giacomolm,

i am getting below exception, please let me know what i have to do to fix this.

Caused by: java.lang.IllegalStateException: HST Services unavailable.

[ INFO ] [talledLocalContainer] at org.onehippo.cms7.crisp.hst.module.CrispHstServices.getModuleComponent(CrispHstServices.java:51)

[ INFO ] [talledLocalContainer] at org.onehippo.cms7.crisp.hst.module.CrispHstServices.getDefaultResourceServiceBroker(CrispHstServices.java:64)

[ INFO ] [talledLocalContainer] at com.lbrands.cms.facade.MasterStyleIdFacade.findDocumentById(MasterStyleIdFacade.java:158)

[ INFO ] [talledLocalContainer] at com.lbrands.cms.facade.MasterStyleIdFacade.getFieldExternalDocuments(MasterStyleIdFacade.java:89)

thanks & regards
Gaensh