Hi guys,

I am writing an web application which my applet is using comm.jar to talk to my hardware. The problem is that not all the users (client) have the device connect to their PC and so when my applet is invoke, it hang the webpage (JSP). I am using jre 1.5 update 6 to do it.

Here is my code in my applet

// Get port
portname = this.getParameter("PORTNAME");
System.out.println("Com Port "+ portname);
try
{
portId = CommPortIdentifier.getPortIdentifier(portname);
}
catch(NoSuchPortException e)
{
// TODO Auto-generated catch block
System.out.println("Destroying the Applet due to no Comm.jar + NoSuchPortException");
this.destroy();
}
catch(Exception e)
{
System.out.println("Destroying the Applet due to no Comm.jar + Exception");
this.destroy();
}

And the error I got in my java console
java.lang.NoClassDefFoundError: javax/comm/NoSuchPortException
...........etc
(It cannot find the comm.jar in the jre)

Is there a way to write to prevent my application to hang if I don't put the comm.jar in the JRE (Because some user don't have device on their PC) other than upgrading the JRE.

Thanks