Hybris在地理定位过程中引发异常

时间:2018-10-31 18:56:30

标签: google-maps-api-3 geolocation hybris

在Hybris 6.5中使用服务点时遇到麻烦 当我运行cronjob或尝试手动定位POS时,出现以下错误:

ERROR [Geolocalizar Centros de Servicio::de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob] (Geolocalizar Centros de Servicio) [GeocodingJob] Failed to Geocode POS (8796551972856) CelayaPOS Error: null Address: Carr. Ind Celaya-Villagrán km 3.57, 38158, Celaya, MX

我已经调试了代码,并且抛出错误的parta如下:

final PointOfServiceModel pos = context.getData();
    final DistanceUnawareLocation location = new DistanceUnawareLocation(pos);

    try
    {
        final GPS e1 = this.geoServiceWrapper.geocodeAddress(location);//Throws Error

以下是当我单击地理位置POS图标时的错误堆栈跟踪:

 [exec] de.hybris.platform.storelocator.exception.GeoServiceWrapperException
 [exec]     at de.hybris.platform.storelocator.impl.GoogleMapTools.geocodeAddress(GoogleMapTools.java:206)
 [exec]     at de.hybris.platform.storelocator.impl.GoogleMapsServiceWrapper.geocodeAddress(GoogleMapsServiceWrapper.java:56)
 [exec]     at com.mabe.core.pos.backoffice.PointOfServiceGeolocationAction.perform(PointOfServiceGeolocationAction.java:62)
 [exec]     at com.hybris.cockpitng.actions.impl.DefaultActionRenderer.perform(DefaultActionRenderer.java:241)
 [exec]     at com.hybris.cockpitng.actions.impl.DefaultActionRenderer.lambda$createEventListener$2(DefaultActionRenderer.java:450)
 [exec]     at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3163)
 [exec]     at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3133)
 [exec]     at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3075)
 [exec]     at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
 [exec]     at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1853)
 [exec]     at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1625)
 [exec]     at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1328)
 [exec]     at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606)
 [exec]     at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482)
 [exec]     at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:490)
 [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
 [exec]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:208)
 [exec]     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
 [exec]     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
 [exec]     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
 [exec]     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at com.hybris.backoffice.mobile.filter.BackofficeMobileFilter.doFilter(BackofficeMobileFilter.java:63)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at de.hybris.platform.servicelayer.web.WebAppMediaFilter.doFilter(WebAppMediaFilter.java:141)
 [exec]     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
 [exec]     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:301)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$StatisticsGatewayFilter.doFilter(AbstractPlatformFilterChain.java:390)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.WebAppMediaFilter.doFilter(WebAppMediaFilter.java:141)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at com.hybris.cockpitng.modules.spring.filter.ExternalModuleContextClassLoaderFilter.doFilter(ExternalModuleContextClassLoaderFilter.java:44)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.DynamicCatalogVersionActivationFilter.doFilter(DynamicCatalogVersionActivationFilter.java:90)
 [exec]     at de.hybris.platform.servicelayer.web.DynamicCatalogVersionActivationFilter$$FastClassBySpringCGLIB$$2d468805.invoke(<generated>)
 [exec]     at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
 [exec]     at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)
 [exec]     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
 [exec]     at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
 [exec]     at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
 [exec]     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 [exec]     at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)
 [exec]     at de.hybris.platform.servicelayer.web.DynamicCatalogVersionActivationFilter$$EnhancerBySpringCGLIB$$a8cac040.doFilter(<generated>)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.DataSourceSwitchingFilter.doFilter(DataSourceSwitchingFilter.java:70)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.SessionFilter.doFilter(SessionFilter.java:99)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.RedirectWhenSystemIsNotInitializedFilter.doFilter(RedirectWhenSystemIsNotInitializedFilter.java:101)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.TenantActivationFilter.doFilter(TenantActivationFilter.java:88)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:44)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:271)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.processStandardFilterChain(AbstractPlatformFilterChain.java:201)
 [exec]     at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.doFilterInternal(AbstractPlatformFilterChain.java:179)
 [exec]     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
 [exec]     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
 [exec]     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at de.hybris.platform.servicelayer.web.XSSFilter.processPatternsAndDoFilter(XSSFilter.java:358)
 [exec]     at de.hybris.platform.servicelayer.web.XSSFilter.doFilter(XSSFilter.java:306)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 [exec]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 [exec]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
 [exec]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
 [exec]     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
 [exec]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
 [exec]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
 [exec]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
 [exec]     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
 [exec]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
 [exec]     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
 [exec]     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
 [exec]     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
 [exec]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 [exec]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 [exec]     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 [exec]     at java.lang.Thread.run(Thread.java:748)

我正在使用OOTB Hybris商店定位器功能。我的apikey有效。

3 个答案:

答案 0 :(得分:1)

这可能意味着它无法解释或对地址进行地理编码。检查“ Carr。IndCelaya-VillagrÃnkm 3.57,38158,Celaya,MX”是否正确。

答案 1 :(得分:0)

真正的异常原因取决于所使用的GeoWebServiceWrapper实现。 您是否使用OOTB实现?

实际上,GeoServiceWrapperException应该包含应记录的真实原因,但在您的情况下是nullCelayaPOS Error: null

能否请您提供stacktrace以获取更多详细信息?

答案 2 :(得分:0)

在我的hybris实例中,我刚刚遇到了相同的错误,之前地理定位工作在工作。 我调试了所有内容,发现hybris在没有google api密钥的情况下拨打电话,这导致了错误的请求。