2013-11-18

I have a perfectly lovely applet client connecting to a servlet running in Tomcat served up from a jnlp file.

It all works fine. However, a colleague asked me the other day why there is no message if you forget to start the server. Huh? I said.

So I tried. If you don't start the Tomcat server and launch the client from a desktop shortcut (cos obviously you can't launch from the jnlp file) then you get the Java 7... logo splash screen for a few seconds, then the Java Console opens, then well, um nothing. No error message, nada.

So I very quickly hit 5 in the java console to get some detailed tracing (see below for trace).

There is only one jar file for my App and the trace contained the following:

java.net.ConnectException: Connection refused: connect

OK well not so much refused as not there, but ok I understand. So why does WebStart not tell me that there was a little comms issue?

So I thought I'd try adding <offline-allowed/> so that it would use the cache - but makes no difference.

Perhaps as it's an <applet-desc not an <application-desc then <offline-allowed/> isn't relevant and it must be online?

Does anyone think this is a bug and that Web Start should at least report that there is a problem communicating with the server?

Or am I missing something?

trace: (and attached is more readable)

Trace level set to 5: all ... completed.java.net.ConnectException: Connection refused: connect

at java.net.TwoStacksPlainSocketImpl.socketConnect(Na tive 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.http://www.protocol.http.HttpURLConn...Client(Unknown Source)

at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown Source)

at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown Source)

at com.sun.deploy.net.BasicHttpRequest.doRequest(Unkn own Source)

at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX (Unknown Source)

at com.sun.deploy.cache.ResourceProviderImpl.checkUpd ateAvailable(Unknown Source)

at com.sun.deploy.cache.ResourceProviderImpl.isUpdate Available(Unknown Source)

at com.sun.deploy.cache.ResourceProviderImpl.getResou rce(Unknown Source)

at com.sun.deploy.cache.ResourceProviderImpl.getResou rce(Unknown Source)

at com.sun.deploy.model.ResourceProvider.getResource( Unknown Source)

at com.sun.javaws.jnl.LaunchDescFactory._buildDescrip tor(Unknown Source)

at com.sun.javaws.jnl.LaunchDescFactory.buildDescript or(Unknown Source)

at com.sun.javaws.jnl.LaunchDescFactory.buildDescript or(Unknown Source)

at sun.plugin2.applet.JNLP2Manager.initialize(Unknown Source)

at sun.plugin2.applet.viewer.JNLP2Viewer$1.run(Unknow n 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.doIntersectionPri vilege(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarch y(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(Unkno wn Source)

at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.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

Attached Files

Trace.txt
(9.8 KB)

Show more