This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Java in General and the fly likes CommunicationException ..... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "CommunicationException ....." Watch "CommunicationException ....." New topic

CommunicationException .....

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

Hi all.
I want to access the active directory of WinXP.
I have the following account in my system :
from computer managment , users section :
Name: JohnTodd
Full Name: CN=johntodd
(I am inside the Adminstrators group)
inside the application , I wrote :

and when runing my application, I got the following exception :
javax.naming.CommunicationException : localhost:389 [root exception is :
Connection refused : connect]
why I got this exception ?
is there something wrong in the url ??
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24193

I don't know anything specifically about LDAP or AD, but th exception says pretty clearly that there's nothing listening on port 389 on the local machine. Is there supposed to be? Does netstat show it? Can you telnet to that port?

You're probably supposed to connect to a server machine, not to the local host.

[Jess in Action][AskingGoodQuestions]
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

... or a funny firewall protecting your system...
Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

I am using my pc, so its a localhost there is no firewalls at all.
Consider Paul's rocket mass heater.
subject: CommunicationException .....
jQuery in Action, 3rd edition