ORA-12154: TNS:could not resolve the connect identifier specified

listener is up and running fine,but from distant machine,if a connection is made from netbeans to oracle,then for the first time it's working ,but 2nd time or the 3rd time,the database is not able to get connected.

can anybody say me something upon this?

its urgent.