How do I set up Glassfish to go via a proxy server?(如何设置 Glassfish 以通过代理服务器?)
问题描述
我在办公室内的本地计算机上运行 Glassfish v2.1.1 实例时遇到问题,我们有一个用于传出连接的代理服务器.我最初的解决方法是在家工作.
I have been having issues with running a Glassfish v2.1.1 instance on my local machine from within the office, where we have a proxy server for outgoing connections. My initial workaround has been to work from home.
我正在公司外部的 HTTPS 服务器上调用 SOAP 服务.由于 Glassfish 未通过公司的代理服务器,因此在尝试初始化 SOAP 客户端时出现以下错误:
I am calling a SOAP service on a HTTPS server outside of the company. As Glassfish is not going via the company's proxy server, I get the following error when trying to initialise my SOAP clients:
javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.hostname.com...
和
Caused by: java.net.UnknownHostException: www.hostname.com
我在我的命令行上设置了代理环境变量,并且我的系统代理设置都正常工作,以便我可以使用浏览器访问 WSDL.我应该如何配置 Glassfish?
I have proxy environment variables set on my command line, as well as my system proxy settings all working correctly so that I can get to the WSDL with the browser. How should I configure Glassfish?
推荐答案
我很难找到这个问题的答案,因为这个主题在网络上没有详细介绍.一个链接告诉我如何配置 HTTP 代理,但没有提到 HTTPS,所以我花了一段时间才弄明白.
I had a lot of trouble finding an answer to this, as the topic isn't covered in a lot of detail on the web. One link told me how to configure the HTTP proxy, but mentioned nothing about HTTPS, so it took me a while to figure it out.
打开 Glassfish 服务器上的管理控制台并转到:应用程序服务器 -> JVM 设置 -> JVM 选项.点击添加JVM选项"4次,输入以下4个选项
Open up the admin console on your Glassfish server and go to: Application Server -> JVM Settings -> JVM Options. Click "Add JVM Option" 4 times and enter the following 4 options
-Dhttp.proxyHost=proxyhostname
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=proxyhostname
-Dhttps.proxyPort=8080
proxyhostname 和端口号对于您的设置是正确的.然后你需要重启服务器.
Where proxyhostname and the port number are correct for your setup. Then you need to restart the server.
请注意,我找不到从 PAC 文件设置代理的任何选项,也找不到需要身份验证的代理.在这种情况下,您可能需要安装本地身份验证代理处理程序,例如 Mac OS X 的 Authoxy,它将您的 localhost 变为非身份验证代理,并屏蔽来自中央身份验证代理的身份验证请求.
Note that I couldn't find any options for setting up the proxy from a PAC file, nor for proxies which require auth. In this case, you may need to install a local auth proxy handler like Authoxy for Mac OS X, which turns your localhost into a non-auth proxy and masks the authentication request from the central auth proxy.
此外,此链接适用于 JVM 的各种代理选项:http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
Also, this link was good for various proxy options to the JVM: http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
这篇关于如何设置 Glassfish 以通过代理服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何设置 Glassfish 以通过代理服务器?
基础教程推荐
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01