You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pranjal rajput <fi...@gmail.com> on 2013/01/22 13:21:47 UTC

Re: unable to access comm ports on apache tomcat 6.0.18

ramkumar <ramkumar <at> efftronics.com> writes:

> 
> Hi friend, I can communicate with modem from othe java application.The
> problem is occuring only after deploy in apache tomcat. I am using ECLIPSE
> IDE. Ecclipse ide can run our web application using apache tomcat  for
> debugging purpose.When i run my application from ide it is working fine but
> the exception occur after deploying on tomcat. Please help me.
>   Thank you. 
> 

Hi,
Awakening a dormant thread.

has anyone found a solution or workaround to this problem?
My code is written in a scritplet written in jsp method:
CommPortIdentifier cpid = CommPortIdentifier					
.getPortIdentifier(portName); /* exception being thrown here - 
NoSuchPortException*/
File portF = new File(portName);
comPortName = portName;
if (portF.exists()) {
	CommPort cp = cpid.open("zwave", 500);
	mySerialPort = (SerialPort) cp;
	mySerialPort.setSerialPortParams(115200, 8, 1, 0);
	mySerialPort.setRTS(true);
}
my the object of comm port is correctly being created in core java application.
it also works well in the web application IF it is launched using eclipse IDE.
All libraries are in place. 

but when the application is deployed on separate tomcat server, it throws 
following exception:
Error in making serial connection gnu.io.NoSuchPortException
gnu.io.NoSuchPortException
        at 
gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:218)
        at 
org.apache.jsp.pages.communicator_jsp.makeConnection(communicator_jsp.java:79)
        at 
org.apache.jsp.pages.communicator_jsp.sendCommand(communicator_jsp.java:128)
        at 
org.apache.jsp.pages.communicator_jsp._jspService(communicator_jsp.java:2542)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
        at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:290)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:206)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
91)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otocol.java:588)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: unable to access comm ports on apache tomcat 6.0.18

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Tue, Jan 22, 2013 at 7:21 AM, pranjal rajput
<fi...@gmail.com>wrote:

> it also works well in the web application IF it is launched using eclipse
> IDE.
> All libraries are in place.
>
> but when the application is deployed on separate tomcat server, it throws
> following exception:
> Error in making serial connection gnu.io.NoSuchPortException
> gnu.io.NoSuchPortException
>         at
> gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:218)
>

1. Works when launched using eclipse ID means, launched from your
development server. Correct?

2. NoSuchPortException on a 'separate tomcat server' clearly means that
a/the port is not available on the 'target' tomcat server. Correct?

3. Did you compare the ports used when (1) deployed via eclipse IDE and (2)
deployed to a 'separate tomcat server'?

4. Upon reading your question, I searched google for '
gnu.io.NoSuchPortException', and the following was the first listed in the
search results.

http://stackoverflow.com/questions/274179/nosuchportexception-using-rxtx-java-library-on-windows