JAVA EE 7 First cup教程,无法安装Glassfish 4更新中心

标签 java maven jakarta-ee glassfish netbeans-7

好吧,我试图按照第一个杯子教程进行操作,但我遇到了 Glassfish 错误。

我应该这样做:

1.2.4 Getting the Latest Updates to the Tutorial

Check for any updates to this tutorial by using the Update Center included with the Java EE 7 SDK.

1.2.4.1 Update the Tutorial Through the Update Center Open the Update Center and check for any updates to the tutorial.

In NetBeans IDE, select the Services tab and expand the Servers node. Right-click the GlassFish Server instance and select View Update Center to display the Update Tool. In the tree, select Available Updates to display a list of updated packages. Look for updates to the First Cup for Java EE 7 (javaee-firstcup-tutorial) package. If there is an updated version of First Cup, select First Cup 7.0 for Java EE 7 (javaee-firstcup-tutorial) and click 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 更新中心看到目前只有教程文档的更新。

关于JAVA EE 7 First cup教程,无法安装Glassfish 4更新中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19484789/

相关文章:

Java 模式正则表达式不匹配

java - 如何将 Java .jar 编译/打包为 Mac OS X 命令行工具?

spring - 如何正确地将 Spring 包含到 OSGified 包中

java - 许多 jar 库版本兼容性

jakarta-ee - WebSphere Portal : name space bindings. 如何获取变量?

java - 使用单选按钮组时的疑问(JSF 2.0)

java - 在 Java 中创建具有不同名称的新文本文件

java - 动态查找文件

java - Maven 配置问题一个或多个约束尚未满足

java - 如何在log4j2中实现自定义模式布局