You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by efftronics <ra...@efftronics.com> on 2010/10/09 07:14:12 UTC

unable to access comm ports on apache tomcat 6.0.18

Hi , I installed apache tomca 6.0.18 sucessfully.In some web application i
want to write data to comm port, but my application returning
"java.io.exception : unable to open port : com1".i sucessfully installed
java communication api. it it working for other normal java application only
with applications deployed on apache tomcat i am getting this problem.
please help me. 

 SerialComm com1 = new SerialComm(null ,"com1"); 
 com1.setBitRate("115200"); 
 com1.open; // here i am getting exception 



-- 
View this message in context: http://old.nabble.com/unable-to-access-comm-ports-on-apache-tomcat-6.0.18-tp29920827p29920827.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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 ramkumar <ra...@efftronics.com>.
Hi,
    Thank you for your response and very sorry for the in complete details
of exception. My problem is
    
    I want to send SMS to mobile clients using GSM modem. Modem is
connected to PC through COM port. I installed JAVA COMMUNICATION API. 
    I am using ecclipse ide. I am able to run my web application from
ecclipse ide by enabling apache tomcat server from the ide(By using  
option run as server in Ecclipse). But after deploying my application in
apache tomcat server i am unamblt access comm ports.

I am using  APACHE TOMCAT 1.6.0.18 and JAVA 1.6 on Windows xp platform.

My part of code is:
       SerialComm com1 = new SerialComm(null ,"COM1");
       com1.setBitRate("115200");
       COM1.OPEN(); // HERE I AM GETTING EXCEPTION

My full stack trace is

java.lang.ClassNotFoundException: javax.comm.PortInUseException
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
	at
com.nokia.test.demo.ConfigureTerminal.doPost(ConfigureTerminal.java:105)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	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:286)
	at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
	at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
	at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
	at java.lang.Thread.run(Unknown Source)


Please help me. Thank you.
  

---------------------------------------------------------------------
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 André Warnier <aw...@ice-sa.com>.
Pid wrote:
> On 09/10/2010 06:14, efftronics wrote:
>> Hi , I installed apache tomca 6.0.18 sucessfully.
> 
> Why such an old version?
> 
>> In some web application i want to write data to comm port, but my application returning
>> "java.io.exception : unable to open port : com1".i sucessfully installed
>> java communication api. it it working for other normal java application only
>> with applications deployed on apache tomcat i am getting this problem.
>> please help me. 
>>
>>  SerialComm com1 = new SerialComm(null ,"com1"); 
>>  com1.setBitRate("115200"); 
>>  com1.open; // here i am getting exception 
> 
> That doesn't really help me understand the problem.  Perhaps you could
> post the full stacktrace?
> 
> Which OS are you using?
> 
> What's the exact JVM version?
> 

It is not only Tomcat which sounds old here.
Apparently, the OP is trying to open a serial COM1: port of a PC and write to it.
I have not heard of this kind of thing for many years, and I am surprised that Java would 
even have an API for it.

efftronics,
what exception are you getting ? can you paste the stack trace here ?

This may be a case of Security Manager interference, no ?

---------------------------------------------------------------------
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

Re: unable to access comm ports on apache tomcat 6.0.18

Posted by pranjal rajput <fi...@gmail.com>.
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 ramkumar <ra...@efftronics.com>.
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. 

---------------------------------------------------------------------
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 Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ramkumar,

On 10/12/2010 11:43 PM, ramkumar wrote:
>     Thank you for your response. I dont the communication api version  i
> think it is 2.0.

They are on 3.0, now.

http://www.oracle.com/technetwork/java/index-jsp-141752.html

> I searched for latest version but i could not find it for
> windows OS. I get it from some uploader site.

There don't appear to be any implementations for Microsoft Windows.

What "uploader site" did you get it from? I generally don't just
download stuff randomly from unrecognized sites. I guess many Microsoft
Windows users do that.

- From the Java Communication API download page:

"
Sun no longer offer's the Windows platform binaries of javax.comm,
however javax.comm 2.0.3 can be used for the Windows platform, by using
it in conjunction with the Win32 implementation layer provided by the
RxTx project. To use that, download javax.comm for the 'generic'
platform (which provides the front-end javax.comm API only, without
platform specific back-end implementations bundled). Then acquire the
Windows binary implementation rxtx-2.0.7pre1 from http://www.rxtx.org.
"

Sounds relatively straightforward to me.

Boy, Sun/Oracle's website is impossible to navigate. Trying to find that
download page basically required Google. :(

> My WEB-INF\LIB has following jar files

Your project's lib directory is a complete mess.

As Pid points out, you have a lot of libraries in there that aren't
appropriate: remove all the Tomcat-related stuff and maybe put the
java-comm.jar or whatever it's called in there.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky19mcACgkQ9CaO5/Lv0PC++ACfahxbaFo3UL1FwnMkIJmJp+mr
PUMAoJprTKTCTm9EP1aECFiOvIuqJYUI
=abKJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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 Pid * <pi...@pidster.com>.
On 13 Oct 2010, at 04:44, ramkumar <ra...@efftronics.com> wrote:

> Hi,
>    Thank you for your response. I dont the communication api version  i
> think it is 2.0. I searched for latest version but i could not find it for
> windows OS. I get it from some uploader site. My WEB-INF\LIB has following
> jar files

Also, which one of these has the Javax.comm api?


p


>        (1)commons-logging-1.1.1.jar
>        (2)el-api
>        (3)jakarta-oro-2.0.8
>        (4)jasper
>        (5)jasper-el
>        (6)jasper-jdt
>        (7)jigadmin
>        (8)jigedit
>        (9)jigsaw
>        (10)jmimemagic-0.1.0
>        (11)jsp-api log4j-1.2.16
>        (12)log4j-over-slf4j-1.6.1
>        (13)sax
>        (14)slf4j-api-1.6.1
>        (15)slf4j-jcl-1.6.1
>        (16)smsj-20051126
>        (17)Tidy tomcat-coyote
>        (18)tomcat-dbcp
>        (19)tomcat-i18n-es
>        (20)tomcat-i18n-fr
>        (21)tomcat-i18n-ja
>        (22)xerces xmlsec-1.3.0 xp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
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 Pid * <pi...@pidster.com>.
On 13 Oct 2010, at 04:44, ramkumar <ra...@efftronics.com> wrote:

> Hi,
>    Thank you for your response. I dont the communication api version  i
> think it is 2.0. I searched for latest version but i could not find it for
> windows OS. I get it from some uploader site. My WEB-INF\LIB has following
> jar files

Okay... It shouldn't have some of those.

>        (1)commons-logging-1.1.1.jar

Remove EL:
>        (2)el-api
>        (3)jakarta-oro-2.0.8

Remove Jasper:
>        (4)jasper
>        (5)jasper-el
>        (6)jasper-jdt

>        (7)jigadmin
>        (8)jigedit
>        (9)jigsaw
>        (10)jmimemagic-0.1.0

Remove JSP
>        (11)jsp-api

> log4j-1.2.16
>        (12)log4j-over-slf4j-1.6.1
>        (13)sax
>        (14)slf4j-api-1.6.1
>        (15)slf4j-jcl-1.6.1
>        (16)smsj-20051126
>        (17)Tidy

Remove tomcat:
> tomcat-coyote
>        (18)tomcat-dbcp
>        (19)tomcat-i18n-es
>        (20)tomcat-i18n-fr
>        (21)tomcat-i18n-ja


p

>        (22)xerces
> -1.3.0 xp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
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 ramkumar <ra...@efftronics.com>.
Hi, 
    Thank you for your response. I dont the communication api version  i
think it is 2.0. I searched for latest version but i could not find it for
windows OS. I get it from some uploader site. My WEB-INF\LIB has following
jar files


        (1)commons-logging-1.1.1.jar
        (2)el-api
        (3)jakarta-oro-2.0.8
        (4)jasper
        (5)jasper-el
        (6)jasper-jdt 
        (7)jigadmin 
        (8)jigedit 
        (9)jigsaw 
        (10)jmimemagic-0.1.0 
        (11)jsp-api log4j-1.2.16 
        (12)log4j-over-slf4j-1.6.1
        (13)sax  
        (14)slf4j-api-1.6.1   
        (15)slf4j-jcl-1.6.1   
        (16)smsj-20051126 
        (17)Tidy tomcat-coyote  
        (18)tomcat-dbcp 
        (19)tomcat-i18n-es 
        (20)tomcat-i18n-fr 
        (21)tomcat-i18n-ja
        (22)xerces xmlsec-1.3.0 xp

---------------------------------------------------------------------
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 Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ramkumar,

On 10/11/2010 5:00 AM, ramkumar wrote:
> Hi , i am exporting war file using ecclipse ide(Ecclipse has option to
> export .war file). I am starting tomcat service runner(tomcat6.exe) and my
> server.xml file is

Can you show us what is in your .war file under WEB-INF/lib?

Also, what version of Java Communications API are you using? Compiling
with JDK1.4 and using JRE1.6 shouldn't really be a problem, but there
should also be no reason to use Java 1.4 any longer: even Java 1.5 is no
longer supported by Sun/Oracle.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky0zXMACgkQ9CaO5/Lv0PBkDwCeJ7tCxnMAfLeITwEss3exBBcF
pFkAnjFA9e+WOA3338ZX7XoJSmKcivZC
=2u/I
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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 ramkumar <ra...@efftronics.com>.
Hi , i am exporting war file using ecclipse ide(Ecclipse has option to
export .war file). I am starting tomcat service runner(tomcat6.exe) and my
server.xml file is

<?xml version='1.0' encoding='utf-8'?>

<Server port="8005" shutdown="SHUTDOWN">

 
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  
  <Listener className="org.apache.catalina.core.JasperListener" />
 
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  
       Documentation at /docs/jndi-resources-howto.html

  <GlobalNamingResources>
    
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
             
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

 
  <Service name="Catalina">
  
   
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
        maxThreads="150" minSpareThreads="4"/>
    -->
    
    
   
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
   
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->           
   
   <Connector port="20000" maxHttpHeaderSize="8192"
               maxThreads="150" 
               enableLookups="false" 
               disableUploadTimeout="true"
               acceptCount="100" 
               scheme="https" 
               secure="true"
               sslProtocol="TLS"
	       SSLEnabled="true"
              
SSLCertificateFile="C:\apache-tomcat-6.0.18\bin\tomcatcert.pem"
              
SSLCertificateKeyFile="C:\apache-tomcat-6.0.18\bin\tomcatkey.pem"  
   
  />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information
about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

     
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web
applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn"
/>
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"  
               prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>


---------------------------------------------------------------------
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 Pid <pi...@pidster.com>.
On 11/10/2010 08:47, ramkumar wrote:
> hi,
>     Thank you for the response. I am sure that no other programs using the
> port.I am suspecting that Tomcat not loading the jar file. I got same error
> while using the api coomons.fileupload for uploading the files to server.I
> put the all the required jar files in my project.But it is telling that
> "Class not found".Tell me if u have any idea.

Well, in the former case, some class in javax.comm is throwing a
PortInUseException.

The latter case may be a separate problem.

Are you deploying a .war file to Tomcat?

If so, exactly how are you doing that?

Please remove all of the comments & any passwords from your server.xml
(this is important) and post it, inline in an email, here.

How are you starting Tomcat, a script file?  If so which one?


p

Re: unable to access comm ports on apache tomcat 6.0.18

Posted by ramkumar <ra...@efftronics.com>.
hi,
    Thank you for the response. I am sure that no other programs using the
port.I am suspecting that Tomcat not loading the jar file. I got same error
while using the api coomons.fileupload for uploading the files to server.I
put the all the required jar files in my project.But it is telling that
"Class not found".Tell me if u have any idea.

        Thank you.

---------------------------------------------------------------------
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 efftronics <ra...@efftronics.com>.
Hi ,
     I am sure that no other progams are mot using com ports. I am
connecting to com port in listener class.Today i found that i am working
with jdk1.6  and jre 1.4  please tell whether all these problems are due to
different versions of jdk and jre ?

  Thank you.
-- 
View this message in context: http://old.nabble.com/unable-to-access-comm-ports-on-apache-tomcat-6.0.18-tp29920827p29944175.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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 Pid <pi...@pidster.com>.
On 11/10/2010 04:31, ramkumar wrote:
> Hi Pid,
>         Thank you for your response. Not only for this comunication api,
> if i put thr jar files in WEBAPPS/<MY APPLICATION>/WENINF/LIB it is showing
> the "No Class found". plese help me. Whw]at are rthe chnages i have to do?
>  Thank you. 

That's probably true actually.  I misread* the exception.

java.lang.ClassNotFoundException: javax.comm.PortInUseException
	at

Presumably you're catching and rethrowing the exception, using the wrong
exception, because these two shouldn't interact like this.

javax.comm is reporting that the port is already in use
(PortInUseException), possibly because you've left one of your other
versions of the program running in the IDE still.

Stop them, before running Tomcat.

If there are no other programs connected to the port, then we need to
know more about how and when the javax.comm code you've implemented runs
and how you are testing it.

Is it in a Listener or a Servlet?  Where is it defined in this class?

Either way, I suspect that this model isn't going to work very well.


p

* Again! My hit rate is appalling recently.


Re: unable to access comm ports on apache tomcat 6.0.18

Posted by ramkumar <ra...@efftronics.com>.
Hi Pid,
        Thank you for your response. Not only for this comunication api,
if i put thr jar files in WEBAPPS/<MY APPLICATION>/WENINF/LIB it is showing
the "No Class found". plese help me. Whw]at are rthe chnages i have to do?
 Thank you. 

---------------------------------------------------------------------
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 Pid <pi...@pidster.com>.
On 09/10/2010 16:56, Mikolaj Rydzewski wrote:
> ramkumar wrote:
>>     I want to send SMS to mobile clients using GSM modem. Modem is
>> connected to PC through COM port. I installed JAVA COMMUNICATION API.
>>     I am using ecclipse ide. I am able to run my web application from
>> ecclipse ide by enabling apache tomcat server from the ide(By using 
>> option run as server in Ecclipse). But after deploying my application in
>> apache tomcat server i am unamblt access comm ports.
>>
>> I am using  APACHE TOMCAT 1.6.0.18 and JAVA 1.6 on Windows xp platform.
>>
>> My part of code is:
>>        SerialComm com1 = new SerialComm(null ,"COM1");
>>        com1.setBitRate("115200");
>>        COM1.OPEN(); // HERE I AM GETTING EXCEPTION
>>
>> My full stack trace is
>>
>> java.lang.ClassNotFoundException: javax.comm.PortInUseException

Case closed.  You haven't included the javax.comm API jar in the
application.


p

Re: unable to access comm ports on apache tomcat 6.0.18

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
ramkumar wrote:
>     I want to send SMS to mobile clients using GSM modem. Modem is
> connected to PC through COM port. I installed JAVA COMMUNICATION API. 
>     I am using ecclipse ide. I am able to run my web application from
> ecclipse ide by enabling apache tomcat server from the ide(By using  
> option run as server in Ecclipse). But after deploying my application in
> apache tomcat server i am unamblt access comm ports.
>
> I am using  APACHE TOMCAT 1.6.0.18 and JAVA 1.6 on Windows xp platform.
>
> My part of code is:
>        SerialComm com1 = new SerialComm(null ,"COM1");
>        com1.setBitRate("115200");
>        COM1.OPEN(); // HERE I AM GETTING EXCEPTION
>
> My full stack trace is
>
> java.lang.ClassNotFoundException: javax.comm.PortInUseException
>   
Are you able to communicate with modem at all? Not from within 
webapplication / tomcat?
Make sure you can do it, then try to deploy your code to tomcat.

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


---------------------------------------------------------------------
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 ramkumar <ra...@efftronics.com>.
Hi,
    Thank you for your response and very sorry for the in complete details
of exception. My problem is
    
    I want to send SMS to mobile clients using GSM modem. Modem is
connected to PC through COM port. I installed JAVA COMMUNICATION API. 
    I am using ecclipse ide. I am able to run my web application from
ecclipse ide by enabling apache tomcat server from the ide(By using  
option run as server in Ecclipse). But after deploying my application in
apache tomcat server i am unamblt access comm ports.

I am using  APACHE TOMCAT 1.6.0.18 and JAVA 1.6 on Windows xp platform.

My part of code is:
       SerialComm com1 = new SerialComm(null ,"COM1");
       com1.setBitRate("115200");
       COM1.OPEN(); // HERE I AM GETTING EXCEPTION

My full stack trace is

java.lang.ClassNotFoundException: javax.comm.PortInUseException
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
	at
com.nokia.test.demo.ConfigureTerminal.doPost(ConfigureTerminal.java:105)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	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:286)
	at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
	at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
	at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
	at java.lang.Thread.run(Unknown Source)


Please help me. Thank you.
  


---------------------------------------------------------------------
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 Pid <pi...@pidster.com>.
On 09/10/2010 06:14, efftronics wrote:
> 
> Hi , I installed apache tomca 6.0.18 sucessfully.

Why such an old version?

> In some web application i want to write data to comm port, but my application returning
> "java.io.exception : unable to open port : com1".i sucessfully installed
> java communication api. it it working for other normal java application only
> with applications deployed on apache tomcat i am getting this problem.
> please help me. 
> 
>  SerialComm com1 = new SerialComm(null ,"com1"); 
>  com1.setBitRate("115200"); 
>  com1.open; // here i am getting exception 

That doesn't really help me understand the problem.  Perhaps you could
post the full stacktrace?

Which OS are you using?

What's the exact JVM version?


p