在 Lotus Notes 下使用 Java 代理时出现问题

发布于 2024-11-17 08:59:51 字数 4014 浏览 4 评论 0原文


我一直在整个网络上搜索 Lotus Notes 代理遇到的问题。这是我的请求。
我也需要从 Java 代理中检索 Web 服务(Java 中)。问题是代理必须在服务器上运行,因为 Jar 文件无法安装在每台计算机上。现在,在客户端的网络上,人们必须通过代理才能访问网络,这需要身份验证。我知道我们可以将 Domino 服务器设置为使用代理,但它已经设置为 LDAP。因此,我发现的唯一选择是使用 Java 系统属性连接到代理,然后获取 Web 服务。因此,我设置了 http.proxyHost 和 http.proxyPort,并使用身份验证器作为登录名和密码。当我通过 HTTP 连接来检索 Web 服务时,一切都很好,或者看起来很好,因为我得到了一个有效的 Java 对象。现在,一旦获得该实例,我就需要初始化一个会话。当我启动该方法时,我得到以下信息:

2011-06-28 13:46:50   Agent  error: WebServiceEngineFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode: 
faultString: java.net.SocketException: Operation timed out: connect:could be due to invalid address
faultActor: 
faultNode: 
faultDetail: 
2011-06-28 13:46:50   Agent  error: java.net.SocketException: Operation timed out: connect:could be due to invalid address
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.AxisFault.makeFault(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.transport.http.HTTPSender.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.strategies.InvocationStrategy.visit(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.SimpleChain.doVisiting(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.SimpleChain.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.AxisClient.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invokeEngine(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at com.casebank.spotlight.webservice.TroubleShootSoap11BindingStub.initiateSession(TroubleShootSoap11BindingStub.java:334)
2011-06-28 13:46:50   Agent  error:     at JProxyManager.getResultFromAddress(JProxyManager.java:118)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
2011-06-28 13:46:50   Agent  error:     at java.lang.reflect.Method.invoke(Method.java:391)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.JavaConnectInvoker.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
2011-06-28 13:46:50   Agent  error:     at java.lang.reflect.Method.invoke(Method.java:391)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.JavaConnectLoader.invoke(Unknown Source)

这告诉我 Java 正在尝试使用套接字进行连接,而套接字不是 HTTP 协议。因此,我尝试使用端口 1080 而不是 HTTP 8080 将ocksProxyHost 和socksProxyPort 设置为同一代理,但我不断收到相同的错误。我的搜索让我意识到,即使设置了这些属性,Java 也可能根本不使用 SOCKS 代理。我不明白的是,我可以使用 HTTP 代理来做到这一点(一开始不起作用,但在设置属性后,它就起作用了),但不能使用 SOCKS 代理。它只是不想。一件有趣的事情可能对我有帮助,但我找不到任何相关信息,那就是一开始,我没有代理地址,所以我输入了一个虚拟地址,以便在客户回复我的电子邮件时开始执行代码。当我清除属性socksProxyHost和socksProxyPort时,我从Java得到的异常是UnknowHostException,它指向我的虚拟地址。那里(我搜索过!)不再写那个地址了。即使当我打印属性时,也使用这个:

System.getProperties().list(System.out);

我看不到它。我不认为客户端可能像我一样设置了虚拟代理地址,并且由于它在服务器上运行,因此它与我的配置无关。 Notes上的Java版本是1.4并且类java.net.Proxy不在服务器上。我只是想知道它会让你想到什么。我什至尝试设置与代理相关的所有可能的属性(http、https、ftp、socks),我快疯了!一定有办法,我觉得我已经很接近了,但我真的厌倦了测试一堆不起作用的东西!

非常感谢您的帮助。

I've been searching the whole web for a problem that I have with a lotus notes agent. Here is my resquest.
I need to retreive a Webservice (in Java) from an agent in Java too. The problem is that the agent must run on the server because the Jar file cannot be installed on every computer. Now, on the client's network, people must go thru a Proxy to access the web, which needs an authentication. I know that we can set the Domino server to use a proxy, but it's already set to LDAP. So, the only option I found is to use Java system properties to connect to the proxy and then get the webservice. So, I set http.proxyHost and http.proxyPort and I use the Authenticator for the login and password. When I connected via HTTP to retreive the webservice, everything is fine, or seems fine, since I get a valid Java object. Now once I get that instance, I need to initialize a session. When I launch the method, I get this:

2011-06-28 13:46:50   Agent  error: WebServiceEngineFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode: 
faultString: java.net.SocketException: Operation timed out: connect:could be due to invalid address
faultActor: 
faultNode: 
faultDetail: 
2011-06-28 13:46:50   Agent  error: java.net.SocketException: Operation timed out: connect:could be due to invalid address
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.AxisFault.makeFault(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.transport.http.HTTPSender.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.strategies.InvocationStrategy.visit(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.SimpleChain.doVisiting(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.SimpleChain.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.AxisClient.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invokeEngine(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.axis.client.Call.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at com.casebank.spotlight.webservice.TroubleShootSoap11BindingStub.initiateSession(TroubleShootSoap11BindingStub.java:334)
2011-06-28 13:46:50   Agent  error:     at JProxyManager.getResultFromAddress(JProxyManager.java:118)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
2011-06-28 13:46:50   Agent  error:     at java.lang.reflect.Method.invoke(Method.java:391)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.JavaConnectInvoker.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
2011-06-28 13:46:50   Agent  error:     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
2011-06-28 13:46:50   Agent  error:     at java.lang.reflect.Method.invoke(Method.java:391)
2011-06-28 13:46:50   Agent  error:     at lotus.domino.JavaConnectLoader.invoke(Unknown Source)

That tells me that Java is trying to connect using Sockets, which aren't HTTP protocol. So, I tryied setting the socksProxyHost and socksProxyPort to the same Proxy using the port 1080 instead of HTTP 8080, but I keep getting the same error. My searches made me realize that maybe Java doesn't use the SOCKS proxy at all, even if those properties are set. What I don't get, is that I can do it with the HTTP proxy (didn't work at first, but after setting the properties, it had) but not the SOCKS Proxy. It just doesn't want. One interesting thing that might help me but I couldn't find anything about that, is that at first, I didn't have the proxy address, so I typed a dummy one just to start doing the code while the client was answering my email. When I clear the properties socksProxyHost and socksProxyPort, the exception I get from Java is UnknowHostException which points to my dummy address. NOWHERE (and I searched!) is written that address anymore. Even when I print the properties usign this:

System.getProperties().list(System.out);

I don't see it. I don't think that the client might have set the dummy proxy address exactly like I did and since it's running on server, it has nothing to do with my config. The Java version on notes is 1.4 and the class java.net.Proxy is not on the server. I was just wondering it brings somthing to your mind. I even tryied setting all possible properties that are related to Proxies (http, https, ftp, socks) and I'm getting crazy! There must be a way and I feel I'm close, but I'm realy tired of testing bunch of things that doesn't work!

You help is realy appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滴情不沾 2024-11-24 08:59:51

请注意,Java 使用套接字与 http 代理通信。如果这是尝试直接到达服务器而不是通过 http 代理,那就完全有意义了。

我建议您找到包含此代码的 jar,并通过反编译器运行它,以查看代码实际执行的操作以及触发此异常的位置。看起来它没有包装实际的异常,而是创建一个新的异常并丢弃实际的堆栈跟踪。

Note that Java uses sockets to talk to the http proxy. It would make perfect sense though if this was trying to reach the server directly instead of going through the http proxy.

I would suggest you locate the jar containing this code, and run it through a decompiler to see what the code actually does and where this exception was triggerede. It looks like it does not wrap the actual exception but creates a new one discarding the actual stack trace.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文