Я хотел бы создать приложение для мониторинга, и в настоящее время мы планируем это с помощью JMX.Мы используем javax для создания соединения вместо тонкого клиента администратора IBM.
Соединение подготовлено и успешно установлено между удаленным клиентом и сервером, и простые запросы queryNames для MBeans работают, как ожидается.Но в случае каждого вызова invbsphere возвращает следующее сообщение об ошибке:
org.omg.CORBA.UNKNOWN:
at com.sun.corba.se.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:52)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.sun.corba.se.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:132)
at com.sun.corba.se.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:216)
at com.sun.corba.se.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:378)
at com.sun.corba.se.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:366)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:530)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:373)
at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:148)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:475)
at com.sun.jmx.remote.protocol.iiop.ProxyStub._invoke(Unknown Source)
at org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1020)
at custom.app.service.JMXServiceImpl.invokeMBean(JMXServiceImpl.java:115)
at custom.app.service.StatisticsServiceImpl.processStatistics(StatisticsServiceImpl.java:37)
at custom.app.controller.JMXServiceController.processStatistics(JMXServiceController.java:92)
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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Фрагмент кода следующий:
@Override
public void connect(String hostName, String port, String userName, String password, String jndiPath) throws IOException
{
final String serviceURL = "service:jmx:iiop://" + hostName + "/jndi/corbaname:iiop:" + hostName + ":" + port + "/" + jndiPath;
logger.debug("Connecting to: {}", serviceURL);
JMXServiceURL jmxUrl = new JMXServiceURL(serviceURL);
Hashtable<String, Object> environmentProperties = new Hashtable<String, Object>();
environmentProperties.put(JMXConnector.CREDENTIALS, new String[] { userName, password });
JMXConnector jmxConnector = JMXConnectorFactory.connect(jmxUrl, environmentProperties);
this.mBeanServerConnection = jmxConnector.getMBeanServerConnection();
logger.info("JMX connection is ready");
}
Метод invoke следующий:
@Override
public Object invokeMBean(ObjectName objectName, Boolean recursive) throws InstanceNotFoundException, MBeanException, ReflectionException, IOException
{
String[] signature = new String[] { objectName.getClass().getName() };
Object[] params = new Object[] { objectName };
Object result = mBeanServerConnection.invoke(objectName, "getConfig", params, signature);
return result;
}
В журнале трассировки dmgr обычно я вижу ту же ошибку, однако не ясно, в чем проблема:
[11/17/18 22:00:46:232 CET] 00006f24 CSIServerRI 3 The following exception occurred on the server, sending context error back to client:
>> SERVER (id=144d42ac, host=remote.local.ad) TRACE START:
>> org.omg.CORBA.NO_IMPLEMENT: No implementation found for RMI:org.apache.soap.SOAPException:09837B2ECD046021:1E4F3A38EC1D0A62 vmcid: OMG minor code: 1 completed: Maybe
>> at com.ibm.rmi.io.FVDCodeBaseImpl.implementation(FVDCodeBaseImpl.java:114)
>> at com.ibm.org.omg.SendingContext.CodeBase_Tie.implementation(CodeBase_Tie.java:152)
>> at com.ibm.org.omg.SendingContext.CodeBase_Tie._invoke(CodeBase_Tie.java:84)
>> at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:628)
>> at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:510)
>> at com.ibm.rmi.iiop.ORB.process(ORB.java:607)
>> at com.ibm.CORBA.iiop.ORB.process(ORB.java:1583)
>> at com.ibm.rmi.iiop.Connection.doRequestWork(Connection.java:3166)
>> at com.ibm.rmi.iiop.Connection.doWork(Connection.java:3030)
>> at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:64)
>> at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
>> SERVER (id=144d42ac, host=remote.local.ad) TRACE END.
Из-за ошибки "CSIServerRI" в журналах трассировкиЯ подозреваю, что это может быть из-за ошибки в конфигурации безопасности, но, к сожалению, не ясно, какую конфигурацию нужно изменить на сервере или какие параметры нужно указать для клиентского приложения.
Буду признателенесли бы кто-то мог выделить недостающую часть.Есть ли кто-нибудь, кто имеет опыт в этом и может помочь?
Спасибо за вашу помощь заранее.