This discussion is archived
5 Replies Latest reply: Nov 26, 2012 10:31 AM by 936814 RSS

Web start application freezes when launched from web

936814 Newbie
Currently Being Moderated
Hi All,
I'm trying to run a java application, that uses javafx, as web start.
My problem is that this application runs fine if I launch the jnlp locally from my
pc but when I launch the jnlp from web the application runs slowly till freezing.
I've tried with different pc (win xp, win 7 and mac osx), different browsers (Firefox, Chrome, IE)
and different web servers but the problem is the same in all cases.
All jars are signed with a self-signed certificate and in all machines is installed Java SE 7u9.

Enabling Java Console I've noticed a lot of log like:

basic: JNLP2ClassLoader.findClass: java.lang.ImageView: try again ..
basic: JNLP2ClassLoader.findClass: java.lang.ImageView: try again ..
basic: JNLP2ClassLoader.findClass: java.lang.Image: try again ..
basic: JNLP2ClassLoader.findClass: java.lang.Image: try again ..
network: Cache entry not found [url: http://www.mysite.com/applet/META-INF/services/javax.xml.stream.XMLInputFactory, version: null]
network: Connecting http://www.mysite.com/applet/META-INF/services/javax.xml.stream.XMLInputFactory with proxy=DIRECT
network: Connecting http://www.mysite.com:80/ with proxy=DIRECT
network: Connecting http://www.mysite.com/applet/META-INF/services/javax.xml.stream.XMLInputFactory with cookie "has_js=1"
basic: JNLP2ClassLoader.findClass: java.lang.Font: try again ..
basic: JNLP2ClassLoader.findClass: java.lang.Font: try again ..
basic: JNLP2ClassLoader.findClass: javafx.scene.control.Font: try again ..
basic: JNLP2ClassLoader.findClass: javafx.scene.control.Font: try again ..
basic: JNLP2ClassLoader.findClass: javafx.scene.layout.Font: try again ..
basic: JNLP2ClassLoader.findClass: javafx.scene.layout.Font: try again ..
network: Cache entry not found [url: http://www.mysite.com/applet/META-INF/services/javax.xml.stream.XMLInputFactory, version: null]
network: Connecting http://www.mysite.com/applet/META-INF/services/javax.xml.stream.XMLInputFactory with proxy=DIRECT
network: Connecting http://www.mysite.com:80/ with proxy=DIRECT
network: Connecting http://www.mysite.com/applet/META-INF/services/javax.xml.stream.XMLInputFactory with cookie "has_js=1"

What am I doing wrong?

This is my jnlp (MyApp.jnlp)

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec = "1.0" xmlns:jfx = "http://javafx.com" codebase = "http://www.mysite.com/applet/" href = "MyApp.jnlp">
<information>
<title>MyApp</title>
<vendor>MyApp</vendor>
<description>My application.</description>
<homepage href = "http://www.mysite.com/applet/"/>
<offline-allowed/>
</information>
<resources>
<jfx:javafx-runtime version = "2.2+" href = "http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version = "1.6+" href = "http://java.sun.com/products/autodl/j2se"/>
<jar href = "MyApp.jar" size = "2836601" download = "eager"/>
<jar href = "libs/gson-2.2.2.jar" size = "189285" download = "eager"/>
<jar href = "libs/sun.jar" size = "83743" download = "eager"/>
</resources>
<applet-desc width = "1280" height = "1024" main-class = "com.javafx.main.NoJavaFXFallback" name = "MyApp">
<param name = "requiredFXVersion" value = "2.2+"/>
</applet-desc>
<jfx:javafx-desc width = "1280" height = "1024" main-class = "test.App" name = "MyApp"/>
<update check = "background"/>
</jnlp>

and this my html page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My App</title>
<script src="http://java.com/js/dtjava.js"></script>
<script>
function launchApplication(jnlpfile) {
dtjava.launch( {
url : 'MyApp.jnlp'
},
{
javafx : '2.2+'
},
{}
);
return false;
}
</script>

<script>
function javafxEmbed_fxApplication() {
dtjava.embed(
{
id : 'fxApplication',
url : 'MyApp.jnlp',
placeholder : 'MyAppId',
width : 1280,
height : 1024
},
{
javafx : '2.2+'
},
{}
);
}
<!-- Embed FX application into web page once page is loaded -->
dtjava.addOnloadCallback(javafxEmbed_fxApplication);
</script>

</head>
<body>


</body>
</html>

Thank you
  • 1. Re: Web start application freezes when launched from web
    817614 Explorer
    Currently Being Moderated
    The repeating downloads of the same jar seems like a recent bug in one of the 7u10 early access builds. What is the deployment stack and JRE versions you are running with? You can paste the few beginning lines from the java console showing versions.
  • 2. Re: Web start application freezes when launched from web
    936814 Newbie
    Currently Being Moderated
    Hi ntn,
    here the beginning lines from the java console:

    Java Plug-in 10.9.2.05
    Using JRE version 1.7.0_09-b05 Java HotSpot(TM) Client VM
    User home directory = C:\Users\user
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    cache: Initialize resource manager: com.sun.deploy.cache.ResourceProviderImpl@5fba1c
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
    security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
    network: Created version ID: 1.7.0.09
    network: Created version ID: 1.7
    network: Created version ID: 2.2.3
    network: Cache entry found [url: http://www.mysite.com/applet/MyApp.jnlp, version: null] prevalidated=false/0
    temp: new XMLParser with source:
    temp: <?xml version="1.0" encoding="utf-8"?>
    <jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="MyApp.jnlp">
    <information>
    <title>MyApp</title>
    <vendor>MyApp</vendor>
    <description>Sample JavaFX 2.0 application.</description>
    </information>
    <resources>
    <jfx:javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
    </resources>
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="MyApp.jar" size="3009967" download="eager" />
    <jar href="libs/gson-2.2.2.jar" size="192969" download="eager" />
    <jar href="libs/sun.jar" size="84931" download="eager" />
    </resources>
    <security>
    <all-permissions/>
    </security>
    <applet-desc width="1280" height="1024" main-class="com.javafx.main.NoJavaFXFallback" name="MyApp" >
    <param name="requiredFXVersion" value="2.2+"/>
    </applet-desc>
    <jfx:javafx-desc width="1280" height="1024" main-class="test.App" name="MyApp" />
    <update check="background"/>
    </jnlp>

    temp:

    returning ROOT as follows:

    <jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="MyApp.jnlp">
    <information>
    <title>MyApp</title>
    <vendor>MyApp</vendor>
    <description>Sample JavaFX 2.0 application.</description>
    </information>
    <resources>
    <javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
    </resources>
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="MyApp.jar" size="3009967" download="eager"/>
    <jar href="libs/gson-2.2.2.jar" size="192969" download="eager"/>
    <jar href="libs/sun.jar" size="84931" download="eager"/>
    </resources>
    <security>
    <all-permissions/>
    </security>
    <applet-desc width="1280" height="1024" main-class="com.javafx.main.NoJavaFXFallback" name="MyApp">
    <param name="requiredFXVersion" value="2.2+"/>
    </applet-desc>
    <javafx-desc width="1280" height="1024" main-class="test.App" name="MyApp"/>
    <update check="background"/>
    </jnlp>
    temp: returning LaunchDesc from XMLFormat.parse():

    <jnlp spec="1.0" codebase="http://www.mysite.com/applet/" href="http://www.mysite.com/applet/MyApp.jnlp">
    <information>
    <title>MyApp</title>
    <vendor>MyApp</vendor>
    <homepage href="null"/>
    <description>Sample JavaFX 2.0 application.</description>
    </information>
    <security>
    <all-permissions/>
    </security>
    <update check="background" policy="always"/>
    <resources>
    <javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
    <java href="http://java.sun.com/products/autodl/j2se" version="1.6+"/>
    <jar href="http://www.mysite.com/applet/MyApp.jar" download="eager" main="false"/>
    <jar href="http://www.mysite.com/applet/libs/gson-2.2.2.jar" download="eager" main="false"/>
    <jar href="http://www.mysite.com/applet/libs/sun.jar" download="eager" main="false"/>
    </resources>
    <applet-desc name="MyApp" main-class="com.javafx.main.NoJavaFXFallback" documentbase="http://www.mysite.com/applet/lobby.html" width="1280" height="1024">
    <param name="requiredFXVersion" value="2.2+"/>
    </applet-desc>
    <javafx-desc main-class="test.App"/>
    </jnlp>
    security: Blacklist revocation check is enabled
    security: Trusted libraries list check is enabled
    network: Cache entry found [url: http://www.mysite.com/applet/MyApp.jar, version: null] prevalidated=true/0
    network: Cache entry found [url: http://www.mysite.com/applet/libs/gson-2.2.2.jar, version: null] prevalidated=true/0
    network: Cache entry found [url: http://www.mysite.com/applet/libs/sun.jar, version: null] prevalidated=true/0
    cache: JNLPPreverifyClassLoader.initialize: FAILED: http://www.mysite.com/applet/MyApp.jar
    network: Created version ID: 1.7.0.09
    network: Created version ID: 1.7
    network: Created version ID: 2.2.3
    basic: Plugin2ClassLoader.addURL2 called for http://www.mysite.com/applet/MyApp.jar
    basic: Plugin2ClassLoader.addURL2 called for http://www.mysite.com/applet/libs/gson-2.2.2.jar
    basic: Plugin2ClassLoader.addURL2 called for http://www.mysite.com/applet/libs/sun.jar
    basic: Plugin2ClassLoader.drainPendingURLs addURL called for http://www.mysite.com/applet/MyApp.jar
    basic: Plugin2ClassLoader.drainPendingURLs addURL called for http://www.mysite.com/applet/libs/gson-2.2.2.jar
    basic: Plugin2ClassLoader.drainPendingURLs addURL called for http://www.mysite.com/applet/libs/sun.jar
         Match: beginTraversal
    network: Created version ID: 1.6+
    network: Created version ID: 2.2+
    network: Created version ID: 1.7.0.09
    network: Created version ID: 2.2.3
    Match: digest selected JREDesc: JREDesc[version 1.6+, heap=-1--1, args=null, href=http://java.sun.com/products/autodl/j2se, sel=false, null, null], JREInfo: JREInfo for index 0:
    platform is: 1.7
    product is: 1.7.0_09
    location is: http://java.sun.com/products/autodl/j2se
    path is: C:\Program Files (x86)\Java\jre7\bin\javaw.exe
    args is:
    native platform is: Windows, x86 [ x86, 32bit ]
    JavaFX runtime is: JavaFX 2.2.3 found at C:\Program Files (x86)\Java\jre7\
    enabled is: true
    registered is: false
    system is: true

         Match: ignoring maxHeap: -1
         Match: ignoring InitHeap: -1
         Match: digesting vmargs: null
         Match: digested vmargs: [JVMParameters: isSecure: true, args: ]
         Match: JVM args after accumulation: [JVMParameters: isSecure: true, args: ]
         Match: digest LaunchDesc: http://www.mysite.com/applet/MyApp.jnlp
         Match: digest properties: []
         Match: JVM args: [JVMParameters: isSecure: true, args: ]
         Match: endTraversal ..
         Match: JVM args final:
         Match: Running JREInfo Version match: 1.7.0.09 == 1.7.0.09
    network: Created version ID: 2.2+
    network: Created version ID: 2.2.3
    security: Security check for progress jars: allSigned=true
         Match: Running JVM args match: have:<> satisfy want:<>
    basic: LaunchDesc location: http://www.mysite.com/applet/MyApp.jnlp
    network: Created version ID: 1.6.0.10
    cache: MemoryCache: removed entry http://www.mysite.com/applet/libs/gson-2.2.2.jar
    cache: MemoryCache: removed entry http://www.mysite.com/applet/libs/sun.jar
    cache: MemoryCache: removed entry http://www.mysite.com/applet/MyApp.jnlp
    cache: MemoryCache: removed entry http://www.mysite.com/applet/MyApp.jar
    network: Created version ID: 1.0
    network: Created version ID: 7.0
    network: Created version ID: 6.0.18
    network: Created version ID: 6.0.10
    network: Created version ID: 6.0
    network: Created version ID: 1.5
    network: Created version ID: 1.0
  • 3. Re: Web start application freezes when launched from web
    817614 Explorer
    Currently Being Moderated
    OK, its not the problem that I was think of.
    Try to find what in your code that look for an implementation of XMLInputFactory service. Why it found it when running locally and not from web? Maybe it is the reason your appear to freeze.
  • 4. Re: Web start application freezes when launched from web
    936814 Newbie
    Currently Being Moderated
    Some more info,
    I watched the web server logs and I found many repeated log entries like
    "GET /applet/myapplet.html/META-INF/services/javax.xml.stream.XMLInputFactory HTTP/1.1" 404 19023 "-" "Mozilla/4.0 (Windows 7 6.1) Java/1.7.0_09"

    Googling this I've found many posts regarding similar problems:

    http://stackoverflow.com/questions/7997566/web-service-client-applet-keeps-asking-for-meta-inf-services-javax-xml-ws-sp

    http://stackoverflow.com/questions/2340969/applet-served-by-java-web-start-resources-requested-to-web-server-before-look-i

    It seems to be a strange Behaviour of the JNLPClassLoader that tries to load classes from server instead from jar or local class path.
    Somebody suggests to remove all logging entries from code or to add "codebase_lookup = false" to applet parameters but this does not solve the problem.

    I use FXML to define my UI and I think that every time an fxml is loaded JNLPClassLoader tries to load the xml parser (javax.xml.stream.XMLInputFactory)
    from server.

    Somebody have any idea?

    Thank you.
  • 5. Re: Web start application freezes when launched from web
    936814 Newbie
    Currently Being Moderated
    Solved,
    see http://javafx-jira.kenai.com/browse/RT-25130

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points