views:

416

answers:

3

I'm using the Netbeans IDE to develop a Java Web Start application that will launch from the web and then use the EclipseLink JPA to access a remote MySQL database. I'm using the Swing Application Framework to manage life cycle for my app.

When I launch the application from Netbeans it takes about 7 second for my application to load, but when I use the Netbeans IDE to create a Web Start distribution package (with the JAR and JNLP files) it takes about 60 seconds to launch. Also, the "verifying application"/"downloading application" progressbar window seems to run every time I launch the app even though a copy of it has already been cached.

From the users point of view, one first sees my splash screen for 1 to 2 seconds, then the "verifying application"/"downloading application" progressbar window for 5 to 20 seconds and then nothing for a good 40 seconds before the application launches.

The app code is written such that it should show itself BEFORE the JPA starts loading the persistence unit (so I doubt that's the problem), but I thought I'd mention it just in case.

A: 

First of all, in the Java Control Panel enable ALL logging. This will allow you to see exactly what Java WebStart is doing (but much of it doesn't make much sense unless you have access to the WebStart source).

My guess from your description is that you have one or more unreachable DNS servers in your network configuration AND you want to access a network resource that isn't available.

Thorbjørn Ravn Andersen
A: 

Update: Method createEntityManagerFactory Slow With Web Start

Having looked into this further, I've found that the method createEntityManagerFactory--which is necessary for EclipseLink to connect to MySQL--takes aboutn 5 seconds to execute when I run the applicaiton from Netbeans or when I remotely log in to my server to launch the JNLP there, but when I run the application via the web the same line takes 35 seconds (hugely delaying startup). Interestingly, this time gets even worse as my internet connection speed gets worse. Below is a copy of the JNLP file I'm using.

Does anyone have any idea what may be causing such a delay?

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

MyApp My App Vendor My App Description MyApp

igillespie
To make an "update", edit your question rather than posting an answer. This site doesn't work like a discussion board.
Gnoupi
A: 

I'm not sure if you solved this yet. But, I repeated your problem and fixed it. All I had to do was switch from Eclipselink to Toplink. That simple. Startups went from 1 to 2 minutes down to 5 seconds. I even traced the app and found the same hanging during the init of eclipselink.

Hope it helps.

Charlie Youakim