• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

External Devices and Webstart

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jonathan Matthew Pengelly
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 :



 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic