Skip to Content
Former Member
Jun 20, 2016 at 03:18 PM

Sessionservice Issue in ThreadPoolExecutor



for an XML-based product import I am trying to run multiple consumer threads for the product import. As part of the import process my Runnable tries to load a product before importing it. I am using the method DefaultProductService.getProductForCode to retrieve the product. The injected product service instance is shared among the threads in the thread pool. Unfortunately when I run the import as an integration test I receive the following Stacktrace:

] Exception in thread "pool-5-thread-1" java.lang.NullPointerException [yunitint] at de.hybris.platform.servicelayer.session.impl.DefaultSessionService.executeInLocalView( [yunitint] at [yunitint] at [yunitint] at de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao.find( [yunitint] at de.hybris.platform.product.daos.impl.DefaultProductDao.findProductsByCode( [yunitint] at de.hybris.platform.product.impl.DefaultProductService.getProductForCode( [yunitint] at$ProductImportTask.loadOrCreateProduct( [yunitint] at$ [yunitint] at java.util.concurrent.ThreadPoolExecutor.runWorker( [yunitint] at java.util.concurrent.ThreadPoolExecutor$ [yunitint] at

It seems as if the session service returns a null session but I do not understand why this is the case nor how to fix it.