我正在尝试将Moskito检查监控工具与Spring Boot应用程序集成,但是我看到rmi端口问题(设置JAVA_OPTS =%JAVA_OPTS%-DlocalRmiRegistryPort = 9401)也注意到在将RMIport设置为9401后,我不知道看到端口正在打开(netstat -an | grep 9401)
以下是我已完成的步骤并收到错误消息。如果我遗漏了任何东西,请纠正我。
1)我的操作系统 - Windows 7 2)我已经安装了Apache Tomcat v7,Java 8 3)我已经下载了Moskito版本2.7.8 https://www.moskito.org/download.html 4)已安装的Moskito检查和Web UI正在加载,在http://blog.anotheria.net/msk/the-complete-moskito-integration-guide-step-1/中可以看到来自MoSKito Inspect tomcat的数据 5)我创建了一个示例Spring Boot Web应用程序,使用“mvn clean package”构建它并创建.War文件。我看到以下与moskito相关的库以及lib文件夹中的其他jar文件。 moskito-aop-2.7.8.jar,moskito-core-2.7.8.jar,moskito-inspect-remote-2.7.8.jar,moskito-web-2.7.8.jar,moskito-webui-2.7.8。罐。 6)当我部署这个war文件时,我可以通过以下URL访问我的应用程序:http://localhost:8090/(port 8090)并且应用程序正常运行。 6)现在,当我使用以下命令配置RMI端口9041并尝试通过以下URL访问moskito-inspect webui时:http://localhost:8088/moskito,Tomcat响应404 [未找到],并显示以下错误消息。 命令:
java -jar -DlocalRmiRegistryPort=9401 -Dserver.port=8090 myproject-0.0.1-SNAPSHOT.jar
错误讯息:
MoSKito遇到错误:
无法连接到localhost @ localhost:9401,由于:无法解析手动设置引用。 localhost上的服务器,端口:9401已关闭或未正确配置
[net.anotheria.moskito.webui.util.APILookupUtility.findRemote(APILookupUtility.java:203),net.anotheria.moskito.webui.util.APILookupUtility.findRemote(APILookupUtility.java:177),net.anotheria。 moskito.webui.util.APILookupUtility.getAdditionalFunctionalityAPI(APILookupUtility.java:130),net.anotheria.moskito.webui.shared.action.BaseMoskitoUIAction.preProcess(BaseMoskitoUIAction.java:404),net.anotheria.maf.MAFFilter.doPerform( MAFFilter.java:260),net.anotheria.maf.MAFFilter.doFilter(MAFFilter.java:215),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241),org.apache.catalina.core .ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208),net.anotheria.anoplass.api.filter.APIFilter.doFilter(APIFilter.java:107),org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241 ),org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208),org.apache.catalina.core.StandardWr apperValve.invoke(StandardWrapperValve.java:220),org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122),org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501),org .apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171),org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102),org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve .java:950),org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116),org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408),org.apache.coyote。 http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040),org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:607),org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint。 java:316),java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142),java.util.concurrent.ThreadPool执行者$ Worker.run(ThreadPoolExecutor.java:617),org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61),java.lang.Thread.run(Thread.java:745) ]
下面是我的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>myproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<moskito.version>2.7.8</moskito.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-core</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-aop</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-inspect-remote</artifactId>
<version>${moskito.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>net.anotheria</groupId>
<artifactId>moskito-aop</artifactId>
</aspectLibrary>
</aspectLibraries>
<complianceLevel>1.8</complianceLevel>
<source>1.8</source>
<target>1.8</target>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
我做错了什么,可能是某个人面临同样的问题?感谢您的意见。
答案 0 :(得分:0)
你添加了moskito-springboot依赖吗?
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-springboot</artifactId>
<version>2.7.8</version>
</dependency>
它的作用是启动后端,但请注意自己的详细信息: https://github.com/anotheria/moskito/blob/master/moskito-integration/moskito-springboot/src/main/java/net/anotheria/moskito/integration/springboot/MoskitoAutoConfiguration.java
所以这次调用就会发生魔力:
LOGGER.info("Starting Moskito backend for remote");
StartMoSKitoInspectBackendForRemote.startMoSKitoInspectBackend();
在添加人工制品后,您应该检查上述消息的日志。
希望能有所帮助 利昂