wood burning stoves
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 Head First Android this week in the Android 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 java.net.ConnectException :
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: 24189

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.
wood burning stoves
subject: CommunicationException .....
It's not a secret anymore!