为什么 RvdProxy.getServices() 可能错误地返回空数组?
以下代码片段尝试创建连接到特定 rvd 的 Tib DaemonManager
,然后查询该 rvd 的服务。
public static void main(String[] args) throws RuntimeException {
DaemonManager daemonManager = new DaemonManager("http://foo.com:7580");
if(daemonManager.getDaemonType() == DaemonManager.RVD) {
DaemonProxy daemonProxy = daemonManager.getDaemonProxy();
final RvdProxy rvdProxy = (RvdProxy) daemonProxy;
Service[] services = rvdProxy.getServices();
System.out.println(services.length); //prints 0
for (Service service : services) {
System.out.println(service.getNetwork());
}
}
}
即使此 rvd 的 Web 界面列出了多个可用服务,这也会打印零。 为什么会发生这种情况?
我连接的守护进程正在运行该软件的 v 7.5.1,而我使用的 rvconfig.jar
来自 v 7.5.1以及。
使用 Tibco 的 DaemonManager 时是否存在导致我陷入困境的问题?
The following code snippet attempts to create a Tib DaemonManager
connecting to a particular rvd, and then query for that rvd's services.
public static void main(String[] args) throws RuntimeException {
DaemonManager daemonManager = new DaemonManager("http://foo.com:7580");
if(daemonManager.getDaemonType() == DaemonManager.RVD) {
DaemonProxy daemonProxy = daemonManager.getDaemonProxy();
final RvdProxy rvdProxy = (RvdProxy) daemonProxy;
Service[] services = rvdProxy.getServices();
System.out.println(services.length); //prints 0
for (Service service : services) {
System.out.println(service.getNetwork());
}
}
}
This prints zero, even though the web interface for this rvd lists multiple available services. Why might this happen?
The daemon I am connecting to is running v 7.5.1 of the software, and the rvconfig.jar
that I am using is from v 7.5.1 as well.
Is there a gotcha when using Tibco's DaemonManager that is causing me to come unstuck?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 Wireshark 来查看我的
RvdProxy
和 RVD 之间发送的流量它本身,看起来像是大量的HTTP GET
流量。例如:果然,经过进一步检查,代理发出的请求是针对由守护进程本身提供服务的网页 - 因此代理 API 只是一个屏幕-刮刀。
但是,如果服务出现在屏幕抓取的网页上,为什么我得不到服务?
打开调试:
您会发现该模式用于从网页中提取服务。 ..
...无法匹配任何内容!就我而言,这是因为我的服务网络不采用
(\\d+\\.\\d+\\.\\d+\\.\\d+)
的形式> 而是;(\\d+\\.\\d+\\.\\d+\\.\\d+)
的形式 - 请注意前导分号。这种微妙的差异是我所有问题的根源!这看起来像是
rvconfig
jar 中的错误 - 需要通过 Tibco 引发! :(I used Wireshark to look at the traffic being sent between my
RvdProxy
and the RVD itself, and it looks like a lot ofHTTP GET
traffic. For example:Sure enough, upon further inspection, it turns out that the requests being made by the proxy are to the web pages served by the Daemon itself - so the proxy API is just a screen-scraper.
But why am I getting no services if they appear on the web pages that are being screen-scraped?
Switch on debugging:
And you find that the pattern being used to extract the services from the web-page...
...fails to match anything! In my case it is because my service networks are not of the form
(\\d+\\.\\d+\\.\\d+\\.\\d+)
but rather of the form;(\\d+\\.\\d+\\.\\d+\\.\\d+)
- note the leading semicolon. This subtle difference is the source of all of my problems!This looks like a bug in the
rvconfig
jar - which needs to be raised with Tibco! :(