SAP Knowledge Base Article - Preview

2528757 - How to run FlexibleSearch in custom EventListener

Symptom

When writing a custom eventListener (extending AbstractEventListener), within itself it cannot run flexibleSearch.
It will throw error looking up JNDI data source when calling search.

Here's the console log.
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | ^[[m^[[0;31mERROR [PooledThread[1]] [HybrisApplicationEventMulticaster] error looking up JNDI data source "java:comp/env/jdbc/hybrisDS" due to Name [comp/env/jdbc/hybrisDS] is not bound in this Context. Unable to find [comp].
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | ^[[mde.hybris.platform.jalo.JaloSystemException: error looking up JNDI data source "java:comp/env/jdbc/hybrisDS" due to Name [comp/env/jdbc/hybrisDS] is not bound in this Context. Unable to find [comp].[HY--1]
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.type.TypeManagerEJB.getSubTypesInternal(TypeManagerEJB.java:795)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.type.TypeManagerEJB.getAllSubTypes(TypeManagerEJB.java:748)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.type.ComposedTypeEJBImpl$3.compute(ComposedTypeEJBImpl.java:191)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.cache.AbstractCacheUnit.privateGetNoLock(AbstractCacheUnit.java:302)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.cache.AbstractCacheUnit.privateGet(AbstractCacheUnit.java:275)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:182)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.jalo.JaloTypeCacheUnit.getCached(JaloTypeCacheUnit.java:86)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.type.ComposedTypeEJBImpl.getAllSubTypes(ComposedTypeEJBImpl.java:193)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.jalo.type.ComposedType.getAllSubTypes(ComposedType.java:934)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.getQueryFilters(FlexibleSearch.java:1032)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.flexiblesearch.typecache.impl.DefaultFlexibleSearchTypeCacheProvider.getQueryFilters(DefaultFlexibleSearchTypeCacheProvider.java:185)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.flexiblesearch.ParsedType.createParsedSubtypesAndRestrictionClauses(ParsedType.java:187)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.flexiblesearch.ParsedType.getOwnRestrictions(ParsedType.java:464)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.flexiblesearch.ParsedType.translateRestrictionsAndSubtypes(ParsedType.java:606)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.flexiblesearch.ParsedType.translate(ParsedType.java:638)
INFO | jvm 1 | main | 2017/05/17 12:05:59.391 | at de.hybris.platform.persistence.flexiblesearch.ParsedText$2.translate(ParsedText.java:270)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.flexiblesearch.FlexibleSearchTools.replace(FlexibleSearchTools.java:310)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.flexiblesearch.ParsedText.translate(ParsedText.java:263)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.flexiblesearch.FromClause.translate(FromClause.java:48)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.flexiblesearch.ParsedQuery.translate(ParsedQuery.java:401)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.flexiblesearch.ParsedQuery.getTranslatedQuery(ParsedQuery.java:181)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.flexiblesearch.QueryParser.translateQuery(QueryParser.java:229)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.translate(FlexibleSearch.java:2006)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1411)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.jalo.flexiblesearch.FlexibleSearch.search(FlexibleSearch.java:1627)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService$2.execute(DefaultFlexibleSearchService.java:374)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService$2.execute(DefaultFlexibleSearchService.java:1)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.session.impl.DefaultSessionService.executeInLocalView(DefaultSessionService.java:88)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.getJaloResult(DefaultFlexibleSearchService.java:363)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.search(DefaultFlexibleSearchService.java:164)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao.find(DefaultGenericDao.java:55)
...
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.event.impl.AbstractEventListener.onApplicationEvent(AbstractEventListener.java:67)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.event.impl.AbstractEventListener.onApplicationEvent(AbstractEventListener.java:1)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.event.impl.HybrisApplicationEventMulticaster.notifyListeners(HybrisApplicationEventMulticaster.java:85)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.event.impl.HybrisApplicationEventMulticaster.multicastEvent(HybrisApplicationEventMulticaster.java:61)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.spring.ctx.CloseAwareApplicationContext.publishEvent(CloseAwareApplicationContext.java:97)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.event.impl.SpringEventSender.sendEvent(SpringEventSender.java:36)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.servicelayer.event.impl.PlatformClusterEventSender.processPacket(PlatformClusterEventSender.java:188)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.cluster.legacy.LegacyBroadcastHandler$2.run(LegacyBroadcastHandler.java:204)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.util.threadpool.PoolableThread.run(PoolableThread.java:198)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | Caused by: de.hybris.platform.persistence.hjmp.HJMPFinderException: error looking up JNDI data source "java:comp/env/jdbc/hybrisDS" due to Name [comp/env/jdbc/hybrisDS] is not bound in this Context. Unable to find [comp].
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.type.ComposedType_HJMPWrapper.ejbFindByInheritancePath(ComposedType_HJMPWrapper.java:1792)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at sun.reflect.GeneratedMethodAccessor441.invoke(Unknown Source)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at java.lang.reflect.Method.invoke(Method.java:606)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1072)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.util.Utilities.callMethod(Utilities.java:1062)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.framework.HomeInvocationHandler.invoke(HomeInvocationHandler.java:93)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at com.sun.proxy.$Proxy21.findByInheritancePath(Unknown Source)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | at de.hybris.platform.persistence.type.TypeManagerEJB.getSubTypesInternal(TypeManagerEJB.java:766)
INFO | jvm 1 | main | 2017/05/17 12:05:59.392 | ... 46 more

 


Read more...

Environment

  • SAP Hybris Commerce 5.2.0.14   

Product

SAP hybris Commerce Suite 5.2

Keywords

flexibleSearch, JNDI, hybrisDS, DataSource, JDBCConnectionFactory , KBA , CEC-COM-CPS , Commerce Platform & Suite (SAP Commerce) , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.