Newbie Question w/Java 1.4 & InitialContext

The below listed code works fine using the included properties and jdk1.3.1. Using jdk1.4.1_02, I get the following exception...
// Exception I got using JDK 1.4
javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name ''
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2942)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2863)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2669)
at com.sun.jndi.ldap.LdapCtx.c_list(LdapCtx.java:1033)
at com.sun.jndi.toolkit.ctx.ComponentContext.p_list(ComponentContext.java:551)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.list(PartialCompositeContext.java:273)
at com.sun.jndi.toolkit.ctx.PartialCompositeContext.list(PartialCompositeContext.java:262)
at javax.naming.InitialContext.list(InitialContext.java:387)
at AppList.main(Unknown Source)
// Property file: jndi.properties:
com.sun.jndi.ldap.netscape.schemaBugs=true
java.naming.security.authentication=simple
java.naming.provider.url=ldap://localhost:389/o=My Corp
java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
java.naming.security.principal=cn=Directory Manager
java.naming.security.credentials=mypw
////////// Code Here
import javax.naming.*;
class AppList {
public static void main(String[] args) {
String target = "";
try {
     Context ctx = new InitialContext();
     NamingEnumeration enum = ctx.list(target);
     while (enum.hasMore()) {
     System.out.println(enum.next());
     } catch (NamingException e) {
     e.printStackTrace();
Thanks for any help with this, I'm stumped.
-Michael Gray

Just read elsewhere with similar problem. Try putting single quotes around the item in your URL that contains spaces.
http://www.ldapguru.org/modules/newbb/viewtopic.php?topic_id=621&forum=6

Similar Messages

  • Newbie question to java web services....

    hi,
    I used to be a .net programmer for a few years, and am have done web services in .net.... (using IIS, of course)
    And i moved onto Java side recently - and am pretty new to tomcat / axis..etc..
    I looked at the netbeans ide tutorial, and it covered on how to create a web services and a client using the IDE - with that is with the sun app server. Since I want to stick with Tomcat (which is a servlet container, i believe), the compilation complained that the HelloWSImpl.java is not a servlet, and will not let me run the web app. I have tried the WSDP 2.0 tutorial as well, but I first got the FastSetsource.jar not found? Then I got some other classes not found..etc... so, until now - i still am not able to create a web service, and a cliet to talk back and forth.
    I have the following questions..
    1. I am confused that how come tomcat itself is already a webserver, why would people use it on top of apache http server, which is another web server?
    2. To create a web services, (I am thinking of the .net web services that i have done - that once you deploy it with IIS, and you browse to that service, if the function takes 2 parameter, there will be 2 textboxes waiting for you to put data to, then once you post - the xml response will come back...), does java allow front end interface automatically like that in .net? Or you have to code the JSP pages to include those textboxes yourself, and do a manual post to the web services address?
    3. Are there any book out there, explains how to use tomcat for webservices? I have looked thru some of the java books that talks about web services, they mainly explain what webservices are, what is xml..etc... and of course, they did talk about the differenct type of messaging format available. (JAX-RPC..etc..)
    4. In the java world - how do you use webservices? Is it the same way that i am familiar with? Like, that we have a front end gui, that it will call the web services, pass it a few param, and get the xml result back, and parse it and display / store.. it? Or that is not the correct way to consume the web services in java world?
    5. In .net - as long as i have the .net framework sdk, and a IIS - i am good to go. In java - what do i need in order to deploy a web services?? I already have tomcat / jdk / wsdp / IDE - do i have enough to create a simple ws? if so, can you show me a basic tutorial??
    based on some reading, i understand that the ws on the service side, needs an SEI implementing java.rmi.remote, and we need another class implementing this SEI. But I would really want to see more example, or downloads, where i can just download / view the whole thing all at once... I googled "java web service", "jax-rpc example"..etc.. most of the return links are from either java.sun.com, or ibm, or some other vendor's web site, explaining the architecture... I really want to look at the code, to get a better understand, what is the relationship between each of these softwares (tomcat, apache http server, axis...)
    Any suggestions??
    Thanks,
    T

    I think I can answer your Q1
    Apache is very good at serving simple HTML pages
    Tomcat is capable of serving active content
    So the two complement each other
    Or that's how I understand it.
    Steaker

  • Newbie question on JAVA networking

    Hi,
    I'm newbie on JAVA networking. Can anyone guide me to do a task to :
    read the TCP/IP packets which are sent from a specific host to another host? I need to capture the packets and analyse the contents.
    thanks in advance,
    jackling

    Well I've search google for a low level TCP api, but I came up with absolutely no results. So I guess the only way would be to write your own native API (using C/C++) and call this through the Java Native Interface.

  • Newbie question on Java Persistence API - Entity Beans

    Hi All,
    I am basically new to Entities and the Java Persistence API. My question is, when using a container managed EntityManager, do I have to manually tidy-up any resources? Say for example, do I have to explicitly close the database connection (if ever I have that ability)? Invoke close() on EntityManager?
    - Pat

    You don't have to. That's what they mean by container managed. The container does it for you.
    In fact you will get an IllegalStateException if you call close on a container-managed EntityManager.

  • Newbie question about Java Studio Creator 2.

    HI all,
    I'm new to JSF and JSC.
    Below are some question which I hope those who has been working on JSF especially those that use JSC to provide me some advice.
    1. Can JSF application developed using JSC be changed or modified using other IDE in the market? Reason being I saw JSC include the position using style in the page. So, I wonder if I use JSC for JSF, will it contraint the future development or not, cos i don't want to be bound by one tool forever.
    2. Is the JSF component (eg. com.sun.rave.web...) provided by SUN are open source?
    3. What is the roadmap for JSC2? Will they continue its development?
    4. JSC2 is free, how about JSC3? Any idea whether it will be free?
    5. Do you think using JSC2 alone is not enough? where to build EJB or web services, we still need to use other tools like NetBeans? What do you use in combination with JSC2? Would like to know your experience.
    6. Can application developed using JSC be deployed to JBOSS?
    7. JSC uses JSF components from SUN (com.sun.rave.web...). So, when we deploy JSF application developed using JSC to tomcat or JBOss, do we need to purchase any license?
    8. I find JSC2 is quite resource hungry, sometimes thing reflect quite slowly. What is your experience using JSC2?
    Thank you.

    Can anyone advise me on my question?
    Thank you.

  • Newbie question concerning java chat

    Hi everyone,
    I'm going to program at chat-service in java at school. Since I'm still rather new at this game, I was wondering if anyone knew any good tutorials to start with. I'm also very interested in recommendations as to which java techniques would be best.
    My initial thoughts on the project are:
    1) it's going to be controlled by a central server (using servlets and JSP).
    2) I wish to overcome problems concerning firewalls etc.
    3) I took a peek in the book "Java Servlet Programming". It said that there were 3 possible implementations: HTTP, Sockets and RMI. I wonder if there are any other possibilities? JMS for instance?
    4) I wish to implement the service in such a way, that different users can approach the service differently (eg. user A with HTTP, and user B with RMI). this should be completely transparent. But is that possible?
    Well, thats basically all. I hope someone have some tips or experiences to share. I doubt that I'm the first (or the last) one embarking on a project like this.

    I've found some links in previous posts.
    http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat_p.html
    And the section on "Java Shared Data Toolkit"

  • NEWBIE question about java

    Why is the java compiler making two .class files for my swing applet?
    input > applet1.java
    output> applet1.class , applet1$1.class
    This is annoyin because it appears the applet1.class needs applet1$1.class
    to run. Unfortunately, my webserver (FreeBSD) doesn't support $ characters in filenames,
    converting the second file to applet1_1.class

    Yes, I do have an anonymous listener...
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    public class applet1 extends JApplet
        JLabel label1 = new JLabel("Please enter street address of organization here");
        JLabel label2 = new JLabel("Enter unique ID here");
        JTextField textbox1 = new JTextField();
        JTextField textbox2 = new JTextField();
        JButton button1 = new JButton("Submit");
       public void init(){
          Container c1 = getContentPane(); 
          GridBagLayout gridbag = new GridBagLayout();
          GridBagConstraints constraints = new GridBagConstraints();
          c1.setLayout(gridbag);
          constraints.weighty = 1;
          constraints.fill = GridBagConstraints.NONE;
          constraints.weightx = 1;
          constraints.anchor = GridBagConstraints.WEST;
          gridbag.setConstraints(label1,constraints);
          c1.add(label1);
           constraints.fill = GridBagConstraints.HORIZONTAL;
           constraints.gridwidth = GridBagConstraints.REMAINDER;
           gridbag.setConstraints(textbox1,constraints);
           c1.add(textbox1);
            constraints.weightx = 1;
                       constraints.gridwidth = GridBagConstraints.WEST;
            gridbag.setConstraints(label2,constraints);
            c1.add(label2);
           constraints.weightx = 1;
                     constraints.gridwidth = GridBagConstraints.REMAINDER;
           gridbag.setConstraints(textbox2,constraints);
           c1.add(textbox2);
           constraints.fill = GridBagConstraints.NONE;
           constraints.gridwidth = GridBagConstraints.REMAINDER;
           constraints.anchor = GridBagConstraints.CENTER;
                      gridbag.setConstraints(button1,constraints);
           c1.add(button1);
    button1.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent event)
            int i=0;
            int f=0;
            Date myDate = new Date();
            int day = myDate.getDate();
            int month = myDate.getMonth() + 1;
            int code = Integer.parseInt(textbox2.getText());
            boolean matchFound=false;
            String h = (new String(textbox1.getText()).substring(0,10));
            String str;
            //search database
            try{
                URL url = new URL(getCodeBase(), "address.txt");
                InputStream inStream = url.openStream();
                BufferedReader br = new BufferedReader(new InputStreamReader(inStream));
                StringBuffer l = new StringBuffer(10);
                StringBuffer r = new StringBuffer(20);
                while((str = br.readLine())!=null){
                r.append(str);
                //take out spaces
                for (i=1;i<r.length();i=i+2)
                    l.append(r.charAt(i));
                if (h.equalsIgnoreCase(l.toString().substring(0,10))){
                       //we have a match
                       matchFound =  true;
                //clear buffers for next record
                r.setLength(0);
                l.setLength(0);
                br.close();        
                inStream.close();
                if (matchFound==true)
                    //if match found, perform date conversion
                    day = (code/month)/day;
                    textbox2.hide();
                  textbox1.hide();
                  button1.hide();     
                   label1.setText("Confirmed! Use this number to unlock: ");
                    label2.setText(String.valueOf(day));
                else
                textbox1.setText("Address not found");
            catch (Exception e)
                textbox1.setText("Data file missing");
    }

  • Domain Name settings in Solaris - Newbie question

    Sorry for a newbie question!
    I am already pointing a domain name to web hosting for email account. Now, I need an application server to run ERP software and Oracle, and installing Solaris and Oracle need a domain name.
    If I point my domain name to the server, how do I receive emails from web hosting???
    Install an email server to the application server instead? What can I do if I want the same domain name?

    Your questions are completely off-topic for the forum.
    These SunOS forums are for questions on <i>"how do I install my OS"</i>
    You particular question is in the <i>"how can I install Solaris while using the CD drive"</i> forum.
    So, if you had a question on how to edit the /etc/inet/hosts file to establish a FQDN on the computer, then it might be appropriate for the forum.
    Unfortunately, I don't have a clue on where to redirect you, except perhaps to the Sun Java Enterprise System suite of applications?

  • Multiple version of JRE in company..How to manage? (newbie question)

    Greetings..this is a newbie question
    We have 48 versions of JRE running in on XP IE6 in our company.
    Some version beat up other JAVA applications.
    It's a mess.
    How can anyone manage this many versions?
    Can we consolidate down to a few versions?
    I saw some posts on changing the JRE dynamically or perhaps using a wrapper with a product from "sourceforge".
    Are these viable?
    Thanks in advance

    We have 48 versions of JRE running in on XP IE6 in
    our company.
    Some version beat up other JAVA applications.
    It's a mess.can you elaborate on how some versions "beat up" other apps?
    How can anyone manage this many versions?you don't, each computer should periodically upgrade (IMO) but you shouldn't care. if you do, tell your users to load the latest version
    Can we consolidate down to a few versions?sure
    I saw some posts on changing the JRE dynamically or
    perhaps using a wrapper with a product from
    "sourceforge".
    Are these viable?i have no idea what this is, but I have doubts about your problem, if it exists at all

  • Variable accessibility: newbie question

    My next newbie question:
    The following two classes are in two separate files in the same a folder testClass2:
    package JavaDemos.testClass2;
    import java.awt.*;
    public class Sketcher {
        static SketchFrame window;
        static int widthXXX;
        public static int getwidthXXX() {
            return widthXXX;
        public static void main(String[] args) {
            window = new SketchFrame("Sketcher");
            widthXXX=1000;
            System.out.println("output: width = " + widthXXX);
            window.setVisible(true);
            window.specialReport();
    package JavaDemos.testClass2;
    import javax.swing.*;
    public class SketchFrame extends JFrame {
        public SketchFrame(String title) {
            setTitle(title);
            setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        public void specialReport(){
            System.out.println("number " + widthXXX);
            //     System.out.println("number " + Sketcher.getwidthXXX());
    }They don't compile.
    I get the following error message:
    JavaDemos/testClass2/SketchFrame.java [23:1] cannot resolve symbol
    symbol : variable widthXXX
    location: class JavaDemos.testClass2.SketchFrame
    System.out.println("number " + widthXXX);
    ^
    1 error
    Why isn't widthXXX directly accessible from SketchFrame?
    Thank you again in advance for any help.

    Why isn't widthXXX directly accessible from
    SketchFrame?Because it's a class variable of another class. You have to refer to it as Sketcher.widthXXX.

  • EJB Newbie Question

    I am totally new to EJB and I have gone through Sun's tutorial at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/GettingStarted.html and I've got everything in the tutorial working with the Sun J2EE server installed on my computer. They teach you how to write a bean and call it from a client application and from a .JSP page using the web server installed with J2EE on port 8080. Now, I want to call it from my ColdFusionMX page using the CFMX web server and I can't figure it out. Can anybody help me? I'm not sure what I need to do in CFMX to get the Java bean to work. I realize this is also a question for the ColdFusion community, but I'm sure connecting from ColdFusion is not very much different than from other languages.
    I created a very watered down ColdFusion version of the JSP page provided by Sun in the EJB tutorial. However, it looks like the JNDI lookup is not working for some reason. I think the problem is that I need to specify that the lookup will occur on my JNDI port, which is 10500 on my local host. It looks like it is trying to use a ColdFusion JNDI service that does not have the EJB installed or something like that. I would appreciate some code samples of how to get this to work. I can't find any good sites that give you a walk through of how this is supposed to work.
    Keep in mind this does work when I call the .JSP version of this page through the J2EE web server. The trick is for me to get this working in ColdFusion.
    Thanks everybody!
    Jon
    test.cfm
    <%@page import =
    "java.math.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.rmi.RemoteEx
    ception,Converter,ConverterHome" %>
    <html>
    <head>
    <title>Converter</title>
    </head>
    <body bgcolor="white">
    <cfscript>
    initialContext = createObject("java", "javax.naming.InitialContext");
    ejbHome = initialContext.lookup("java:comp/env/ejb/TheConverter");
    </cfscript>
    I hope this page doesn't throw an error.
    </body>
    </html>
    page output
    Error Occurred While Processing Request
    No such binding: ejb
    The Error Occurred in C:\CFusionMX\wwwroot\test.cfm: line 51
    49 : initialContext = createObject("java", "javax.naming.InitialContext");
    50 :
    51 : ejbHome = initialContext.lookup("java:comp/env/ejb/TheConverter");

    It looks like it is
    trying to use a ColdFusion JNDI service that does not
    have the EJB installed or something like that. maybe... I am not familiar with CF.
    I would
    appreciate some code samples of how to get this to
    work. Install trial version of JRun 4.0, it has code samples how to call EJB from CF script.
    good luck
    Maris

  • Total Newbie Question ... Sorry :-(

    I know it's a windows thing, and I am now converted to Mac but I gotta know this because it's doing my head in. It's a complete stupid green gilled newbie question.
    When installing new programs on a Mac can you create shortcuts to the programs on the Dock? I did what I THOUGHT it would be, i.e I made an Alias and stuck it in the dock, but on rebooting my Mac later on, in place of the shortcuts where 3 question marks which when clicked on did absolutely nothing???
    Help?
    A.L.I
    Windows XP Pro Desktop, Macbook Pro, 60GB iPod Video   Mac OS X (10.4.5)   OS X

    You aren't installing something from a dmg file are you? The dmg is a disk image – kind of a virtual CD. So when you double click the dmg and then get the little disk/hardrive/custom icon on your desktop that is the same as if you had mounted a CD. You then need to drag the application off of that "CD" into your application folder. Then it is truly installed.
    You can then "eject" the icon your your desktop. This is what happens when you shutdown and without remounting the image your dock shortcut can't find the original.
    Just a thought.

  • Newbie Question. just installed IE7.. how do I set up a local host to preview sites?

    Sorry for the newbie question... but it's been a long time since I have done this
    Thanks!

    Just define your site in DW as always.  For a static site, that's all you need to do.

  • Newbie Question about FM 8 and Acrobat Pro 9

    Hello:
    I have some dcouments that I've written in FM v8.0p277. I print them to PDF so that I can have a copy to include on a CD and I also print some hard copies.
    My newbie question is whether there is a way to create a  PDF for hard copy where I mainitain the colors in photos and figures but that the text that is hyperlinked doesn't appear as blue. I want to keep the links live within the soft copy. Is there something I can change within Frame or with Acrobat?
    TIA,
    Kimberly

    Kimberly,
    How comes the text is blue in the first place? I guess the cross-reference formats use some character format which makes them blue? There are many options:
    Temporarily change the color definition for the color used in the cross-reference format to black.
    Temporarily change the character format to not use that color.
    Temporarily change the cross-reference definition to not used that character format.
    Whichever method you choose, I would create a separate document with the changed format setting and import those format into your book, create the PDF and then import the same format from the official template.
    - Michael

  • Domain name settings - Newbie question

    Sorry for a newbie question!
    I am already pointing a domain name to web hosting for email account. Now, I need an application server to run ERP software and Oracle, and installing Solaris and Oracle need a domain name.
    If I point my domain name to the server, how do I receive emails from web hosting???
    Install an email server to the application server instead? What can I do if I want the same domain name? Any option?

    Setting up a mailserver and making sure it doesn't suddenly turn into a spambox is not something you do with the use of a few commands. I suggest to dive into the Solaris admin guide on docs.sun.com and read up on e-mail and network services.
    If that is asking too much of your time you'll be better off getting your ISP to handle all this for you.

Maybe you are looking for

  • BAPI_PO_GETDETAIL

    Hello All, I want to use the above BAPI to retrive purchase order details remotely. PO details available in the  logistic system X . My client requirement is that want to store this information in system Y(this is also SAP system). But my question is

  • MacBook Pro and WLAN beamer

    Hi everybody, I am planning to buy a new beamer, for example the Panasonic PT-LB55NTE. It offers the possibility to hook up to WLAN. The VGA-cable would therefore be unnecessary. Would be a big improvement to have fewer cables and their limitations.

  • Need help in solving java.io.NotSerializableException

    Hi, Weblogic 9.2 I need help in solving the java.io.NotSerializableException: weblogic.jndi.internal.ApplicationNamingNode I dont know why ApplicationNamingNode has to be serialized. Full stack trace will be provided if needed. thank you

  • How to maintain order of execution of the Queries in Data Model

    Hi, I have 5 queries in the Data Model Query_1 will fetch some values based on the selection criteria and inserts values in a table(say Table_1) using a formula column The other queries will fetch data from DB using the records in Table_1 The problem

  • Audit Vault & Apex - ANONYMOUS user recorded rather than Apex end user

    Hi, We have Audit Vault 10.2.3 & Apex 3.2 Audit Vault stores the name of the database user when a table is updated through SQL*Plus etc as expected. Problem is through Apex and insert to db table using simple form on table the user ANONYMOUS is recor