Need Help: How to get rid the NoInitialContextException

import javax.naming.*;
import java.io.*;
import java.util.*;
public class test {
public static void main(String[] args) throws Exception{
Context ctx = new InitialContext();
Hashtable env = ctx.getEnvironment();
System.out.println(env.toString());
I'n trying to printout the environment contained in the initial context but it just keeps giving me the NoInitialContextException during runtime. Below are the version of j2se and classpath i have set.
J2SE version: J2SDK 1.3.1_03
Classpath: %JAVA_HOME%/lib
OS: WIN2K
My Knowledge on JNDI: ROOKIE (Beginner)
Please help out.

tehts,
You must set the environment first:
import java.util.Hashtable;
import javax.naming.*;
import javax.naming.directory.*;
env = new Hashtable(5, 0.75f);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, URL);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, DN); //use your own one
env.put(Context.SECURITY_CREDENTIALS, PassWord); //use your own one
try {
ctx = new InitialDirContext(env);
Hashtable env1 = ctx.getEnvironment();
System.out.println(env1.toString());
} catch (NamingException e) {
e.printStackTrace();
Hope this helps.
Cheers,
George

Similar Messages

  • Hi, I have this green mark (with pointing arrow looks like a link) on some words show on my window screen when I open a web page, I wonder if it is a virus link or such. Need help how to get rid of it. Thanks

    Hi, I have this green mark (with pointing arrow looks like a link) on some words show on my window screen when I open a web page, I wonder if it is a virus link or such. Need help how to get rid of it. Here's the example:
    WING
    GAMES
    MAJORITY
    Thanks

    If the third link you posted (the link containing the word "majority") does not look like the following then you inadvertently installed adware.
    That particular page should resemble the following:
    The word "majority" in the third paragraph should not be a link and should not have the green icon associated with it.
    To learn how this may have occurred, and how to prevent it from occurring in the future, read How to install adware
    Most so-called "news" websites are nothing more than entertainment outlets that cater to prurient interests, and contain advertisements that leave the user about three clicks away from installing junk. If you decide to frequent those websites, Safari's "Reader" feature helps minimize that exposure.
    Try it:

  • Help:  How to get rid of the default None from Radio buttons?

    Hi, I searched the forum and found a work around for inputSelect. It seemed it does not work for Radio buttons, i.e., inputSelectGroup with multiple=false.
    Please anyone help us to get rid of the none choice for gender among female and male. Thank you very much in advance.
    ZD

    The 'none' choice is automatically displayed for fields that allow nulls.

  • I keep getting asked to agreed to the new terms and conditions and can not accept them please help, how to get rid of it?

    I need help please I have my i phone, im setting the icloud and it keeps telling me to accept the new terms and conditions but the page wont populate for me to accept it, im getting annoying with it the pop up us making me crazy plase help.

    Try these...
    1)  Press the Accept Button Twice...
    2)  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • Help: How to get rid off the default Window menu from FORM screen?

    Hi,
    I am working on a FORM application. On the very top left of the FORM screen, there is a default Window menu with:
    Cascade
    Tile Horizontally
    Tile Vertically
    etc.
    The end user will never use it for this application. To make the screen look nicer, is there a way to hid or get rid off it?
    Also if possible, I want to hid or get rid off very top "Oracle Developer Forms Runtime - Web"
    Thanks.
    Jimmy

    Also if possible, I want to hid or get rid off very top "Oracle Developer Forms Runtime - Web"I see you are running with separate frame. In the When-new-form-instance trigger, use
    Set_Window_Property(Forms_MDI_Window, Title, "xyz" );
    to change the window title.

  • Need Help: How do you download the free trial of Cs6 for a Mac Snow Leopard?

    How do you download the free trial of Cs6 for a Mac Snow Leopard?

    CS6 requires OS X 10.6.8.
    http://helpx.adobe.com/x-productkb/policy-pricing/system-requirements-photoshop.html#main_ Photoshop_CS6_system_requirements
    So make sure you're running OS X 10.6.8.
    Download CS6 from http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html

  • HT1212 I NEED HELP HOW CAN GET IT

    i need help my iphone is lock

    You didn't really specify your issue but I'll assume you need this help article here:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212

  • NEED HELP - how do i lower the burn rate to 1x in DVD Studio Pro 4

    Ok, i made a (2) master copies of a DVD-R (Verbatim) in Studio Pro 4 and sent it to a duplicator and I got a call saying there was unreadable data on the discs.
    He then asked me to lower the burn rate to 1x. I can't figure out how to do that. Where do I do that? Please help. Have a deadline!!!
    Thanks.

    Dave
    You cannot change the burning speed in DVDSP. It will always use the max speed available. To control the burning speed you need to create a disc image of your project and burn it with Disk Utility or Toast.
    Read this tutorial about * Creating Disc Image in DVDSP *.
    Hope that helps !
      Alberto

  • Need help how to get G4 mac to print to HP Laserjet 4  w/usb/parallel cable

    I have a PowerPC G4 w/OSX 10.4.11 and a HP laserjet 4 connected with a USB to parallel cable,  I cannot get it to print,
    how do I fix it ?
    thanks in advance

    Have you tried going to the "Print and Fax" pane of the system preferences, and Control-clicking into the panel at the left that would normally show installed printers?
    If not, do that and if the cursor spins, wait until it stops, and the LaserJet 4 should show up as a Bonjour Printer/Scanner. Then click "+" to add a printer, then "more printers" and then select the HP device, and with any luck it should work.

  • HELP: How to get only the text of an element Node

    Hello
    I am using XPath for the following XML document:
    <Start>
    <User>
    <LoginName>abc</LoginName>
    <Password>qqq</Password>
    </User>
    <User>
    <LoginName>xyz</LoginName>
    <Password>ttt</Password>
    </User>
    </Start>
    Now I want to get the password for the LoginName = 'xyz'.
    The XPath I have written is:
    //User[LoginName='xyz']/Password[text()]"
    The result I get is:
    <Password>ttt</Password>
    But what I want is ONLY the password TEXT i.e the value of the password and NOT the complete node information. What Should I do with the Xpath string so that the result only gives: ttt
    Please help me with this as this has hold me now for quite a long time.
    Thanx.
    Arshad

    Use this method to get the text in Java
    public String getTextContents ( Node node )
    NodeList childNodes;
    StringBuffer contents = new StringBuffer();
    childNodes = node.getChildNodes();
    for(int i=0; i < childNodes.getLength(); i++ )
    if( childNodes.item(i).getNodeType() == Node.TEXT_NODE )
         contents.append(childNodes.item(i).getNodeValue());
    return contents.toString();
    }

  • Routine help : How to get rid of "#" ?

    Hello,
    I know this issue has already been discudded many times here, but I'm still having problem with invalid caracter "#". We are loading Plant Maintenance Orders every morning  and the data load failed repeatedly due to the presence of a "#" character in the text line (fied C_TEXT = Slopklep gaat constant open en dicht#).
    We've found that the "#" character is in fact interpreted by default, the corresponding hexadecimal code is "09".
    We were unable to convince the R/3 team to correct the error on their side, therefore i tried to write the following abap routine :
    Unfortunatly, I'm not really a great abaper , as you can see, and instead of beig corrected, the field is deleted.
    Could you help me to write this routine ?
      data : hex_char type X value '09',
      hex_sp type X value ' ',
      hex_text type Xstring ,
      car_text like COMM_STRUCTURE-/BIC/C_TEXT.
      move COMM_STRUCTURE-/BIC/C_TEXT to hex_text.
      replace all occurrences of hex_char in hex_text
      with hex_sp in byte mode.
      move hex_text to car_text.
    result value of the routine
      RESULT = car_text .
    Any help would be greatly appreciated.
    Best Regards.

    Hello,
    Thank you for your answer, but it didn't solve my issue :
    I tried to use "replace" without considering the  hexadecimal characters.
    data : car_text like COMM_STRUCTURE-/BIC/C_TEXT.
    move COMM_STRUCTURE-/BIC/C_TEXT to car_text.
    REPLACE ALL OCCURRENCES OF '#' IN car_text WITH SPACE.
    result=car_text.
    But it didn't work, the system uses character '#' for all hexadecimal values for which ABAP does not have an own character. In my case, the hexadecimal "09" is interpreted as "#".
    I have returted to  the initial routine :
      data : hex_char type X value '09',
      hex_sp type X value ' ',
      hex_text type Xstring ,
      car_text like COMM_STRUCTURE-/BIC/C_KTEXT.
      move COMM_STRUCTURE-/BIC/C_KTEXT to hex_text.
    I try here to convert the field C_KTEXT in hexadecimal
    using the move intruction but it doesn't work.
    hex_text remains blank
      replace all occurrences of hex_char in hex_text
      with hex_sp in byte mode.
      move hex_text to car_text.
    therefore car_text is not filled
    result value of the routine
      RESULT = car_text .
    By debugging, the routine I have found that the follolwing
    move COMM_STRUCTURE-/BIC/C_TEXT to hex_text.

  • [Need Help] How can I install the trial of Adobe After Effects? Since I cannot find it in my creative cloud.

    Hi, I want to try the trial of After effects but I haven't found any after effects in my creative cloud. Any solutions?
    Thank you

    If an application is not listed it is normally because your machine does not meet the system requirements for that application.  Check the AFter Effects requirements against your machine to see if there is a mismatch...
    After Effects - http://helpx.adobe.com/after-effects/system-requirements.html

  • IPhone needs space / how to get rid of other

    There is too much "other" on my iPhone. In the past I've done a reset (at least I think that's what it was called). It was not too hard but a bit nerve racking. Is there an easier way to clear out other?
    Thanks.         

    Check out this great User Tip from Kappy:
    What is “Other” and What Can I Do About It?

  • I cant update nor download any applications. My password was always invalid. And other username is prompted richardca0521@yahoo.ca which is not my account. How to get rid of this apple id and use my account for download? I have registered this to itunes.

    I can't update nor download any apps in itunes. Prompted invalid password, upon checking the apple id was not mine. The id was [email protected] whic is not mine. Pls. Help how to get rid of this. Thank you.

    try and delete the apps and re-add them

  • All of my photos are displayed as BW because somehow I've saved a quick develop preset and it saves as BW.  This is for all of my photos.  I can individually undo them but need help in how to get rid of the preset so it goes to Default. thanks

    All of my photos are displayed as BW because somehow I've saved a quick develop preset and it saves as BW.  This is for all of my photos.  I can individually undo them but need help in how to get rid of the preset so all photos goes to Default or as shot. thanks

    Go to the develop module and highlight all of the images in the filmstrip at the bottom of the screen. Then activate Auto-sync and click on the Reset button. That should reset all of the images to your camera default settings.

Maybe you are looking for

  • Libiconv madness

    Gentleones, My nmblookup crashes every time something calls it, and it gripes with this message: Dyld Error Message: Symbol not found: iconvopen Referenced from: /usr/bin/nmblookup Expected in: /usr/local/lib/libiconv.2.dylib My smbd crashes like thi

  • IDOC Packaging Sender CC

    Hi Gurus, I've been using IDOC packaging in the IDOC sender communication channel very well without any problems so far. Most of my scenarios I have to group several IDOCS and generate just one file, and using the new functionality I can reach my sce

  • Dissociate default printer driver from the report viewer

    Hello, I have a problem in reports visualization. I set the report paper size via the code: _printOptions.PaperSize = CrPaperSizeEnum.crPaperSizePaperCsheet; The problem is when i visualize it it's truncated to the printer default paper size. How cou

  • Lion Mail 5.0 Subject text behind button

    When creating a new message in Mail, I see the word "Onderwerp" (Dutch for Subject) is partially behind the button for extra options (see picture below) I tried resizing the window, restarting Mail, rebooting, but it's still like in this picture. Cur

  • Premiere Elements 10 doesn't always play

    I've been using PRE 10 since it was launched, and PRE 9 before that. No major problems, just a few hiccups. I havn't changed or knowingly installed anything on my PC, but although everything else still works, when I press the 'Play' button sometimes