Skip to Content
1
Former Member
Aug 06, 2014 at 03:50 PM

Issue while executing getProductForCode() - Resolved

1873 Views

Hi All

I have implemented a JMS message listener which listens to a queue where we get information on the product. The product information is read from the queue and needs to be updated in hybris.

As this is out of web context, in the message listener we have written the following code

  • final CatalogVersionModel catalogVersionModel = catalogVersionService.getCatalogVersion("demoProductCatalog","Online");

  • final ProductModel productModel =
    productService.getProductForCode(catalogVersionModel, "0001");

My site runs fine but the listener throws the exception when a message is added on the queue i am getting the following exception INFO | jvm 1 | main | 2014/08/06 19:15:02.681 | java.lang.NullPointerException INFO | jvm 1 | main | 2014/08/06 19:15:02.682 | at de.hybris.platform.servicelayer.session.impl.DefaultSessionService.executeInLocalView(DefaultSessionService.java:92) INFO | jvm 1 | main | 2014/08/06 19:15:02.686 | at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.getJaloResult(DefaultFlexibleSearchService.java:363) INFO | jvm 1 | main | 2014/08/06 19:15:02.690 | at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.search(DefaultFlexibleSearchService.java:164) INFO | jvm 1 | main | 2014/08/06 19:15:02.693 | at de.hybris.platform.catalog.daos.impl.DefaultCatalogVersionDao.findAllCatalogVersions(DefaultCatalogVersionDao.java:99) INFO | jvm 1 | main | 2014/08/06 19:15:02.703 | at de.hybris.platform.catalog.impl.DefaultCatalogVersionService.getAllCatalogVersions(DefaultCatalogVersionService.java:234)

Why is it looking into the session, i do not want anything from the session this is something that is out of webcontext and should be running in the background. All i want is the ProductModel which i will update and save.