473,804 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

configure JNDI properties for LDAP server

30 New Member
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.fac tory.initial=co m.sun.jndi.ldap .LdapCtxFactory
java.naming.pro vider.url=ldap://localhost:389

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

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

}
}
----------------------------------------------------------------------------------------------
I got a CommunicationEx ception:connect ion refused ... i tried changing port but the problem remains same.

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

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

Similar topics

5
2872
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 thread. I'm bidding on a PHP intranet development contract. One of the specific requirements is that the app interface with the company's existing Open LDAP server for user authentication.
1
25466
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 I run the client using the -D parameters to specify the JNDI properties, it works fine. Example command line:
0
1965
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()", o=myorgnisation, c=mycontry, etc..., how can we know o=myorganisation, if we are not the one who build the schema???? thanks you very much!!!!
0
8601
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 "<local-jndi-name>" in jboss-web.xml is wrong. But I don't know what to write there. I've searched for examples or other help, but I haven't found anything useful. Thanks for your help in advance!
1
6216
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 JNDI-name like this: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); DataSource ds = (DataSource) envCtx.lookup("jdbc/BookDB"); con = ds.getConnection();
1
4092
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 requirement and cannot be changed. For example index.jsp?db=java:defaultdb How do I use this JNDI name to create a connection? All the literature I have read says to bind the resource manager connection factory reference (res-ref-name) to the...
14
3064
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 make the change? Thank you David
0
2460
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 I won't have to rewrite code for each TestCase subclass. To make a long story short I'm trying to define some JNDI properties that will include my DB name, username, and password so hibernate can pick it up. I think I have the basics in my setUp...
1
2702
vitmca
by: vitmca | last post by:
How to configure jndi name in Jboss. I am using sql server 2005.
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.