aspose file tools*
The moose likes JNLP and Web Start and the fly likes External Devices and Webstart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "External Devices and Webstart" Watch "External Devices and Webstart" New topic
Author

External Devices and Webstart

Jonathan Matthew Pengelly
Greenhorn

Joined: Oct 07, 2005
Posts: 5
Hi everyone,

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.

Any ideas about what could be going wrong?

Jonathan
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
All I would suggest at this stage is to make sure your .jnlp file included all the .jar file references that you need for the application to talk to the device.

I sometimes get a mismatch and errors between development environment and production environment because I forget to have the right <jar href="xxx.jar"/> lines in the .jnlp file.

Also, turn on webstart logging and look for null pointer errors and such thrown by your application when you attempt to use the device.

Hope this helps.

Cheers, Jared.


SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
Jonathan Matthew Pengelly
Greenhorn

Joined: Oct 07, 2005
Posts: 5
Thanks for the reply Jared.

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
Jonathan Matthew Pengelly
Greenhorn

Joined: Oct 07, 2005
Posts: 5
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.

Jonathan
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

sounds like a frustrating problem.

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.

Let us know how you get on.

Cheers, Jared.
Jonathan Matthew Pengelly
Greenhorn

Joined: Oct 07, 2005
Posts: 5
Hi Jared, Cheers for the reply.

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?
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
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).

Cheers, Jared.
Jonathan Matthew Pengelly
Greenhorn

Joined: Oct 07, 2005
Posts: 5
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 :



 
wood burning stoves
 
subject: External Devices and Webstart