Getting an error - Serial port COM3 already in use

Hi, I'm new to this and was testing a few sketches. Things were working fine and my sketches included serial communications. I tried to upload a new one and the software froze up. When I try to upload sketches now, the software freezes up or I get the following message in the serial monitor: Serial port 'COM3' already in use. Try quiting any programs that may be using it.

I tried rebooting, and pressing the reset button (on my Duemilanove). I also went to device manager and uninstalled and reinstalled the arduino but I have had no luck. Help!

I’m having the same problem on “port in use” but my program didn’t freeze. The only way to get uploading up again is by disabling the serial port, reboot, and enable the port again.

I realized that this problem occurred when I pull out the usb cable and plug it back again.

The following is what I copied from the output. Hope someone can help:

Stable Library

Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Binary sketch size: 2930 bytes (of a 14336 byte maximum)
Error 0x5 at /home/bob/foo/rxtx-devel/build/…/src/termios.c(860): Access is den
ied. Serial port ‘COM13’ already in use. Try quiting
any programs that may be using it.
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at Source)

I realised one thing while trying to figure out the port already in use problem. After getting it to work following the cumbersome way of disabling, rebooting and enabling the serial port, I realised that it may be the ide refusing to release it hold on the port (pardon me if I am technically incorrect with terms and jargons here).

When I quite the IDE and started it again, the uploading works ok. Once I plugged out the USB cable and plug it back again, the problem starts. This occurs regardless of whether I unplug the usb cable with IDE running or after I shutdown the IDE.

So it seems to me that the device still hanging on to the serial port is the IDE than any other program.

Anyone has any solution or things I can try with?

I found out my problem, I had a wire connected to the serial in (RX) that was sending data while I uploaded the sketch. This seemed to cause the problem since when I stopped the serial data transfer during the upload process and waited to start the data transfer after it worked fine