Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-1223

Elasticsearch Metrics query throws format exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • 1.2.x
    • 1.2.8.Final
    • Management API
    • None
    • Hide

      1. setup apiman wildfly
      2. setup separate elasticsearch 1.7.5 instance on same machine and bind to localhost:9200/9300
      3. configure apiman.properties as atached
      4. configure an api such as the echo quick start, run a few transactions and then click on metrics tab either on API or ClientApp

      Show
      1. setup apiman wildfly 2. setup separate elasticsearch 1.7.5 instance on same machine and bind to localhost:9200/9300 3. configure apiman.properties as atached 4. configure an api such as the echo quick start, run a few transactions and then click on metrics tab either on API or ClientApp

      I followed the production installation instructions and setup an standalone elasticsearch 1.7.5 instance and then configured apiman to use that instance. Most things work but unforutnately I am getting below error when looking at metrics.

      2016-10-11 15:12:42,563 ERROR [io.undertow.request] (default task-29) UT005023: Exception handling request to /apiman/organizations/test/clients/bla/versions/1.0/metrics/apiUsage: org.jboss.resteasy.spi.UnhandledException: java.lang.NumberFormatException: For input string: ""
              at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:77)
              at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:220)
              at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:175)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:418)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)
              at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
              at io.apiman.common.servlet.RootResourceFilter.doFilter(RootResourceFilter.java:59)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.apiman.manager.api.war.TransactionWatchdogFilter.doFilter(TransactionWatchdogFilter.java:57)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.apiman.manager.api.security.impl.DefaultSecurityContextFilter.doFilter(DefaultSecurityContextFilter.java:56)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.apiman.common.servlet.DisableCachingFilter.doFilter(DisableCachingFilter.java:52)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.apiman.common.servlet.ApimanCorsFilter.doFilter(ApimanCorsFilter.java:71)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.apiman.common.servlet.LocaleFilter.doFilter(LocaleFilter.java:61)
              at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
              at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
              at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.keycloak.adapters.undertow.UndertowAuthenticatedActionsHandler.handleRequest(UndertowAuthenticatedActionsHandler.java:66)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
              at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
              at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
              at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.keycloak.adapters.undertow.ServletPreAuthActionsHandler.handleRequest(ServletPreAuthActionsHandler.java:69)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
              at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
              at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
              at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
              at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
              at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
              at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NumberFormatException: For input string: ""
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
              at java.lang.Integer.parseInt(Integer.java:592)
              at java.lang.Integer.<init>(Integer.java:867)
              at io.apiman.manager.api.es.DefaultEsClientFactory.updateHttpConfig(DefaultEsClientFactory.java:103)
              at io.apiman.manager.api.es.DefaultEsClientFactory.createClient(DefaultEsClientFactory.java:80)
              at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)
              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)
              at io.apiman.manager.api.es.IEsClientFactory$816713469$Proxy$_$$_WeldClientProxy.createClient(Unknown Source)
              at io.apiman.manager.api.war.WarCdiFactory.provideMetricsESClient(WarCdiFactory.java:273)
              at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
              at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
              at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:100)
              at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:161)
              at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:181)
              at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
              at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101)
              at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.get(ContextualInstanceStrategy.java:141)
              at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)
              at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
              at io.searchbox.client.JestClient$816713470$Proxy$_$$_WeldClientProxy.execute(Unknown Source)
              at io.apiman.manager.api.es.ESMetricsAccessor.getClientUsagePerApi(ESMetricsAccessor.java:647)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)
              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)
              at io.apiman.manager.api.core.IMetricsAccessor$816713471$Proxy$_$$_WeldClientProxy.getClientUsagePerApi(Unknown Source)
              at io.apiman.manager.api.rest.impl.OrganizationResourceImpl.getClientUsagePerApi(OrganizationResourceImpl.java:906)
              at io.apiman.manager.api.rest.impl.OrganizationResourceImpl$Proxy$_$$_WeldClientProxy.getClientUsagePerApi(Unknown Source)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:402)
              ... 68 more
      

              ewittman@redhat.com Eric Wittmann
              bertramn Niels Bertram (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: