gpt4 book ai didi

java - 获取 TIBCO EMS 队列

转载 作者:行者123 更新时间:2023-11-30 02:59:12 32 4
gpt4 key购买 nike

我尝试创建类java可以访问EMS队列检查挂起的消息但它在行中给了我错误 TibjmsAdmin admin = new TibjmsAdmin("tcp://local host:7222","admin","");下面是我的简单代码

public static void main(String[] args) throws TibjmsAdminException {
TibjmsAdmin admin = new TibjmsAdmin("tcp://localhost:7222","admin","");
String destName = null;
QueueInfo di = admin.getQueue("test");
StatData iStats = di.getInboundStatistics();
StatData oStats = di.getOutboundStatistics();
long pendingMessages = di.getPendingMessageCount();
long pendingSize = di.getPendingMessageSize();
long inMsgRate = iStats.getMessageRate();
long inByteRate = iStats.getByteRate();
long outMsgRate = oStats.getMessageRate();
long outByteRate = oStats.getByteRate();
System.out.println(pendingMessages);
}

我尝试做的方法可以给他队列名称,它给我待处理的消息

Error : run: Exception in thread "main" java.lang.NoClassDefFoundError: com/tibco/tibjms/TibjmsQueueConnectionFactory at com.tibco.tibjms.admin.MessengerUtil.(MessengerUtil.java:46) at com.tibco.tibjms.admin.TibjmsAdmin.(TibjmsAdmin.java:424) at com.tibco.tibjms.admin.TibjmsAdmin.(TibjmsAdmin.java:405) at EMS.main(EMS.java:31) Caused by: java.lang.ClassNotFoundException: com.tibco.tibjms.TibjmsQueueConnectionFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 4 more Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)

最佳答案

将 tibjms.jar 文件放入类路径

java -cp &lt;path to jar&gt;/tibjms.jar:<all my other jars>

关于java - 获取 TIBCO EMS 队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36383650/

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