Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

CommPortIdentifier incorrectly lists available COM ports

Thread view: 
John - 09 Nov 2006 15:58 GMT
I have some code (in an OSGi bundle) which uses a CommPortIdentifier
object to enumerate the available COM ports on a Windows XP system
(Dell Latitude laptop).
With portList being an Enumeration object, it sets:
portList = CommPortIdentifier.getPortIdentifiers();

When the code next calls 'portList.hasMoreElements(),' the method
returns 'false,' even though there clearly is a COM1 port which I can
observe in action using HyperTerminal (HyperTerm is closed when running
the Java code).

The strange thing is that this code has been known to work on this same
machine in the past.  One day the behavior changed and I can't figure
out why...any suggestions would be greatly appreciated.
John - 09 Nov 2006 16:41 GMT
I should add that after reviewing posts on this topic, I found that the
file javax.comm.properties was in the c:\jre1.5.0_06\lib directory on
my desktop but absent on my laptop...this must be the problem, right?
I copied the file over, rebooted, and the problem persists.
Does anyone know whether I need to install the fullblown Java SDK
rather than just the skeleton JRE?

> I have some code (in an OSGi bundle) which uses aCommPortIdentifier
> object to enumerate the available COM ports on a Windows XP system
[quoted text clipped - 10 lines]
> machine in the past.  One day the behavior changed and I can't figure
> out why...any suggestions would be greatly appreciated.
Knute Johnson - 09 Nov 2006 16:54 GMT
> I should add that after reviewing posts on this topic, I found that the
> file javax.comm.properties was in the c:\jre1.5.0_06\lib directory on
[quoted text clipped - 17 lines]
>> machine in the past.  One day the behavior changed and I can't figure
>> out why...any suggestions would be greatly appreciated.

You don't need the JDK.  There are three files, comm.jar which goes into
the JRE/lib/ext directory, javax.comm.properties which goes into the
JRE/lib directory and win32com.dll which goes into the JRE/bin
directory.  Some operating systems report more ports than actually exist
but under reporting is usually an installation or coding problem.

Signature

Knute Johnson
email s/nospam/knute/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.