I have got a question regarding webstart and external devices. The situation is that I want to use Webstart to deploy a program that uses an external device (e.g. a printer) but I want the program to use the external device that is connected to the client computer. Is this possible with Webstart?
My workmate and I have been trying to get this to work. Our program runs ok and we have included all of the required device-specific libraries, the only thing is that when we attempt to talk with the external device it doesn't work.
Unfortunately, we have checked quite a few times that we have included all of the required libraries in the application and the program runs ok when run in the JDE (Eclipse).
However, you did get us thinking and as our understanding is improving with Webstart, it really does seem that it is something wrong in our configuration because we now understand that webstart is used as a method to package up the required files for an application and easily deploying them, and so actually has not so much to do with the running of the program. Will keep you guys updated
Ok. Things are still not going properly. My workmate and I have written a small test program that does nothing more than talk to the device (a GSM Modem) and send a message.
1. Everything works when we run it from the IDE (Eclipse) 2. Everything works when we create the jar and run it from the command line using java -jar <path> 3. Everything even works when we run it from the command line using the jar that is copied by web start into a folder after you have run it once so that you can run it offline. 4. However, the program runs over web start but we can't talk to the device and so are not able to make a connection.
Any ideas from anyone? Perhaps it is something to do with the libraries that are avaliable when running over webstart?
Any suggestions on further investigation would be great too.
Do you get any error messages to indicate why it couldn't talk to the modem? Or does the program just hang while trying to get a connection?
You probably can't easily solve this problem without capturing some error output. Try logging some statements in your program so that you know exactly what stage it got up to, you may be surprised to find that it is dying somewhere totally different to what you expect.
The other thing I would offer to try is to see if webstart has blocked access to the modem port or anything like that. It seems unlikely, but it does sound like running under webstart closes some things down.
We have debugged to the point where we can see exactly when it trys to establish a connection with the modem (a method call to an external library) and this returns an error value indicating it was unable to establish a connection.
The whole connection failure thing happens staight away which is quite different to other times when we have had connection problems with the modem. Normally, these other times are caused by a problem with the SIM card or something like that however this immediate response seems to point to the program not being able to see the device at all (or it being blocked).
Does anybody know if web start blocks communication with the com ports or something like that?
Originally posted by Jonathan Matthew Pengelly: establish a connection with the modem (a method call to an external library) and this returns an error value indicating it was unable to establish a connection.
Ah right. By external, do you mean some native 'non-java' dll or something like that? I know that sometimes webstart needs all its code signed and trusted before it is run. Perhaps this is the main problem, or some varient in that you have to tell it explicitly where to find the external code to run in the .jnlp file. (it would be really helpful to actually see this .jnlp file to be sure).
Yeah, sorry my statement was a bit misleading. What I meant by external library was only that it is a jar that we haven't developed. We pulled it off the web and have signed it ourselves. Here is our jnlp file :