473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

configure JNDI properties for LDAP server

I have a problem in configuring JNDI properties for LDAP server

i created jndi.properties file in the current directory where i'm running a simple java code.

jndi.properties file which i created consists the following:
java.naming.factory.initial=com.sun.jndi.ldap.Ldap CtxFactory
java.naming.provider.url=ldap://localhost:389

and i'm using j2eeRI 1.3 to run the following code:
filename : JNDILookupAny.java
----------------------------------------------------------------------------------------------
import javax.naming.*;

public class JNDILookupAny
{
public static void main(String args[])
{
try{
if(args.length!=1)
{
System.err.println("Usage : JNDILookupAny JNDIName");
System.exit(1);
}
Context ic = new InitialContext();
Object o = ic.lookup(args[0]);
System.out.println(args[0]+" = "+o);
}
catch(NamingException ne)
{
System.err.println(ne);
System.exit(1);
}
catch(ClassCastException cc)
{
System.err.println(cc);
System.exit(1);
}

}
}
----------------------------------------------------------------------------------------------
I got a CommunicationException:connection refused ... i tried changing port but the problem remains same.

help me!!!!!!!!!!!!!!!!!!!!!!!!1
Dec 7 '06 #1
0 1598

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: dmcconkey | last post by:
Hi folks, I've been searching for a while and haven't found my specific question anywhere else. If this has already been asked, please accept my appologies and point me to the appropriate...
1
by: Kent | last post by:
I'm running on Win2000 and JRE 1.4.1.... I've got a small client trying to do get an InitialContext() and talk to the local JBoss server running on same machine (different VM of course). When...
0
by: sayoyo | last post by:
Hi, Is there any way we can know the whole stucture of the LDAP schema by using JNDI of JAVA??? example, when we want to perform a search, we have to tell the function "serach()",...
0
by: Steffen | last post by:
Hi! I'm trying to access a EntityBean from a servlet via the bean's local home interface. The EJB and the Servlet are together in one .ear file and I'm using JBoss 3.2.3. I think the...
1
by: slurper | last post by:
i have problems understanding jndi. i'm this far: i deployed the sun application server and i'm working through the examples (Duke bookstore, ...). Sometimes i see code which does a lookup to a...
1
by: John Chambers | last post by:
Hi all, I'm relatively new to JNDI concepts and need some help. I am writing a web app that accepts a variable specifying a jndi pooled connection datasource as a url variable. This is a...
14
by: david | last post by:
I have developed web forms including login by using ASP.NET via HTTP. Now I want to secure the connection from client to the server via HTTPS. How can I configure the server or something else to...
0
by: NamelessNumberheadMan | last post by:
I'm looking to use JUnit to test some code that uses Hibernate to connect to my DB (SQL Server). Although I can do this using a hibernate.cfg.xml file I want to create a super class I can extend so...
1
vitmca
by: vitmca | last post by:
How to configure jndi name in Jboss. I am using sql server 2005.
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.