can I force my arduino to allow an upload?

I cant seem to get my arduino to accept an upload, whenever I try to upload I get this message

Binary sketch size: 2756 bytes (of a 14336 byte maximum)

processing.app.SerialException: Serial port '/dev/tty.usbserial-A4001J3N' already in use. Try quiting any programs that may be using it.
and a stack trace.....

so i wrote a program to try and determine what is using my serial port, because nothing should be using the serial port.

public class SerialBox {

public static void main(String args[]) {
SerialBox box = new SerialBox();
ArrayList portNames = box.listPorts();
box.printPortOwners(portNames);
}

public void printPortOwners(ArrayList portNames) {
for(String portName : portNames) {
try {
CommPortIdentifier port = CommPortIdentifier.getPortIdentifier(portName);
System.out.println("Name:" + port.getName() + " Owner:" + port.getCurrentOwner());
}
catch(Exception ex) {
ex.printStackTrace();
}
}

}

public ArrayList listPorts() {
ArrayList retList = new ArrayList();
Enumeration portList = CommPortIdentifier.getPortIdentifiers();

while (portList.hasMoreElements()) {
CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement();

if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
retList.add(portId.getName());
}
}
return retList;
}
....

the output is as follows

Stable Library

Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Name:/dev/tty.usbserial-A4001J3N Owner:null
Name:/dev/cu.usbserial-A4001J3N Owner:null
Name:/dev/tty.Bluetooth-PDA-Sync Owner:null
Name:/dev/cu.Bluetooth-PDA-Sync Owner:null
Name:/dev/tty.Bluetooth-Modem Owner:null
Name:/dev/cu.Bluetooth-Modem Owner:null
Experimental: JNI_OnLoad called.
...

did I fry my arduino somehow? /dev/tty.usbserial-A4001J3 has been working for me from the beginning.

When I start it the tx light flashes a few times... is there a way to for it to accept an upload?

Also I tested with an led and a 220ohm resistor, and it looks like pins 0, 1, and 13 are stuck to HIGH.

Help!

Hmm, I doubt you fried the board. That error sounds more like there's some piece of software on your machine that's using the serial port. I've never used the getCurrentOwner() command, but I imagine there might be situations where it returns null but there's still another piece of software holding the port. Have you installed anything lately that might use or try to use serial ports? Can you try it on another computer just to make sure that the board is still working?

you know I upgraded my macbook pro today... maybe something went awry... ill try my wifes windows box....

hrm... blink loaded and running from my the windows box....

any ideas on how to fix the mac?... I know wrong forum....

From what I can see nothing is running that should be accessing he us or serial ports... my little java program shows them as free... reinstall arduino ide?

ok I think I'm getting closer, I just installed the latest FTDI drivers

from /var/log/syslog

when i plug in the arduino

Jan 25 10:34:04 arimac3 kextd[10]: cache inconsistency detected; rescanning all extensions
Jan 25 10:34:11 arimac3 kernel[0]: Resetting IOCatalogue.
Jan 25 10:34:11 arimac3 kextd[10]: 0 cached, 403 uncached personalities to catalog
Jan 25 10:34:14 arimac3 kernel[0]: FTDIUSBSerialDriver: 0 4036001 start - ok

..... and then when I try to load my program

Jan 25 10:34:31 arimac3 [0x0-0x14014].Arduino 10[192]: Stable Library
Jan 25 10:34:31 arimac3 [0x0-0x14014].Arduino 10[192]: =========================================
Jan 25 10:34:31 arimac3 [0x0-0x14014].Arduino 10[192]: Native lib Version = RXTX-2.1-7
Jan 25 10:34:31 arimac3 [0x0-0x14014].Arduino 10[192]: Java lib Version = RXTX-2.1-7
Jan 25 10:34:42 arimac3 [0x0-0x14014].Arduino 10[192]: Couldn't determine program size: text data bss de hex filename
Jan 25 10:34:45 arimac3 [0x0-0x14014].Arduino 10[192]: Binary sketch size: 2756 bytes (of a 14336 byte maximum)
Jan 25 10:34:51: --- last message repeated 1 time ---
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: please see: How can I use Lock Files with rxtx? in INSTALL
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: processing.app.SerialException: Serial port '/dev/cu.usbserial-A4001J3N' already in use. Try quiting any programs that may be using it.
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at processing.app.Serial.(Serial.java:140)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at processing.app.Serial.(Serial.java:72)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at processing.app.Uploader.flushSerialBuffer(Uploader.java:66)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:55)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at processing.app.Sketch.upload(Sketch.java:1632)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at processing.app.Sketch.exportApplet(Sketch.java:1701)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at processing.app.Editor$41.run(Editor.java:2004)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
Jan 25 10:34:48 arimac3 [0x0-0x14014].Arduino 10[192]: at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

so maybe its the lockfile? I just added permissions to /etc/group I have to logout to see if it fixes my problem.... I'll pos the results.

Ah. It looks like you might have another version of RXTX (the serial library used by Arduino) somewhere on your machine that's getting used instead of the one that comes with Arduino. The standard versions of RXTX require that you have permission to create lock files, but I disabled it in the version that comes with Arduino. What do you have in /Library/Java/Extensions and ~/Library/Java/Extensions (i.e. in your home directory)?

This is definitely it thank you.

I installed the latest version of rxtx for use with javax.com myself recently and this make complete sense.... should I just copy the version from the arduino distribution over the ones I installed?

The reason I did this is because I am going to make a web based webcam controller...(I know... yawn) I figured I would write it all in java... model2, so I could re-use the serial interface in a thick client in the future.

That should be fine. The only thing I changed (I think) was disabling the use of lock files.

well I copied the RXTXcomm.jar and librxtxSerial.jnilib from the arduino distribution to /Libaray/Java/Extensions, and everythgin is good now....

My standalone java app works, as does arduino ide, thanks a bunch

Awesome.