JAVA EE 7第一杯教程,无法安装Glassfish 4更新中心

好吧,我试图按照第一杯教程,但我遇到了Glassfish错误。

我应该这样:

1.2.4获取教程的最新更新

使用Java EE 7 SDK附带的更新中心检查本教程的任何更新。

1.2.4.1通过更新中心更新教程打开更新中心并检查教程的任何更新。

在NetBeans IDE中,选择“服务”选项卡,然后展开“服务器”节点。 右键单击GlassFish Server实例,然后选择“查看更新中心”以显示“更新工具”。 在树中,选择“可用更新”以显示更新的包列表。 查找First EE for Java EE 7(javaee-firstcup-tutorial)包的更新。 如果有First Cup的更新版本,请选择First Cup 7.0 for Java EE 7(javaee-firstcup-tutorial)并单击Install。

问题是,当我尝试打开更新中心时,这就是我得到的:

The software needed for this command (updatetool) is not installed. If you choose to install Update Tool, your system will be automatically configured to periodically check for software updates. If you would like to configure the tool to not check for updates, you can override the default behavior via the tool's Preferences facility. Exception in thread "main" java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:196) at java.net.SocketInputStream.read(SocketInputStream.java:122) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:658) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468) at com.sun.pkg.client.Image.checkRepositoryConnection(Image.java:1225) at com.sun.pkg.client.Catalog.refresh(Catalog.java:132) at com.sun.pkg.client.Image.refreshCatalogs(Image.java:1627) at com.sun.pkg.client.Client.main(Client.java:109) When this tool interacts with package repositories, some system information such as your system's IP address and operating system type and version is sent to the repository server. For more information please see: http://wikis.oracle.com/display/updatecenter/UsageMetricsUC2 Once installation is complete you may re-run this command. Would you like to install Update Tool now (y/n): C:\Program Files\glassfish-4.0>"C:\Program Files\Java\jdk1.7.0_40\bin\java" -Dimage.path="C:\Program Files\glassfish-4.0\bin\\.." -jar "C:\Program Files\glassfish-4.0\bin\\..\pkg/lib/pkg-client.jar" refresh C:\Program Files\glassfish-4.0>"C:\Program Files\Java\jdk1.7.0_40\bin\java" -Dimage.path="C:\Program Files\glassfish-4.0\bin\\.." -jar "C:\Program Files\glassfish-4.0\bin\\..\pkg/lib/pkg-bootstrap.jar" "C:\Users\Fabio\AppData\Local\Temp\pkg-bootstrap11073.props" Proxy: Using system proxy settings. Input/output error: Connection reset Could not download application packages. This could be because: - a proxy server is needed to access the internet. Please ensure that the system proxy server settings in your Internet Options control panel (under Connections:LAN Settings) are correct, or set the HTTP_PROXY environment variable to the full URL of the proxy server. - the package server or network connection is slow. If you are getting time out errors you can try setting the PKG_CLIENT_CONNECT_TIMEOUT and PKG_CLIENT_READ_TIMEOUT environment variables and try again. For example to increase the timeouts to 300 seconds set them to 300 - the package server is down or otherwise inaccessible or it is generating invalid data. Please contact the provider of the package server. 

这可能是缓慢的GlassFish更新服务器的问题。 您可以尝试以下步骤:

您应该首先重试以查看错误是否再次发生。 您可以启动cmd,导航到\glassfish\bin目录并运行updatetool.bat这样您就可以看到在您发布的输出之后打印的输出。

如果您位于代理服务器后面,则应确保在系统设置中正确设置。

您还可以尝试通过GlassFish管理控制台安装更新。 启动GlassFish实例并导航到http:\\localhost:4848 。 在左侧菜单的底部,单击Updatetool 。 在那里,您可以选择并安装所需的更新。

另一种选择是更改pkg工具的超时。 要将超时设置为300秒,请在cmd中执行以下操作(在Windows上):

 set PKG_CLIENT_CONNECT_TIMEOUT=300 set PKG_CLIENT_READ_TIMEOUT=300 

您的上一个(好的,可能还有其他的)选项是跳过更新过程并使用当前版本执行教程。 无论如何它应该工作,我可以在我的GlassFish更新中心看到目前只有教程文档的更新。

只需将此行设置为cmd(如管理员):

 set PKG_CLIENT_CONNECT_TIMEOUT=300 set PKG_CLIENT_READ_TIMEOUT=300 

也许firstcup示例已经存在于安装目录中。 尝试在directory_install_glassfish / glassfish4 / docs中找到它。 该矿甚至包含javaee-tutorial和firstcup。 对于下一部分,您可以在firstcup.pdf中的指南之后继续使用以下部分:通过创建java项目的原型创建您的第一个Java。 祝你好运 !

对于懒惰的人来说,pkg Unix命令是:

 export PKG_CLIENT_CONNECT_TIMEOUT=300 export PKG_CLIENT_READ_TIMEOUT=300 

从Netbeans安装GlassFish更新服务器(在我的公司网络中,代理问题)卡住了一段时间后,我得到了这样的方法: – 高级系统设置>系统属性窗口>高级选项卡, 新系统变量 :http_proxy, http ://用户名:密码@ your_proxy:your_port – Netbeans(以管理员身份运行以防万一),服务>服务器> Glassfish服务器>右键查看域更新中心 ,然后安装

它对我有用,希望它有所帮助!