服务器未启动时,没有错误消息通过Web启动启动applet

时间:2013-11-18 17:14:06

标签: java applet java-web-start

这与发布的常见问题相反。我在我需要时收到错误消息!

我有一个applet客户端和一个在Tomcat服务器上运行的servlet服务器。一切都很好。除非您忘记启动Tomcat并单击Web Start桌面快捷方式,否则您将获得Java 7 ... splash。然后是java控制台。然后什么都没有。没有错误;没有客户。

如果我快速将跟踪转到第5级,那么它会报告java.net.ConnectException: Connection refused: connect,但最终用户什么都看不到。

这可能是因为单个jar文件无法下载,但是嘿是不是Web Start应该缓存jar文件?或者客户端是applet而非应用程序的事实是否意味着它无法脱机?如果您查看下面的跟踪,则表示我的jar文件已过期。这是不真实的。我清除了所有的Web Start缓存内容,在服务器工作的情况下运行它以创建桌面快捷方式,然后在服务器未启动的情况下再次尝试。

如果应用程序运行时连接丢失,那么我们的代码会检测到并向用户报告,因此Java Web Start未报告与jnlp文件和服务器所在的服务器存在通信问题的错误位于?

或者我错过了什么?

任何帮助都非常感激。

追踪是:

Trace level set to 5: all ... completed.java.net.ConnectException: Connection refused: connect
    at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.<init>(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.http.HttpClient.New(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
    at com.sun.deploy.cache.ResourceProviderImpl.getResource(Unknown Source)
    at com.sun.deploy.model.ResourceProvider.getResource(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory._buildDescriptor(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)
    at sun.plugin2.applet.viewer.JNLP2Viewer$1.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
temp: new XMLParser with source:
temp: <jnlp href="sent.jnlp">
     <information>
      <title>Sentences Explorer 4.0</title> 
      <vendor>Lazysoft Ltd.</vendor>
      <icon href="./resources/sentences.gif"/>
      <icon type="splash" href="./resources/Splash.gif"/>
      <description>Sentences Enterprise Edition V4.0.172.EE</description>
      <shortcut online="false">
        <desktop/>
      </shortcut>
      <offline-allowed/>
     </information>
     <resources>
       <java version="1.7.0+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Xss1m"/>
      <jar href="Sentences.jar" main="true" download="eager"/>
     </resources>
   <offline-allowed/> 
   <applet-desc
      name="Sentences Explorer V4.0.172.EE"
      main-class="com.sentences.main.Sentences"
      width="610"
      height="330"> 
      <param name="ServletProtocol" value="http"/>
      <param name="ServletPort" value="8090"/>
      <param name="FixedProfile" value="no"/>
      <param name="EditOption" value="Schema"/>
      <param name="FontSize" value="Default"/>
      <param name="ImageURLBase" value="/ImagesForSentences"/>
   </applet-desc>
   <security>
      <all-permissions/>
   </security>
</jnlp>

temp: 

returning ROOT as follows:

<jnlp href="sent.jnlp">
  <information>
    <title>Sentences Explorer 4.0</title>
    <vendor>Lazysoft Ltd.</vendor>
    <icon href="./resources/sentences.gif"/>
    <icon type="splash" href="./resources/Splash.gif"/>
    <description>Sentences Enterprise Edition V4.0.172.EE</description>
    <shortcut online="false">
      <desktop/>
    </shortcut>
    <offline-allowed/>
  </information>
  <resources>
    <java version="1.7.0+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Xss1m"/>
    <jar href="Sentences.jar" main="true" download="eager"/>
  </resources>
  <offline-allowed/>
  <applet-desc name="Sentences Explorer V4.0.172.EE" main-class="com.sentences.main.Sentences" width="610" height="330">
    <param name="ServletProtocol" value="http"/>
    <param name="ServletPort" value="8090"/>
    <param name="FixedProfile" value="no"/>
    <param name="EditOption" value="Schema"/>
    <param name="FontSize" value="Default"/>
    <param name="ImageURLBase" value="/ImagesForSentences"/>
  </applet-desc>
  <security>
    <all-permissions/>
  </security>
</jnlp>
temp: returning LaunchDesc from XMLFormat.parse():

<jnlp spec="1.0+" codebase="http://LAZYWS04:8090/Sentences/" href="http://LAZYWS04:8090/Sentences/sent.jnlp">
  <information>
    <title>Sentences Explorer 4.0</title>
    <vendor>Lazysoft Ltd.</vendor>
    <homepage href="null"/>
    <description>Sentences Enterprise Edition V4.0.172.EE</description>
    <icon href="http://LAZYWS04:8090/Sentences/resources/sentences.gif" kind="default"/>
    <icon href="http://LAZYWS04:8090/Sentences/resources/Splash.gif" kind="default"/>
    <shortcut online="false" install="false">
      <desktop/>
    </shortcut>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="timeout" policy="always"/>
  <resources>
    <java java-vm-args="-Xss1m" href="http://java.sun.com/products/autodl/j2se" version="1.7.0+"/>
    <jar href="http://LAZYWS04:8090/Sentences/Sentences.jar" download="eager" main="true"/>
  </resources>
  <applet-desc name="Sentences Explorer V4.0.172.EE" main-class="com.sentences.main.Sentences" documentbase="http://LAZYWS04:8090/Sentences/" width="610" height="330">
    <param name="EditOption" value="Schema"/>
    <param name="ServletProtocol" value="http"/>
    <param name="ServletPort" value="8090"/>
    <param name="FixedProfile" value="no"/>
    <param name="FontSize" value="Default"/>
    <param name="ImageURLBase" value="/ImagesForSentences"/>
  </applet-desc>
</jnlp>
preloader: Added pending event 1: ConfigEvent[type=SetVisible, value=true]
cache: JNLPPreverifyClassLoader.initialize: FAILED: http://LAZYWS04:8090/Sentences/Sentences.jar
basic: Plugin2ClassLoader.addURL2 called for http://LAZYWS04:8090/Sentences/Sentences.jar
basic: Plugin2ClassLoader.drainPendingURLs addURL called for http://LAZYWS04:8090/Sentences/Sentences.jar
preloader: Added pending event 2: ConfigEvent[type=AppInfo, value=Appinfo:
type = 2
title = Sentences Explorer 4.0
vendor = Lazysoft Ltd.
from = http://LAZYWS04:8090/Sentences/Sentences.jarjnlp
security = 2
lapURL = http://LAZYWS04:8090/Sentences/sent.jnlp
]
preloader: Added pending event 3: InitEvent[type=App]
network: LaunchDownload: concurrent downloads from LD: 4
network: Total size to download: -1
security: Security check for progress jars: allSigned=true
preloader: Using preloader class: null com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter@8c3770
preloader: Using default preloader
preloader: Requested to use preloader class: null
preloader: Delivering: ConfigEvent[type=SetVisible, value=true]
preloader: Delivering: ConfigEvent[type=AppInfo, value=Appinfo:
type = 2
title = Sentences Explorer 4.0
vendor = Lazysoft Ltd.
from = http://LAZYWS04:8090/Sentences/Sentences.jarjnlp
security = 2
lapURL = http://LAZYWS04:8090/Sentences/sent.jnlp
]
preloader: Delivering: InitEvent[type=App]
preloader: Skipped all (0) download events prior to null
preloader: Preloader jars loaded. Error state=null
preloader: Start progressCheck thread
security: Blacklist revocation check is enabled
security: blacklist: created: NEED_LOAD, lastModified: 1382085215578
security: blacklist: hasBeenModifiedSince 1384520450937 (we have 1382085215578)
security: Trusted libraries list check is enabled
security: Certificate revocation enabled. Disable security validation optimizations.
security: Reset cached validation for http://LAZYWS04:8090/Sentences/Sentences.jar.
network: Cache entry found [url: http://LAZYWS04:8090/Sentences/Sentences.jar, version: null] prevalidated=false/0
cache: Adding MemoryCache entry: http://LAZYWS04:8090/Sentences/Sentences.jar
cache: Resource http://LAZYWS04:8090/Sentences/Sentences.jar has expired.
network: Connecting http://LAZYWS04:8090/Sentences/Sentences.jar with proxy=DIRECT
network: Connecting socket://LAZYWS04:8090 with proxy=DIRECT
preloader: Delivering: DownloadErrorEvent[url=http://LAZYWS04:8090/Sentences/Sentences.jar version=null label=Unable to load resource cause=Connection refused: connect
preloader: Delivering: ErrorEvent[url=http://LAZYWS04:8090/Sentences/sent.jnlp label=Connection refused: connect cause=Connection refused: connect
basic: exception: Connection refused: connect.
ExitException[ 3]java.net.ConnectException: Connection refused: connect
    at sun.plugin2.applet.JNLP2Manager.downloadResources(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
    at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
preloader: Delivering: ErrorEvent[url=null label=Connection refused: connect cause=Connection refused: connect
preloader: Preloader shutdown after ErrorEvent
preloader: Stop progressCheck thread

1 个答案:

答案 0 :(得分:0)

每当我的客户启动他们的JWS应用程序并且他们没有收到错误消息或启动画面或任何东西时,我总是告诉他们升级他们的Java版本并且一直修复它。

我建议在java.com上查看最新的Java版本。