本文介绍了JAVA EE 7第一杯教程,无法安装Glassfish 4更新中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Well I was trying to follow the first cup tutorial, but I'm stuck with a Glassfish error.

我应该这样:

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

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

1.2.4.1通过更新中心更新教程打开更新中心并检查是否有任何内容本教程的更新。

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

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

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 thing is, when I try to open the Update Center, this is what I get:

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更新服务器的问题。您可以尝试以下步骤:

This may be a problem with the slow GlassFish update server. Here are some steps you can try:

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

You should retry first to see if the error occurs again. You can start a cmd, navigate to the \glassfish\bin directory and run updatetool.bat so you can see the output which is printed after the one you posted.

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

If you are behind a proxy you should make sure it is setup correctly in the system settings.

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

You can also try to install the updates through the GlassFish admin console. Start your GlassFish instance and navigate to http:\\localhost:4848. On the bottom of the left menu click on Updatetool. There you can choose and install the desired updates.

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

Another option is to change the timeouts of the pkg tool. To set the timeout to 300 seconds do the following in a cmd (on Windows):

set PKG_CLIENT_CONNECT_TIMEOUT=300
set PKG_CLIENT_READ_TIMEOUT=300

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

Your last (ok, there may be other ones) option is to just skip the update process and do the tutorial with the current version. It should work anyway and I can see in my GlassFish update center that there is only an update for the tutorial documentation at the moment.

这篇关于JAVA EE 7第一杯教程,无法安装Glassfish 4更新中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 02:34