- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我安装了 alfresco 4.0d,我正在尝试使用 cacti 设置监控。我从percona得到了模板.当我尝试运行以下命令时出现错误。我使用了 tomcat/lib 目录中 percona 链接中提到的 jar 文件。
/opt/apache-ant-1.8.1/bin/ant -f jmx-monitor.xml -v -d
Apache Ant version 1.8.1 compiled on April 30 2010
Buildfile: /home/cacti/jmx-monitor.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.6 in: /opt/alfresco-4.0.d/java/jre
Detected OS: Linux
Adding reference: ant.ComponentHelper
Setting ro project property: ant.file -> /home/cacti/jmx-monitor.xml
Setting ro project property: ant.file.type -> file
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile /home/cacti/jmx-monitor.xml with URI = file:/home/cacti/jmx-monitor.xml
Setting ro project property: ant.project.name -> JMX Monitor
Adding reference: JMX Monitor
Setting ro project property: ant.project.default-target -> status
Setting ro project property: ant.file.JMX Monitor -> /home/cacti/jmx-monitor.xml
Setting ro project property: ant.file.type.JMX Monitor -> file
Project base dir set to: /home/cacti
+Target:
+Target: status
Adding reference: ant.LocalProperties
parsing buildfile jar:file:/opt/apache-ant-1.8.1/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/opt/apache-ant-1.8.1/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
Setting project property: jmx.server.name -> hector
Setting project property: jmx.server.port -> 50500
Setting ro project property: ant.project.invoked-targets -> status
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `status' is [status]
Complete build sequence is [status, ]
status:
parsing buildfile jar:file:/home/cacti/.ant/lib/catalina-ant.jar!/org/apache/catalina/ant/jmx/antlib.xml with URI = jar:file:/home/cacti/.ant/lib/catalina-ant.jar!/org/apache/catalina/ant/jmx/antlib.xml from a zip file
Class org.apache.catalina.ant.jmx.JMXAccessorTask loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:open org.apache.catalina.ant.jmx.JMXAccessorTask
Class org.apache.catalina.ant.jmx.JMXAccessorSetTask loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:set org.apache.catalina.ant.jmx.JMXAccessorSetTask
Class org.apache.catalina.ant.jmx.JMXAccessorGetTask loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:get org.apache.catalina.ant.jmx.JMXAccessorGetTask
Class org.apache.catalina.ant.jmx.JMXAccessorInvokeTask loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:invoke org.apache.catalina.ant.jmx.JMXAccessorInvokeTask
Class org.apache.catalina.ant.jmx.JMXAccessorQueryTask loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:query org.apache.catalina.ant.jmx.JMXAccessorQueryTask
Class org.apache.catalina.ant.jmx.JMXAccessorCreateTask loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:create org.apache.catalina.ant.jmx.JMXAccessorCreateTask
Class org.apache.catalina.ant.jmx.JMXAccessorUnregisterTask loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:unregister org.apache.catalina.ant.jmx.JMXAccessorUnregisterTask
Class org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:equals org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition
Class org.apache.catalina.ant.jmx.JMXAccessorCondition loaded from parent loader (parentFirst)
+Datatype antlib:org.apache.catalina.ant.jmx:condition org.apache.catalina.ant.jmx.JMXAccessorCondition
BUILD FAILED
/home/cacti/jmx-monitor.xml:29: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrmi
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at org.apache.catalina.ant.jmx.JMXAccessorTask.createJMXConnection(JMXAccessorTask.java:385)
at org.apache.catalina.ant.jmx.JMXAccessorTask.accessJMXConnection(JMXAccessorTask.java:441)
at org.apache.catalina.ant.jmx.JMXAccessorTask.getJMXConnection(JMXAccessorTask.java:479)
at org.apache.catalina.ant.jmx.JMXAccessorTask.execute(JMXAccessorTask.java:346)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: javax.naming.NameNotFoundException: jmxrmi
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:99)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
... 22 more
Total time: 0 seconds
jmx-monitor.xml内容如下
<project name="JMX Monitor"
xmlns:jmx="antlib:org.apache.catalina.ant.jmx"
default="status"
basedir=".">
<property name="jmx.server.name" value="hector" />
<property name="jmx.server.port" value="50500" />
<target name="status" description="Show JMX Cluster state">
<jmx:open
host="${jmx.server.name}"
port="${jmx.server.port}"
username="controlRole"
password="change_asap"/>
<jmx:get
name="java.lang:type=Memory"
attribute="HeapMemoryUsage"
resultproperty="HeapMemoryUsage"
/>
<jmx:get
name="java.lang:type=Memory"
attribute="NonHeapMemoryUsage"
resultproperty="NonHeapMemoryUsage"
/>
<jmx:get
name="java.lang:type=OperatingSystem"
attribute="OpenFileDescriptorCount"
resultproperty="OpenFileDescriptorCount"
/>
<jmx:get
name="java.lang:type=OperatingSystem"
attribute="MaxFileDescriptorCount"
resultproperty="MaxFileDescriptorCount"
/>
<jmx:get
name="Catalina:type=ThreadPool,name=${jmx.catalina.threadpool.name}"
attribute="currentThreadsBusy"
resultproperty="currentThreadsBusy"
/>
<jmx:get
name="Catalina:type=ThreadPool,name=${jmx.catalina.threadpool.name}"
attribute="currentThreadCount"
resultproperty="currentThreadCount"
/>
<jmx:get
name="Catalina:type=ThreadPool,name=${jmx.catalina.threadpool.name}"
attribute="maxThreads"
resultproperty="maxThreads"
/>
<echo>heap_memory_used: ${HeapMemoryUsage.used}
heap_memory_committed: ${HeapMemoryUsage.committed}
heap_memory_max: ${HeapMemoryUsage.max}
non_heap_memory_used: ${NonHeapMemoryUsage.used}
non_heap_memory_committed: ${NonHeapMemoryUsage.committed}
non_heap_memory_max: ${NonHeapMemoryUsage.max}
open_file_descriptors: ${OpenFileDescriptorCount}
max_file_descriptors: ${MaxFileDescriptorCount}
current_threads_busy: ${currentThreadsBusy}
current_thread_count: ${currentThreadCount}
max_threads: ${maxThreads}
</echo>
</target>
</project>
更新
一旦设置了所需的值,我就可以在 64 位 Windows 上使用 jconsole 进行监控。
### RMI service ports ###
alfresco.rmi.services.port=50500
monitor.rmi.service.port=50508
alfresco.rmi.services.external.host=172.16.0.49
在 ctl.sh
- -Dcom.sun.management.jmxremote=true -Djava.rmi.server.hostname=172.16.0.36
我的 Cacti 服务器是 172.16.0.15
,我的带有 jconsole 的 64 位 Windows 是 172.16.0.49
,我的露天服务器是 172.16.0.36
。如果我可以用 jconsole 做到这一点,我该如何用 cacti 进行监控?
当我运行 ant -e -q -f jmx-monitor.xml
时,我得到以下信息
BUILD FAILED
/home/cacti/jmx-monitor.xml:22: Problem: failed to create task or type antlib:org.apache.catalina.ant.jmx:open
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/usr/share/ant/lib
-/root/.ant/lib
-a directory added on the command line with the -lib argument
我试过使用端口 9012、50500、50508
在 jconsole 上,我使用以下命令 service:jmx:rmi:///jndi/rmi://172.16.0.36:50500/alfresco/jmxrmi
并使用 >webapps/alfresco/WEB-INF/classes/alfresco/alfresco-jmxrmi.*
我更新了 setenv.sh
并添加了
CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=%9012%
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
export CATALINA_OPTS
我可以使用 jconsole url 监控 tomcat:service:jmx:rmi:///jndi/rmi://172.16.0.36:9012/jmxrmi
最佳答案
JMX 在 Alfresco Community Edition 中不可用。
关于tomcat - ant 无法检索 RMIServer stub NameNotFoundException jmxrmi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10928956/
我有以下 Spring 代码要使用 Spock 进行测试: @Service @RequiredArgsConstructor public class MyService { private f
package main import ( "fmt" "github.com/hyperledger/fabric/core/chaincode/shim" pb "gith
我刚开始使用Wiremock,但对 stub 有疑问。 从文档看来,您似乎可以在映射下使用JSON文件,也可以在Java代码中使用代码stubFor(get(urlEqualTo(...。但是,我发现
我有以下要测试的对象: public class MyObject { @Inject Downloader downloader; public List readFi
我看到它被使用过很多次,但从未真正停下来质疑过它。现在我想知道 stub 和 stub 之间是否有区别! 有吗?还是历史原因? stub !意思是它 stub 一次?并返回到正常的方法调用? 最佳答案
在 Jasmine 中,如何创建一个纯 stub ,其中所有方法都已 stub 并返回未定义? 最佳答案 我认为没有任何现成的东西可以做到这一点,但您可以创建自己的。 describe('Stub a
两个类。父级:B。子级:A。A.method1() 覆盖 B 的。 public class B { protected boolean method1(){...}; } public cl
我有一个函数依赖于另一个函数,而不是测试依赖性我只想测试该依赖函数的特定结果。但是,当我对函数进行 stub 时,什么也没有发生,返回结果就好像我一开始就没有对函数进行 stub 一样。 示例代码:
这是要测试的代码: const AWS = require('aws-sdk'); const { APPLICATIONS, NOTIFICATION_FREQUENCIES } = req
背景 Any client socket program(C) over TCP/IP looks like, /* Socket creation */ sockfd = socket(AF_I
我正在尝试使用 stub 提供程序(我从 this 问题的答案中得到)和 stub 验证器来实现一个简单的同步适配器。对于身份验证,我使用了基本的 sync adapter example由谷歌提供。
与在测试点使用模拟框架(如 Rhino Mocks)相比,是否存在手动创建 stub 类型更有利的情况。 我们在项目中采用了这两种方法。当我查看一长串对象的 stub 版本时,我的直觉是它会增加维护开
我想 stub doSomething 来回调错误。但是,我只希望它在第一次响应时回调并出现错误。我想在第一次调用后恢复 stub 为了 stub 第一个调用,我可以这样做: var stub = s
我有一个 TimeMachine 类,它为我提供当前日期/时间值。该类看起来像这样: public class TimeMachine { public virtual DateTime Ge
如果我有一个 Rhino Mock 对象,它已经像这样声明了一个 stub 调用: mockEmploymentService.Stub(x => x.GetEmployment(999)).Retu
通常使用 Mockito,如果你 stub 一个被多次调用的方法,你会这样做 Mockito .doReturn(0) .doReturn(1) .doReturn(2)
逻辑 public class Logic { String date = (LocalDateTime.now()).format(DateTimeFormatter.ofPattern("yyyy
我想达到的目的 At the time of compilation, the compiler knew the function call was valid because you includ
这可能是一个简单的问题,但我无法缩短它。 我正在测试我的一个类,ClassToTest。在生产中,它将对第三方库对象(ThirdPartyClass 的实例)执行操作。 我想用 stub 模拟那个类。
我是 js 单元测试的新手,对使用 withArgs 进行 stub 有疑问。 我有一些名为“create”的通用外部函数,我只想为某种参数和原始“create”的其他返回值 stub 它。例如: s
我是一名优秀的程序员,十分优秀!