gpt4 book ai didi

java - 当响应太大时 Jolokia 崩溃

转载 作者:行者123 更新时间:2023-11-28 22:56:58 26 4
gpt4 key购买 nike

我正在尝试在安装了 Jolokia 的 tomcat 上运行它。

http://myserver/jolokia/read/Catalina:type=ThreadPool,name=*/

我得到的是这个

{"error_type":"javax.management.RuntimeOperationsException","error":"javax.management.RuntimeOperationsException : Exception invoking method readBufSize","status":500,"stacktrace":"javax.management.RuntimeOperationsException: Exception invoking method readBufSize\n\tat org.apache.tomcat.util.modeler.BaseModelMBean.getAttribute(BaseModelMBean.java:197)\n\tat com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:647)\n\tat com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)\n\tat org.jolokia.handler.ReadHandler.getAttribute(ReadHandler.java:208)\n\tat org.jolokia.handler.ReadHandler.fetchAttributes(ReadHandler.java:158)\n\tat org.jolokia.handler.ReadHandler.fetchAttributesForMBeanPattern(ReadHandler.java:97)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:82)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:34)\n\tat org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:150)\n\tat org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:91)\n\tat org.jolokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:81)\n\tat org.jolokia.backend.BackendManager.callRequestDispatcher(BackendManager.java:196)\n\tat org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:175)\n\tat org.jolokia.http.HttpRequestHandler.executeRequest(HttpRequestHandler.java:150)\n\tat org.jolokia.http.HttpRequestHandler.handleGetRequest(HttpRequestHandler.java:79)\n\tat org.jolokia.http.AgentServlet$3.handleRequest(AgentServlet.java:239)\n\tat org.jolokia.http.AgentServlet.handle(AgentServlet.java:200)\n\tat org.jolokia.http.AgentServlet.doGet(AgentServlet.java:183)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:621)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:728)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)\n\tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)\n\tat org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)\n\tat org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1721)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)\n\tat java.lang.Thread.run(Thread.java:744)\nCaused by: java.lang.NullPointerException\n\tat org.apache.tomcat.util.net.SocketProperties.getRxBufSize(SocketProperties.java:239)\n\tat org.apache.tomcat.util.net.NioEndpoint.getReadBufSize(NioEndpoint.java:619)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:606)\n\tat org.apache.tomcat.util.modeler.BaseModelMBean.getAttribute(BaseModelMBean.java:190)\n\t... 38 more\n"}

Jolokia 似乎无法处理大量响应。有什么办法可以解决这个问题吗?我只需要一些属性,但我不知道如何在单个请求中获取 2 个属性。

这是我的jolokia版本

{"timestamp":1405453600,"status":200,"request":{"type":"version"},"value":{"protocol":"5.0","agent":"0.95","info":{"product":"tomcat","vendor":"Apache","version":"7.0.47"}}}

最佳答案

这可能不是完整的堆栈跟踪。这并不是说 Jolokia 不能处理大对象(好吧,如果有问题,那是你的 sercer 容器的问题),因为你得到了完整的响应。原因(隐藏在“38 more”中)是方法 'getReadBufSize' 抛出异常。

不过,您有两个选择:

  • 使用查询参数 ignoreErrors=true 如果您像这样执行批量请求,这将非常有用。
  • 您确实可以选择多个属性:对于 GET 请求,只需将它们与“,”连接起来,对于 POST 请求,则使用 JSON 数组。所有内容都在 reference manual 中进行了解释.对于您的请求:http://myserver/jolokia/read/Catalina:type=ThreadPool,name=*/attr1,attr2 不过,您需要一个 post 1.0.0 Jolokia 代理。

关于java - 当响应太大时 Jolokia 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24767137/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com