我试图在安装了Jolokia的tomcat上运行它。
http://myserver/jolokia/read/Catalina:type=ThreadPool,name=*/
我得到的是这个
{" ERROR_TYPE":" javax.management.RuntimeOperationsException""错误":" javax.management.RuntimeOperationsException :异常调用方法 readBufSize""状态" 500"堆栈跟踪":" javax.management.RuntimeOperationsException: 异常调用方法readBufSize \ n \ tat org.apache.tomcat.util.modeler.BaseModelMBean.getAttribute(BaseModelMBean.java:197)\ n \达 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:647)\ n \达 com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)\ n \达 org.jolokia.handler.ReadHandler.getAttribute(ReadHandler.java:208)\ n \达 org.jolokia.handler.ReadHandler.fetchAttributes(ReadHandler.java:158)\ n \达 org.jolokia.handler.ReadHandler.fetchAttributesForMBeanPattern(ReadHandler.java:97)\ n \达 org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:82)\ n \达 org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:34)\ n \达 org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:150)\ n \达 org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:91)\ n \达 org.jolokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:81)\ n \达 org.jolokia.backend.BackendManager.callRequestDispatcher(BackendManager.java:196)\ n \达 org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:175)\ n \达 org.jolokia.http.HttpRequestHandler.executeRequest(HttpRequestHandler.java:150)\ n \达 org.jolokia.http.HttpRequestHandler.handleGetRequest(HttpRequestHandler.java:79)\ n \达 org.jolokia.http.AgentServlet $ 3.handleRequest(AgentServlet.java:239)\ n \达 org.jolokia.http.AgentServlet.handle(AgentServlet.java:200)\ n \达 org.jolokia.http.AgentServlet.doGet(AgentServlet.java:183)\ n \达 javax.servlet.http.HttpServlet.service(HttpServlet.java:621)\ n \达 javax.servlet.http.HttpServlet.service(HttpServlet.java:728)\ n \达 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)\ n \达 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)\ n \达 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)\ n \达 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)\ n \达 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)\ n \达 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)\ n \达 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)\ n \达 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)\ n \达 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)\ n \达 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)\ n \达 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)\ n \达 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)\ n \达 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)\ n \达 org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:603)\ n \达 org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1721)\ n \达 org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.run(NioEndpoint.java:1679)\ n \达 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\ n \达 java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:615)\ n \达 java.lang.Thread.run(Thread.java:744)\ n由以下各项提供: 显示java.lang.NullPointerException \ n \达 org.apache.tomcat.util.net.SocketProperties.getRxBufSize(SocketProperties.java:239)\ n \达 org.apache.tomcat.util.net.NioEndpoint.getReadBufSize(NioEndpoint.java:619)\ n \达 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\ n \ tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\ n \达 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\ n \达 java.lang.reflect.Method.invoke(Method.java:606)\ n \达 org.apache.tomcat.util.modeler.BaseModelMBean.getAttribute(BaseModelMBean.java:190)\ n \ t ... 还有38个\ n"}
看起来Jolokia无法处理大量回复。我能解决这个问题吗?我只需要一些属性,但我无法弄清楚如何在单个请求中获得2个属性。
这是我的jolokia版本
{"时间戳":1405453600,"状态":200,"请求" {"类型":"版本& #34;}"值" {"协议":" 5.0""试剂":" 0.95&# 34;,"信息" {"产品":" Tomcat的""供应商":"阿帕奇",& #34;版本":" 7.0.47"}}}
答案 0 :(得分:1)
那可能不是完整的堆栈跟踪。这并不是说Jolokia无法处理大型物体(好吧,如果有问题,它就是你的sercer容器),因为你得到了完整的回复。原因(隐藏在" 38以及#34;中)的原因是方法' getReadBufSize'抛出异常。
您有两种选择:
ignoreErrors=true
,如果您执行此类批量请求,这非常有用。http://myserver/jolokia/read/Catalina:type=ThreadPool,name=*/attr1,attr2
您需要1.0.0 Jolokia代理商。