2

We currently have an Java application that can be deployed on clients or run as a shortcut from the server. We have intermittently received ClassNotFound exceptions when running the JAR from the server which looks like Windows dropping the network connection with only part of the classes from the JAR loaded (user opens a different screen then the problem is apparent).

I am currently looking at the Web Start technology to allow us to run a single shortcut.

However the application has several folders it requires to be in the same folder the JAR is launched (for configuration, logs, etc.). These folders will require full access for all users to allow them to write log files. There are lots of configuration files under the configuration folder hierarchy.

The application also requires access to environment user settings (such as getting their user folder). It also requires certain command line parameters (including which folder to use for configuration, log file location, java memory usage, etc.)

Edit

The application also contains a reference to 2 signed JARs. These are:

  • jh.jar
  • mail.jar

It looks like these are signed by SUN Microsystems. jh is used for help integration in our application whilst mail is used for email integration.

I have now downloaded the latest versions of these files from java2s.com which do not have the signed equivalents.

end edit

The application is developed in Netbeans which compiles a single JAR file and copies the dependant JARs to the dist/lib folder. I enabled the Web Start functionality in Netbeans for the application and it generates the JNLP file.

Bearing everything in mind is Web Start the way to go for an application like this? Can you include folders in a Web Start deployment? I could not find anything to do this in the XML structure for a JNLP file.

Cheers,

Andez

3
  • Are the folders that it requires access to on the server (where app is loaded from) or the client (where the user is running the app) Commented Mar 24, 2011 at 10:01
  • Hi @objects. Sorry for the delay. Been well busy for last few months. The logs are on the server in a single location. All users would log to this folder. Our app uses the java.util.logging.Logger to do the logging. Commented May 4, 2011 at 12:30
  • that could be a problem as the jws app runs on the client, not the server Commented May 4, 2011 at 18:30

3 Answers 3

4

Yes, you could use WebStart for this.

Permission: If you need permission to the file system, you have to sign your jars and put the all-permissions tag in your jnlp.

Arguments: Arguments can be provided by using the arguments elements in application_desc.

Folders: I'm don't think you can include folders in the WebStart application, but you could put the config files in a jar and read them from there, or extract them on startup.

ClassNotFoundError:

We have intermittently received ClassNotFound exceptions when running the JAR from the server which looks like Windows dropping the network connection with only part of the classes from the JAR loaded

Does not sound plausible to me. per default, all jars will be downloaded before the application starts. If you set "download" to "lazy", the jar will be downloaded when first needed, but I would guess it will be downloaded completly then.

Sign up to request clarification or add additional context in comments.

8 Comments

@Tim Büthe - I have got further than before Tim thanks. I am letting Netbeans compile the application. I have added the command line parameters to the Project and netbeans creats the JNLP with these included. However when I try to download by executing the JNLP file, I now get a different error complaining about one of the referenced JAR files - rfax.jar which is from java4less.com. com.sun.deploy.net.JARSigningException: Could not verify signing in resource: file:/MyApp/dist/lib/rfax.jar It looks like the rfax.jar has the NB-JWS-DSA and NB-JWS.SF keys in as the rest of the JARs do.
Now I have removed the rFax.jar file from my project references as it does not appear to be used. I now do not get any errors when downloading, however nothing happens - no UI is displayed. So a little more progress.
You should activate the console to see if exceptions occur. You can do this in the Java control panel.
Hi Tim. I've done that now thanks. I decided to put a new class and main method in the application that displays a message box without running the normal application execution path. This shows my message box.
@Andez Congrats on your success! Don't forget to mark the most relevant answer as 'correct'.
|
0

You can provide read-only resources for Java WebStart. Getting the log back is harder. I would suggest looking into a centralized logging solution, using one of the standard appenders in the log framework you use.

1 Comment

we are using the standard java java.util.logging.Logger class for logging.
0

For a Java Web Start application it is always advised not to create files or folders in the class path. Recommend user's home directory to store your settings or database files.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.