Mystery Problem in Code...Please Help...

Ok, here's the situation. I am a photographer, and have been writing code for some time now. I decided to write a java application that would write individual web pages for each jpeg present in two directories, bnw and color, making the job of writing as many as 300 virtually identical pages a lot less annoying. Unfortunately, this is even more so.
The code is clean in nice, and it compiles without a hitch. When I run the application (w/ jdk 1.4.0) on Windows 98, it comes up with an invalid path error when it tries to create the first of these web pages, but after it writes the list of all the images it sees. (This list is created successfully.) I went back and double checked that there weren't any filenames that Windows would gripe about, and an error was found. I corrected the error, and now everything is kosher, but yet the same error still occurs. I've several different methods of doing the same thing, and every time, the same error occurs at the same spot. I have included the source code below. Please, any help would be appreciated!
import java.io.*;
import java.util.*;
public class listDir {
     public static final String DEBUG = true;
     static {
          if (DEBUG)
               System.err.println("----------- < DEBUGGING IS ON > -------------");
        public static void main(String[] args) {
          // DEBUG STATEMENT
          System.err.print("DEBUG: Declaring final Strings... ");
                final String path1 = "E:\\Liam Conrad - Photographer\\800x600\\images\\html\\bnw";
                final String path2 = "E:\\Liam Conrad - Photographer\\800x600\\images\\html\\color";
          final String line1 = "<html>\r\n<head>\r\n<title></title>\r\n<link href=\"../../master.css\" rel=\"stylesheet\">\r\n</head>\r\n";
          final String line2 = "<body>\r\n<table width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n<tr>\r\n";
          final String line3 = "<td align=\"center\" valign=\"top\" colspan=\"1\" width=\"100%\">\r\n<p><img src=\"";
          final String line4 = "\" border=\"1\" width=\"432\" height=\"288\" alt=\"\"></p></td></tr></table></body></html>\r\n\r\n\r\n";
          // DEBUG STATEMENT (2)
          System.err.println("[ DONE ]");
          System.err.print("DEBUG: Declaring variables... ");
          String temps1;
          String temps2;
                RandomAccessFile raf;
                RandomAccessFile mfo;
                File d1;
                File d2;
                String[] list1;
                String[] list2;
                String[] list3;
                Vector svect = new Vector();
          // DEBUG STATEMENT (2)
          System.err.println("[ DONE ]");
          System.err.println("DEBUG: Beginning try statement.");
                try {
                        d1 = new File(path1);
                        d2 = new File(path2);
                        raf = new RandomAccessFile("dirlist.txt", "rw");
                        list1 = d1.list();
                        list2 = d2.list();
                        for (int i = 0; i < list1.length; i++) {
                                if (list1.endsWith(".jpg")) {
svect.add("bnw_" + list1[i]);
} else {
for (int i = 0; i < list2.length; i++) {
if (list2[i].endsWith(".jpg")) {
svect.add("color_" + list2[i]);
} else {
for (int i = 0; i < svect.size(); i++) {
raf.writeBytes((i+1) + ":\t" + svect.get(i) + "\r\n");
raf.close();
               for (int i = 0; i < svect.size(); i++) {
                    temps1 = svect.get(i) + "\b\b\bhtml";
                    temps2 = temps1;
                    System.out.println(temps2);
                    mfo = new RandomAccessFile(temps2, "rw"); // <--- Here is where the error is occuring every time.
                    mfo.writeBytes(line1);
                    mfo.writeBytes(line2);
                    mfo.writeBytes(line3);
                    mfo.writeBytes((String)svect.get(i));
                    mfo.writeBytes(line4);
                    mfo.close();
} catch (Exception e) {
e.printStackTrace();
               System.err.println((char)7 + "\n");

Hi buddy
First of all, there is no mystery in this program. Everything is pretty clear...
OK, Instead of pointing out the mistakes you have done, I thought why not may be I cam modify the program and then give u the code. Go thru the code and you will understand the mistakes you have done. You have to make a few changes to make this applicable to you. Firstly, change the directory names, secondly, change the GIFs to JPGs, thirdly, add the table formatting that you were looking for(i removed the formatting for simplicity)... and things like that.
Lot of things to say about : Since you are creating a html file in the current directory and in that html file, you are refering to the images in two other directories, you wont be able to see the images unless you move the files to the current working directory. And you cannot move a file from one directory to another using Java IO(Only way is you can create exact replicas of the files in other directories). Or, One way to get around with this problem is : Use full path of the file instead of just the name of the GIF(or jpeg or whatever) file. That is what I have done in the following program.
Cheers
-Uday
import java.io.*;
import java.util.*;
public class Picture {
     public static final boolean DEBUG = true;
     static {
          if (DEBUG)
               System.err.println("----------- < DEBUGGING IS ON > -------------");
public static void main(String[] args) {
          // DEBUG STATEMENT
          System.err.print("DEBUG: Declaring final Strings... ");
final String path1 = "C:\\uday\\PIC\\one";
final String path2 = "C:\\uday\\PIC\\two";
          final String line1 = "<html>\r\n<head>\r\n<title></title>\r\n</head>\r\n";
          final String line2 = "<body>\r\n<table>\r\n<tr>\r\n";
          final String line3 = "<td align=\"center\" valign=\"top\">\r\n<p><img src=\"";
          final String line4 = "\" alt=\"\"></p></td></tr></table></body></html>\r\n\r\n\r\n";
          // DEBUG STATEMENT (2)
          System.err.println("[ DONE ]");
          System.err.print("DEBUG: Declaring variables... ");
          String temps1;
          String temps2;
RandomAccessFile raf;
RandomAccessFile mfo;
File d1;
File d2;
String[] list1;
String[] list2;
String[] list3;
Vector svect = new Vector();
          Vector nvect = new Vector();
          // DEBUG STATEMENT (2)
          System.err.println("[ DONE ]");
          System.err.println("DEBUG: Beginning try statement.");
try {
d1 = new File(path1);
d2 = new File(path2);
raf = new RandomAccessFile("dirlist.txt", "rw");
list1 = d1.list();
list2 = d2.list();
for (int i = 0; i < list1.length; i++) {
if (list1.endsWith(".gif")) {
                         nvect.add(path1+"\\"+list1[i]);
                         String temp1 = "one_"+list1[i].substring(0,list1[i].lastIndexOf(".gif"));
svect.add(temp1);
} else {
for (int i = 0; i < list2.length; i++) {
if (list2[i].endsWith(".gif")) {
                         nvect.add(path2+"\\"+list2[i]);
                         String temp2 = "two_"+list2[i].substring(0,list2[i].lastIndexOf(".gif"));
svect.add(temp2);
} else {
for (int i = 0; i < svect.size(); i++) {
raf.writeBytes((i+1) + ":\t" + svect.get(i) + "\r\n");
raf.close();
               for (int i = 0; i < svect.size(); i++) {
                    temps1 = svect.get(i) + ".html";
                    temps2 = temps1;
                    System.out.println(temps2);
                    mfo = new RandomAccessFile(temps2, "rw"); // <--- Here is where the error is
occuring every time.
                    mfo.writeBytes(line1);
                    mfo.writeBytes(line2);
                    mfo.writeBytes(line3);
                    mfo.writeBytes((String)nvect.get(i));
                    mfo.writeBytes(line4);
                    mfo.close();
} catch (Exception e) {
e.printStackTrace();
               System.err.println((char)7 + "\n");

Similar Messages

  • Problem with code-Please Help!!!

    Hey guys i have some problems with the following code:
    1. I have to do a stutter and reverse of an array [ 2 4 ] and it should return [ 4 4 2 2 ]. I wrote the code and i get [ 2 2 4 4]. How can this be fixed?
    public class Part1
         public static void main(String[] args)
              int[] values = {2, 4};     
              stutterAndReverse(values);
         public static int[] stutterAndReverse(int[] values)
              //Stutter
              System.out.print("[ ");
              for (int i = 0; i < values.length; i++)
                   for(int j = values.length-1; j >=0; j--)
                        System.out.print(values[i] + " ");
              System.out.print("] ");
              return values;
    2. This one takes the array and returns the even numbers to the left and odds to the right. It works with the code i have so far but the odds on the right should be in order. For example an array of 6 gives the output [2, 4, 6, 5, 3, 1]. Mine gives [2, 4, 6, 1, 5, 3]. How can i fix this???
    public class Part2
         public static void main(String[] args)
              int[] arr = new int[6];
              for(int i = 0; i < arr.length; i++)
              arr[i] = i + 1 ;
              printArray(arr);
              arr = evensToLeft(arr);
              //arr = oddsToRight(arr);
              System.out.println("Evens to the Left");
              printArray(arr);               
         public static void printArray(int[] arr)
              System.out.print("[");
              for(int i = 0; i < arr.length; i++)
                   System.out.print(arr);
                   if(i < arr.length-1)
                   System.out.print(", ");
                   System.out.println("]");
         public static int[] makeArray(int n)
              int[] arr = new int[6];
              return arr;          
         public static int[] evensToLeft(int[] arr)
              int split = 0;
              for(int i = 0; i < arr.length; i++)
                   if(arr[i]%2==0) //even
                        swap(arr,i,split);
                        split++;
                   return arr;
         public static void swap(int[] arr, int n1, int n2)
              int temp = arr[n1];
              arr[n1] = arr[n2];
              arr[n2] = temp;
    Thank you for your time i really appreciate it.

    now i'm more confused than ever...:(This'll probably make it worse :)
    class Testing
      public Testing()
        String[] values1 = {"2","4"};
        System.out.println(java.util.Arrays.asList(values1));
        System.out.println(java.util.Arrays.asList(stutterAndReverse(values1)));
        String[] values2 = {"1","2","3","4","5","6","7","9","11"};
        System.out.println(java.util.Arrays.asList(values2));
        System.out.println(java.util.Arrays.asList(evensOdds(values2)));
      public String[] stutterAndReverse(String[] arr)
        String[] temp = new String[arr.length * 2];
        for(int x = 0; x < temp.length; x++)
          temp[temp.length - 1 -x] = arr[x/2];
        return temp;
      public String[] evensOdds(String[] arr)
        StringBuffer evens = new StringBuffer();
        StringBuffer odds = new StringBuffer();
        for(int x = 0; x < arr.length; x++)
          if(Integer.parseInt(arr[x]) % 2 == 0) evens.append(","+arr[x]);
          else odds.insert(0,","+arr[x]);
        return (evens.toString().substring(1)+odds.toString()).split(",");
      public static void main(String[] args){new Testing();}
    }

  • I have a compilation problem with my mini iPod that is preventing my volume from increasing. I can't get the compilation code, please help me

    MY mini iPod version number1.1.3 pc robs iPod ,4GB is having volume limit problem ,the volume is very low compare to how it was playing before I mistakenly touch the combination code. I have forgotten the combination code, please help me out.. I have tried to reset settings but it wouldn't work.

    i can get the combination code please

  • I am not able to launch FF everytime i tr to open it, it says FF has to submit a crash report, i even tried doing that and the report was submitted too, but stiil FF did not start, and the problem still persists, please help me solve this issue in English

    Question
    I am not able to launch FF everytime i try to open it, it says FF has to submit a crash report,and restore yr tabs. I even tried doing that and the report was submitted too, but still FF did not start, and the problem still persists, please help me solve this issue
    '''(in English)'''

    Hi Danny,
    Per my understanding that you can't get the expect result by using the expression "=Count(Fields!TICKET_STATUS.Value=4) " to count the the TICKET_STATUS which value is 4, the result will returns the count of all the TICKET_STATUS values(206)
    but not 180, right?
    I have tested on my local environment and can reproduce the issue, the issue caused by you are using the count() function in the incorrect way, please modify the expression as below and have a test:
    =COUNT(IIF(Fields!TICKET_STATUS.Value=4 ,1,Nothing))
    or
    =SUM(IIF(Fields!TICKET_STATUS=4,1,0))
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • HT201263 my ipad give me the apple sign without running up it appears all the time in the screen , i tries to reset my ipad , but still in this problem , can you please help me?

    my ipad give me the apple sign without running up it appears all the time in the screen , i tries to reset my ipad , but still in this problem , can you please help me?

    You may want to look at this about using recovery mode to restore your iPad.
    http://support.apple.com/kb/ht4097

  • It won't let me drag an effect from the browser all of a sudden. I have always been able to do before. I am using effects from favorites bin and when I try to drag it, it won't move. I have never had this problem before. Please help.

    It won't let me drag an effect from the browser all of a sudden. I have always been able to do before. I am using effects from favorites bin and when I try to drag it to the timeline, it won't move. I have never had this problem before. Please help.
    P.S. I have tried other effects including transitions and it still won't let me drag.

    Wow that was really quick, thank you so much.  Im not sure at all which version it was because i said it was around 4 years ago he bought it.  I know it isn't under his username, since he's a PC person (ugh) so i know its probably registered to one of our actual names.  isn't there some way to look it up since we did register it, because I'm not even sure where the disks are from when we bought it (we've moved a lot and also have two storage lockers, i know i would have kept it with other disks) but my cd rom drive is actually broken on my computer as well ( i think it got stepped on and is now squished and won't eject or run disks.)
    So is there anyway they can look up that its registered to one of our names since we did register it when we bought and installed it, or do i really have to find the disk with some sort of proof of purchase (i know there would be no receipt after all this time)
    either way, ill do what you suggested to the best of my abilities and thank you so much for answering my questions, i can't even open the program as its incompatible and find out the info from that) so I'm in a bit of a pickle and your response was so thorough and it didn't seem to be posted long enough to even write a well researched response, thanks, all the best,
    sarucia

  • My macbook is blocked by pin code, please help, I dont know what to do!

    My macbook is blocked by pin code, please help, I dont know what to do!

    When you enter iTunes on the PC and the iPod icon pops up, right click on it and select "Options". Then click on the Music tab. Once you're in the Music tab check the box that says "Enable Disc Use". This means that you've just turned your iPod into a portable hard drive. Click "Ok" and move your iPod from the PC to the Mac. From there, your iPod should show up on the Mac's desktop right under the Hard Drive icon. Click "File" at the top of the screen and select "Add to Library". Find the iPod hard drive in the selection screen and choose the music folder that's on it. Then just click Ok and all your music will be downloaded. That should do the trick, but you might want to do a Google search on the subject to get a second opinion. Best wishes!

  • Mac Book Air sleeps when moved...i don't know whats the problem...please help me out if anyone knows about this...

    Mac Book Air sleeps when moved...i don't know whats the problem...please help me out if anyone knows about this...

    your reed switch for the monitor is defective, it thinks youve shut the lid when you havent
    mechanical fault , contact Apple for service and parts replacement.

  • I want to ask how to downgrade ios 7 to 6.1.3, because a lot of problems ios 7. please help

    I want to ask how to downgrade ios 6.1.3 to 7, because a lot of problems ios 7. please help

    I'm sorry, but Apple does not provide a downgrade path for iOS. Because downgrading is unsupported by Apple we cannot discuss it on these forums.

  • HT201304 ello my little brother has developed lock my iPhone and I could not see the unlocking code Please help and thank you

    Hello
    ello my little brother has developed lock my iPhone and I could not see the unlocking code Please help and thank you
    edited by host

    Hi Omar_a983,
    If you are having an issue with the passcode on your iPhone, you may find the following article helpful:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    Regards,
    - Brenden

  • I can't find my redemption code, please help!

    I can't find my redemption code, please help!

    You have purchased Creative Cloud Photography plan on Sept. 26, 2014.
    If the CC is asking for serial number then please follow the steps in http://helpx.adobe.com/creative-cloud/kb/ccm-prompt-serial-number.html
    To download the CC purchased you need to install &activate it. Please refer to
    http://helpx.adobe.com/creative-cloud/help/install-apps.html
    Download and Installation Help
    Hope it resolves your issue.
    Regards
    Rajshree

  • Error getting license. License server communication problem: E_ADEPT_NO_TOKEN. Please help

    I try to download my ebooks on my laptop but receive the onscreen message, Error getting license, License server commucication problem: E_ADEPT_NO_TOKEN. Please help?

    It means, the URLLink.ACSM file is corrupted. Please contact the book store and ask them to check whether the configuration in the server side is correct for that book.
    One of the simple setting in the server which can case this issue is, setting the book for loan in server and providing the purchase option in the book store or vise verse.
    Hope this solves your problem.

  • HT1386 i tried to sync my ipad to my itunes using usb but it will say not charging,, i can sync with my ipod touch without any problem... please help..

    i tried to sync my ipad to my itunes using usb but it will say not charging,, i can sync with my ipod touch without any problem... please help..

    From http://support.apple.com/kb/HT4060 :
    The fastest way to charge your iPad is with the included 10W USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter. When attached to a computer via a standard USB port (most PCs or older Mac computers) iPad will charge, but only when it's in sleep mode.
    iPods need less power to charge them (their wall charger is half the power of the iPad's, 5W as opposed to 10W), so are more likely to charge via USB

  • Problem with simple piece of code - please help

    For some reason the following code will not compile - im being told i need a return - however i cant see where or why?
    Please help
    Thanks
    * Author: hc01pl
    * Created: 16 April 2002 14:45:48
    * Modified: 16 April 2002 14:45:48
    //package csci1003testprograms.Gui;
    public class Task2
         // students id number
         private int id;
         // students name
         private String name;
         // students mark 1
         private int mark1;
         // students mark 2
         private int mark2;
         // constucts a student with given id, name and two module marks
         public void StudentMarks(int aID, String aName, int aMark1, int aMark2)
              id = aID;
              name = aName;
              mark1 = aMark1;
              mark2 = aMark2;
         // returns student id
         public int getID()
              return id;
         //returns student name
         public String getName()
              return name;
         //returns student's first mark
         public int getMark1()
              return mark1;
         //returns student's first mark
         public int getMark2()
              return mark2;
         //sets the first mark of a student
         public void setMark1(int aMark1)
              mark1 = aMark1;
         //sets the second mark of a student
         public void setMark2(int aMark2)
              mark2 = aMark2;
         //returns the grade of a student
         public String getGrade()
              int mark = mark1 + mark2;
              if (mark<30)
                   System.out.println("F");
              else
                   if (mark>=30&& mark<40)
                        System.out.println("U");
                   else
                        if (mark>=40&& mark<50)
                             System.out.println("D");
                        else
                             if (mark>=50&& mark<60)
                                  System.out.println("C");
                             else
                                  if (mark>=60&& mark<70)
                                       System.out.println("B");
                                  else
                                       if (mark>=70&& mark<80)
                                            System.out.println("A");
                                       else
                                            if (mark>=80)
                                                 System.out.println("A*");

    The answer is given by asantoas. You need a return statement. Because your method
    public String getGrade(), has a return type String , so the method expects to return a String datatype.
    If you don't want to return any thing. Then declare the method as public void getGrade()
    Regards
    Deepa Datar

  • SAPscript Output Problem - Very Urgent - Please help

    Hi,
    I am having the following problem with SAPscript.
    In the Main Window, I have instructions to the printer in the ZPL2 language (For Zebra Printer).
    There are also several variables, which are highlighted in Gray and enclosed in the’&’.
    There are also several elements – all of them empty except for the one where this code is.
    Now, I received this program to modify in terms of code and the output.
    IF you have never done any work with Zebra Printing, the way it is done is that you create a label using the Zebra BarOne or Zebra Designer program, then output it to an ‘itf’ file, upload it into a standard text as .itf and copy the uploaded contents to the main window. When printing to a Zebra printer, the Zebra printer will read the instructions and will print the output.
    Here is the problem: The config for the output type is correct.
    When doing a printing test from SAPscript, I get the right output and the Zebra printer is able to print it.
    However, the real process for this task will go through MB02. There, if I create a spool request using the proper method (select output type and etc.), it will go the spool. However, if I print preview or output (doesn’t work with the Zebra printer, so I have to output to the Laser printer), it will output the following (none of the following includes any of the ZPL2 code/instructions. Instead, it seams to print the variables contents with the field name next to it – This isn’t whats it’s the Main window!!!)
    http://img244.imageshack.us/img244/6915/66052475zk2.jpg
    Please help. I have debugged but don’t know what to do and can’t find anything wrong.
    This is very urgent. Any help will be useful.
    Thanks,
    John

    Ok, maybe I have confused others in regards to the issue as well.
    We expect this label to be output from a Zebra Printer.
    When output through Sapscripts printing test, the preview from the spool shows the ZPL2 code in small font (non readible if a created a screenshot) and if sent to the Zebra Printer, it prints the label correctly.
    When output through MB02, the preview from the spool shows the code that I have attached to the 1st post in this thread. If I try to output to the Zebra Printer, nothing happens because the ZPL2 instructions are not even in the preview and therefore, the Zebra printer recieves no instructions. I should not have mentioned the laser printer, because it has nothing to do with this issue.
    I hope that this makes the issue a little more clear and understandable. Please help.
    Here is the ZPL2 coding before uploading to standard text (only difference is that once uploaded,  the '/' characters are removed.) However, I believe that the problem may lie in the print program and how it compiles but I debugged and haven't really seen where it comes from:
    /:NEW-PAGE
    / ^XA
    / DFNEW-RE-1FS
    / ^PRC
    / LH0,0FS
    / ^LL1830
    / ^MD0
    / ^MNY
    / LH0,0FS
    / FO244,854A0N,55,46CI13FRFB154,1,0,LFN999^FS
    / FO819,698A0N,55,46CI13FRFN998FS
    / FO245,477A0N,55,46CI13FRFB755,1,0,RFN997^FS
    / FO389,926A0N,55,46CI13FRFB654,1,0,RFN996^FS
    / BY3,3.0FO42,1072B3N,N,152,N,YFRFN995FS
    / FO276,1258A0N,55,46CI13FRFN995FS
    / FO484,774A0N,55,46CI13FRFN994FS
    / FO817,774A0N,55,46CI13FRFN993FS
    / FO611,556A0N,55,46CI13FRFN992FS
    / FO245,556A0N,55,46CI13FRFN991FS
    / FO397,117A0N,55,46CI13FRFN990FS
    / FO245,405A0N,55,46CI13FRFB880,1,0,RFN989^FS
    / FO244,698A0N,55,46CI13FRFN988FS
    / FO629,998A0N,55,46CI13FRFN987FS
    / FO244,623A0N,52,42CI13FRFN986FS
    / FO397,261A0N,55,46CI13FRFB404,1,0,RFN985^FS
    / FO819,854A0N,55,46CI13FRFN984FS
    / FO725,554A0N,55,46CI13FRFN983FS
    / FO397,189A0N,55,42CI13FRFB695,1,0,RFN982^FS
    / FO397,333A0N,55,42CI13FRFN981FS
    / FO638,333A0N,55,42CI13FRFN980FS
    / FO391,21A0N,63,63CI13FRFB433,1,0,CFN979^FS
    / FO36,698A0N,55,46CI13FR
    / FDWBS:FS
    / FO37,405A0N,55,46CI13FR
    / FDMATL:FS
    / FO37,478A0N,62,44CI13FR
    / FDDESC:FS
    / FO554,698A0N,55,46CI13FR
    / FDSUPPLIER:FS
    / FO32,625A0N,55,46CI13FR
    / FDTEXT:FS
    / FO35,1258A0N,55,46CI13FR
    / FDBATCH NO:FS
    / FO770,775A0N,63,51CI13FR
    / FD/FS
    / FO32,854A0N,55,46CI13FR
    / FDESHM:FS
    / FO37,556A0N,55,46CI13FR
    / FDQTY:FS
    / FO32,998A0N,55,46CI13FR
    / FDSAP MATERIAL DOC NO:FS
    / FO525,333A0N,55,46CI13FR
    / FDofFS
    / FO556,854A0N,55,46CI13FR
    / FDINSPECT:FS
    / FO32,926A0N,55,46CI13FR
    / FDUNLOADING:FS
    / FO37,117A0N,55,46CI13FR
    / FDSTOCK TYPE:FS
    / FO32,774A0N,55,46CI13FR
    / FDPURCHASE ORDER:FS
    / FO37,188A0N,55,46CI13FR
    / FDDELIVER TO:FS
    / FO37,260A0N,55,46CI13FR
    / FDSTORAGE LOC:FS
    / FO37,332A0N,55,46CI13FR
    / FDCONTAINERS:FS
    / FO1,1359GB1217,0,6^FS
    / FO594,1359GB0,474,6^FS
    / ^XZ
    /:NEW-PAGE
    / ^XA
    / ^XFNEW-RE-1.ZPL
    / FN999FD&ATWRT_HAZAMAT(6)&^FS
    / FN998FD&EKKO-LIFNR&^FS
    / FN997FD&MABDR-MAKTX&^FS
    / FN996FD&MSEG-ABLAD&^FS
    / FN995FD&MSEG-CHARG&^FS
    / FN994FD&MSEG-EBELN&^FS
    / FN993FD&MSEG-EBELP&^FS
    / FN992FD&MSEG-ERFME&^FS
    / FN991FD&MSEG-ERFMG&^FS
    / FN990FD&MSEG-INSMK(1)&^FS
    / FN989FD&MSEG-MATNR&^FS
    / FN988FD&MSEG-MAT_PSPNR&^FS
    / FN987FD&MSEG-MBLNR&^FS
    / FN986FD&MSEG-SGTXT(40)&^FS
    / FN985FD&MSEG-UMLGO&^FS
    / FN984FD&QALS-PRUEFLOS&^FS
    / FN983FD&V_BACKORDER&^FS
    / FN982FD&V_NAME3&^FS
    / FN981FD&WS_CNTR&^FS
    / FN980FD&WS_CON&^FS
    / FN979FD&WS_HEADER& &^FS
    / ^PQ1,0,1,N
    / ^XZ
    / ^FX End of job

  • Search problem with ActiveDirectory - please help

    Hi,
    I've tried to get a list of the users out of the Active Directory.
    But I just can't get my code to work. It returns nothing back.
    The problem should be simple. But I can not figure out why.
    Please help!
    Raymond
    import javax.naming.*;
    import javax.naming.event.*;
    import javax.naming.directory.*;
    import javax.naming.ldap.*;
    import java.util.Hashtable;
    import java.util.Vector;
    import java.util.Enumeration;
    public class AdClient {
    public AdClient() {
    getUsers();
    public static void main(String args[]) {
    Client client = new Client();
    private void getUsers() {
    // domain = utest
    String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory";
    String HOST = "ldap://192.168.128.50:389";
    String SEARCHBASE = "ou=Users,dc=utest,dc=com";
    String FILTER = "cn=*";
    try {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    env.put(Context.PROVIDER_URL, HOST);
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, "[email protected]");
    env.put(Context.SECURITY_CREDENTIALS,"admin");
    DirContext ctx = new InitialDirContext(env);
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    NamingEnumeration results;
    // now search for the users
    results = ctx.search(SEARCHBASE, FILTER, constraints);
    while (results.hasMoreElements()) {
    SearchResult sr = (SearchResult)results.nextElement();
    System.out.println(sr.getName());
    ctx.close();
    } catch(Exception e) {
    e.printStackTrace();
    }

    I tried your code...
    There were two issues I saw, when I changed them it worked!
    1) public static void main(String args[]) {
    Client client = new Client();
    should be
    public static void main(String args[]) {
    AdClient client = new AdClient();
    2) String SEARCHBASE = "ou=Users,dc=utest,dc=com";
    env.put(Context.SECURITY_PRINCIPAL, "[email protected]");
    Should be
    String SEARCHBASE = "ou=Users,dc=utest,dc=newcom,dc=com";
    env.put(Context.SECURITY_PRINCIPAL, "[email protected]");

Maybe you are looking for

  • Creative Cloud for Teams Invitation Not Received

    I invited a team member to use Creative Cloud for teams and the Adobe site indicates the invitation was sent but the user never received it.  I deleted that account and used an email I have access to, and I never received it.  How long does it take t

  • Re-installing and Un-installing Java 0-13

    Greetings- I am in desperate need of uninstalling and reinstalling Java. I've tried going into add/remove to uninstall Java, but received a error message stating that there was a unsuccessful attempt to uninstall. So I went to Microsoft to download t

  • 7290 MEP data invalid

    Had this randomly appear on my screen, have tryed another sim in the handset n still the same problem. Have been using this handset for a year now n never had this problem before.

  • It can´t find the files

    Hello !! My name is marcus and a wonder about … Sometimes can`t Garageband open my new song because it can`t find the files… and I wonder Why ? It`s very bad then I am just sitting many hour`s with this song and save and closed the file, trying to op

  • Regular expression to change erroneous JSTL information fails

    // THIS IS WHAT TO LOOK FOR: <c:param name="[name]" value="<%= [value] %>" />   if (stuff.indexOf(".com/jstl") >= 0) {    stuff = stuff.replaceAll(".com/jstl", ".com/jsp/jstl");   Matcher matcher = Pattern.compile("(<c:param[ \\t]+name=\"[^\"]+\"[ \\