Modify map while iterating through it

hi all,
i have some java code iam maintaining and am seeing in many places that
HashMap object's iterator is used to iterate and in the loop, the same map is modified (adding an element). is this valid coding? i didnt get any issues so far.
Thanks.
eg code:
for ( Iterator iterator = myHashMap.keySet().iterator(); iterator.hasNext(); )
//bla bla bla
myHashMap.put(key,value);
iam wondering since the map got modified, how reliable is the iterator used in for loop?
-Madhu

You should not add during iteration. If you must, you should add
into a temporary array. When you're done with the iteration,
you can then add everything from the array into the map.
Or, if you quit the iteration right after adding something, that's okay. (That is, if after you add something, you no longer
touch the iterator, then that's okay)
Furthermore:
First of all, you should not use keySet() since it is very inefficient.
You're supposed to use entrySet() instead.
Second of all, if you use entrySet(), then you CAN delete+modify during iteration (just not "add")
for(Iterator i=map.entrySet(); i.hasNext(); ) {
   Map.Entry e = (Map.Entry)(i.next());
   Object key = e.getKey();
   Object value = e.getValue();
   // You can now remove this entry like this:
   i.remove();
   // Or you can alter the value of this entry, like this:
   e.setValue(someNewValue);
}

Similar Messages

  • Concurrent modification exception while iterating through list

    Hi,
    I have a list of objects. I use for each loop in java to iterate through that list of objects and display them.
    The problem is that while iterating other thread can add or remove some objects from that list, and I get ConcurrentModificationException.
    How can I handle this problem. How can I be sure that I am iteration through the updated list.
    Thank you

    Synchonize on the list before iterating through it, and make sure that other code also synchronizes on the list before adding to it or removing from it. Using a list implementation that simply synchronizes all the methods (e.g. Vector) will not do that, you have to do it yourself.

  • While iterating through cursor,system reset, refere to exception in thread

    here is the exception,thanks.
    ====================== EXCEPTION ======================
    NIP: C0A4FB54 XER: 20000000 LR: C0A5ABD0 SP: C53C2CB0 REGS: c53c2c00 TRAP: 0300
    Not tainted
    MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11
    DAR: 0000000C, DSISR: 22000000
    TASK = c109a000[43] 'SCH4' Last syscall: -1
    last math 00000000 last altivec 00000000
    GPR00: D9A66038 C53C2CB0 C109A000 D9800510 00000000 00000001 00000001 00000000
    GPR08: 00000000 D9A7F990 D9A11530 00000000 FFFFFFFF 68EAF35D EB33E86E F9EDE7DD
    GPR16: ECFBB73E 00141001 C60FDFFF EF7D6FFF 003FF000 C00E590C C00E0000 C00E5910
    GPR24: C00E0000 C106C3A8 00000000 C00A0000 C00E56E8 C53C2D28 C0C216F4 C53C2CB0
    Cpu Type: PPC603
    task:SCH4 pid:43
    Call backtrace:
    c0c05a08 s_kth_c_thread_wrapper +3f3fa5f8 s_v2k_c_task_wrapper( )
    c0c216f4 s_v2k_c_task_wrapper +3f3de90c s_OSS_Sche_c_ScheTaskEntry( 4 )
    c08c40cc s_OSS_Sche_c_ScheTaskEntry +3f4 RunProcess( d9134090 )
    c08c4888 RunProcess +30 DMA_MODE_WRITE( d9134090 )
    c08cb8f8 DMA_MODE_WRITE +24 UniProcEntry( d9134090 )
    c08c4920 UniProcEntry +3f73b6e0 processP15Timer( )
    c091f074 processP15Timer +2e4 s_tk_15min_c_getAllMcuaddr( c53c2f88 )
    c092120c s_tk_15min_c_getAllMcuaddr +54 Select( a, 0, 80000000, c53c2f58, c53c2f54, 0, 0 )
    c094a0cc Select +3f6b5f34 __db_c_get_pp( d9a11530, c53c2e98,c53c2eb8, 10 )
    c0a6aa2c __db_c_get_pp +120 __db_c_get( d9a11530, c53c2e98, c53c2eb8, 10 )
    c0a5af84 __db_c_get +570 __db_c_idup( d9a11530, c53c2d80, 16 )
    c0a5ab50 __db_c_idup +7c __db_cursor_int( d9800510, 0, 1, 1, 0, 0, c53c2d28 )
    Stack: (0xc53c2cb0 to 0xc53c30b0)
    2ca0: c53c2d10 6b2100a8 d9800510 00000000
    2cc0: 00000001 00000001 00000000 00000000 c53c2d28 d9a7f990 aaaaaaca d9800950
    2ce0: 00000000 c53c2d90 00000000 c53ad600 c53c2ac7 c00e6978 00000000 00000007
    2d00: fffffffe d11c0200 c53c27ef c53c2d10 c53c2d60 c0a5abd0 d9a11530 c53c2d80
    2d20: 00000016 d9800510 00000000 c00a0000 c00e56e8 d333f320 c0c216f4 c53c2d60
    2d40: c53c2d70 c0c0bd0c d9800950 c00c8c40 00000000 d50553fc 00000000 c53c2d60
    2d60: c53c2e00 c0a5b4f8 d9a11530 c53c2e98 c53c2eb8 00000010 d9800510 c00c8c40
    2d80: 00000000 00000000 d9a7fad0 00000000 d9800950 d9800dd0 c0175b90 00000000
    2da0: 00000000 00000016 00000000 00000000 c53c2e00 00000000 d9a11530 c53c2e98
    2dc0: c53c2eb8 00000000 d9800510 0000000a 00000000 00000000 00000000 00000000
    2de0: 0000000c d50553fc c00e0000 c53c2df0 c53c2e10 c08ce3a0 00000324 c53c2e00
    2e00: c53c2e40 c0a6ab50 d9a11530 c53c2e98 c53c2eb8 00000010 d9800510 d9800950
    2e20: 00000000 0000000
    Edited by: Edgar Liu on Oct 27, 2008 3:58 PM

    Hi,
    Can you describe your problem in more detail? And some code snippet is quite helpful to solve the problem. So far the info you provided dose not say anything
    David

  • Trying to download update to CoPilot Live and CoPilot GPS with maps.  files sizes are large and taking hours to download on wireless connection.  How can I download App updates and new maps while connected to PC and Itunes through hard wire internet link?

    Trying to download update to CoPilot Live and CoPilot GPS with maps.  Files sizes are large and taking hours to download on wireless connection.  How can I download updates and new maps while connected to PC and Itunes through hard wire internet link?

    I'm on my iPad, so I don't know if this is the page with an actual download. I don't see a button, but assume that is because I  am on an iPad. It is in the DL section of Apple downloads.
    http://support.apple.com/kb/DL1708

  • Iterating through a HashMap

    Hi!
    I am trying to iterate through a HashMap that stores the 2 length words as keys and their number of occurrence in the given text. What I want to do is to count the total number of 2letter words which starts with the same letter. Unfortunately I could not find the code that will compare the 2 adjacent keys. I can take the next entry with Map.Entry meNext = (Map.Entry)iter.next(); but I cannot take the current entry with Map.Entry me = (Map.Entry)iter;. Or the next next entry.
    I hope I am clear. I would be really glad for your advices. Below is my code, which gives error:
    java.lang.ClassCastException: java.util.HashMap$EntryIterator cannot be cast to java.util.Map$Entry
    Iterator iter=symbols.entrySet().iterator();
              while (iter.hasNext()) {
                   Map.Entry me = (Map.Entry)iter;
                   Map.Entry meNext = (Map.Entry)iter.next();
                   String valueToString = (me.getValue()).toString();
                   String valueToStringNext = (meNext.getValue()).toString();
                   String keyToString = (me.getKey()).toString();
                   String keyToStringNext = (meNext.getKey()).toString();
                   int numberOfElements = (int)Integer.valueOf(valueToString).intValue();
                   while (keyToString.substring(0,1).equals(keyToStringNext.substring(0, 1))) {
                              numberOfElements += (int)Integer.valueOf(valueToStringNext).intValue();
              }

    thanks a lot for your answer yawmark, but I think I really need to take and compare the 2 adjacent key entries of the hashmap. because later on if the userchoice=2gram, I want to calculate the probability of the 2nd char given the first char. i.e. Prob(b when given a)=numberof(ab) / numberof(words starting with a), otherwise it calculates the probability of the word. i.e. Prob(ab) = numberof(ab) / numberof(all words in the document)
    so length in the code = number of all words in the doc.
    I have my hashmap in sorted, so all the words starting with the same letter will be next to each other. So it can count until it sees another starting letter in the next word.
    The output should be the contents of the probability hashmap, which contains <entries of symbols hashmap which are <words,occurances>, probability of the words>
    for ex. (in this ex it just calculates the probability = occurance/numberof all words.
    &#12362;&#12452;=2=0.5
    &#12452;&#12403;=1=0.25
    &#12403;&#12362;=1=0.25
    for the document: &#12362;&#12452;&#12403;&#12362;&#12452;
              Iterator iter=symbols.entrySet().iterator();
              while (iter.hasNext()) {
                   Map.Entry me = (Map.Entry)iter;
                   Map.Entry me = (Map.Entry)iter.next();
                   String valueToString = (me.getValue()).toString();
                   String valueToStringNext = (meNext.getValue()).toString();
                   String keyToString = (me.getKey()).toString();
                   String keyToStringNext = (meNext.getKey()).toString();
                   int numberOfElements = (int)Integer.valueOf(valueToString).intValue();
                   while (keyToString.substring(0,1).equals(keyToStringNext.substring(0,1))) {
                              numberOfElements += (int)Integer.valueOf(valueToStringNext).intValue();
                   if(userChoice.equals("2gram")) {
                        probability.put(me, ((double)Double.valueOf(valueToString).doubleValue()) / numberOfElements);
                   else
                   probability.put(me, ((double)Double.valueOf(valueToString).doubleValue()) / length);
              }Edited by: koksalasli on Dec 21, 2009 3:06 PM

  • Iterating through entrys of HashMap

    I have a HashMap that is already populated. I'm iterating through the entrySet and want to get the keys and values and use them to create another object. I've searched the forum and googled but can't quite seem to find what I need. Here's the code I have so far.
    Iterator iterator = map.entrySet().iterator();
    while (iterator.hasNext()) {
    if (iterator.next() != null) {
         reasonsList.add(new DropDownData(key, value)); // here's where I'm not sure what to do
    }The DropDownData object accepts twos strings, one for the key and one for the displayed value. These strings should be the key and value from my current HashMap entry. But I can't seem to figure out how to do it.
    thanks for any help/suggestions

    iterating over the not-null entries or iteratingover
    gotten entries that are not null is equivalent,maps
    return "null" for unexisting keys...
    I do not understand what you are saying here.
    It is not required that Map implementations return "null" for non-existent keys.
    It just happens to be the way the implementations in the JDK are implemented.
    The documentation specifically says that Map.get(key) could be allowed to throw a NullPointerException.
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html#get(java.lang.Object )
    >
    I would add that map's structure suggests it's the
    way to go (I mean, mine of course ;))
    That's a matter of interpretation.
    what's the point in iterating over the values when
    you need the key ?When you need the keys and the values (as in the case of the OP), then there is plenty of point in it.
    >
    the only way (the API should define) to iterate over
    a map is through the key (hence the "map" name),
    entrySet is (as far as a I reckon) a twisted bypass...It's in the API. It works well. It's useful. So there's no reason not to use it when it is applicable.

  • Avoid iterating through everything

    Hello all,
    Hope you guys can help me with this problem. I have a program that draws anywhere from 1-300,000 letters on a canvas. Each letter is created from a class called StringState which extends Rectangle. What I would like to do is have each letter respond when the user moves the mouse over the letter by growing bigger. I figured I can just see if the letters bounds contains the point where the mouse moved to and if it does change the letters size and repaint around that letter to update the display. This works great from 1-5000 letters but getting up to 10,000 or even higher creates a very visible lag while the program is iterating through the letters to check if the mouse location intersects the letters bounds. What I was wondering is there a way to get this result without iterating through the entire collection of letters to see if it contains the mouse location? Like can I attach some kind of mouse listener to each letter or something like that? The following program just demonstrates how I create and display the letters I haven't really had a chance to create a demonstration of how they would grow when hovered over. The program i'm working on that actually demonstrates this is very large and hard to trim down to show an example so the following code is actually from a previous question I asked and was provided by Aephyr. Thanks in advance for your guys help :)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.util.List;
    public class PaintSurface implements Runnable, ActionListener {
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new PaintSurface());
         Tableaux tableaux;
         Random random = new Random();
    //        Point mouselocation = new Point(0,0);
         static final int WIDTH = 1000;
         static final int HEIGHT = 1000;
            JFrame frame = new JFrame();
         public void run() {
              tableaux = new Tableaux();
              for (int i=15000; --i>=0;)
                   addRandom();
              frame.add(tableaux, BorderLayout.CENTER);
              JButton add = new JButton("Add");
              add.addActionListener(this);
              frame.add(add, BorderLayout.SOUTH);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(WIDTH, HEIGHT);
              frame.setLocationRelativeTo(null);
    //                frame.addMouseMotionListener(new MouseListener());
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              addRandom();
         void addRandom() {
              tableaux.add(
                        Character.toString((char)('a'+random.nextInt(26))),
                        UIManager.getFont("Button.font"),
                        random.nextInt(WIDTH), random.nextInt(HEIGHT));
    //        class MouseListener extends MouseAdapter {
    //            public void mouseMoved(MouseEvent e) {
    //                mouselocation = new Point(e.getX(),e.getY());
    //                frame.repaint();
            class StringState extends Rectangle {
                    StringState(String str, Font font, int x, int y, int w, int h) {
                            super(x, y, w, h);
                            string = str;
                            this.font = font;
                    String string;
                    Font font;
            class Tableaux extends JComponent {
                 Tableaux() {
                      this.enableEvents(MouseEvent.MOUSE_MOTION_EVENT_MASK);
                      lagState = createState("Lag", new Font("Arial",Font.BOLD,20), 0, 0);
                 protected void processMouseMotionEvent(MouseEvent e) {
                      repaint(lagState);
                      lagState.setLocation(e.getX(), e.getY());
                      repaint(lagState);
                      super.processMouseMotionEvent(e);
                 StringState lagState;
                    List<StringState> states = new ArrayList<StringState>();
                    StringState createState(String str, Font font, int x, int y) {
                        FontMetrics metrics = getFontMetrics(font);
                        int w = metrics.stringWidth(str);
                        int h = metrics.getHeight();
                        return new StringState(str, font, x, y-metrics.getAscent(), w, h);
                    public void add(String str, Font font, int x, int y) {
                         StringState state = createState(str, font, x, y);
                            states.add(state);
                            repaint(state);
                    protected void paintComponent(Graphics g) {
                            Rectangle clip = g.getClipBounds();
                            FontMetrics metrics = g.getFontMetrics();
                            for (StringState state : states) {
                                    if (state.intersects(clip)) {
                                            if (!state.font.equals(g.getFont())) {
                                                    g.setFont(state.font);
                                                    metrics = g.getFontMetrics();
                                            g.drawString(state.string, state.x, state.y+metrics.getAscent());
                            if (lagState.intersects(clip)) {
                            g.setColor(Color.red);
                            if (!lagState.font.equals(g.getFont())) {
                                g.setFont(lagState.font);
                                metrics = g.getFontMetrics();
                            g.drawString("Lag", lagState.x, lagState.y+metrics.getAscent());
    }Here is the code that iterates through the letters to see if a letter contains the mouse location:
                if(e.getSource()==canvas&&edit) {
                    for(Letter l : letters) {
                        Rectangle rec = new Rectangle(l.x+l.xoffset,l.y+l.yoffset,l.width,l.height);
                        if(rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false&&l.defaultSize==l.font.getSize()) {
                            l.resizing = true;
                            new Thread(new ExpandLetter(l)).start();
                        else if(!rec.contains(new Point(e.getX(),e.getY()))&&l.resizing==false){
                            l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize);
                            l.resizeLetter(l.text);
                }However I just learned that this loop itself is taking up a huge amount of memory by saying
    l.font = new Font(l.font.getName(),l.font.getStyle(),l.defaultSize); When I take that line out the lag is reduced by a lot. Also I think that it isn't forgetting the "old" letters font that it is replacing by saying new Font() and after running this loop once my program runs slow and laggy as if it doesn't have enough memory to run fast anymore. Is there something I am doing wrong by initiating a new Font. I would have thought that it wouldn't take up anymore memory because it replaces the old font the the letter "l" has. The loop seems to have some kind of memory leak if someone could point it out to me that would be great. Thanks :)
    Edited by: neptune692 on Feb 16, 2010 8:18 PM

    neptune692 wrote:
    can I attach some kind of mouse listener to each letterTry this:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    import java.util.*;
    import javax.swing.event.*;
    public class SimplePaintSurface implements Runnable, ActionListener {
        private static final int WIDTH = 1250;
        private static final int HEIGHT = 800;
        private Random random = new Random();
        private JFrame frame = new JFrame("SimplePaintSurface");
        private JPanel tableaux;
        public void run() {
            tableaux = new JPanel(null);
            for (int i = 15000; --i >= 0;) {
                addRandom();
            frame.add(tableaux, BorderLayout.CENTER);
            JButton add = new JButton("Add");
            add.addActionListener(this);
            frame.add(add, BorderLayout.SOUTH);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setSize(WIDTH, HEIGHT);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
            tableaux.requestFocusInWindow();
        public void actionPerformed(final ActionEvent e) {
            addRandom();
            tableaux.repaint();
        void addRandom() {
            Letter letter = new Letter(Character.toString((char) ('a' + random.nextInt(26))));
            letter.setBounds(random.nextInt(WIDTH), random.nextInt(HEIGHT), 16, 16);
            tableaux.add(letter);
        public static void main(final String[] args) {
            SwingUtilities.invokeLater(new SimplePaintSurface());
    class Letter extends JLabel {
        Font font1;
        Font font2;
        private final FontRenderContext fontRenderContext1;
        private final FontRenderContext fontRenderContext2;
        public Letter(final String letter) {
            super(letter);
            setFocusable(true);
            setBackground(Color.RED);
            font1 = getFont();
            font2 = font1.deriveFont(48f);
            fontRenderContext1 = getFontMetrics(font1).getFontRenderContext();
            fontRenderContext2 = getFontMetrics(font2).getFontRenderContext();
            MouseInputAdapter mouseHandler = new MouseInputAdapter() {
                @Override
                public void mouseEntered(final MouseEvent e) {
                    Letter.this.setOpaque(true);
                    setFont(font2);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font2.getStringBounds(getText(), fontRenderContext2);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
                @Override
                public void mouseExited(final MouseEvent e) {
                    Letter.this.setOpaque(false);
                    setFont(font1);
                    Rectangle bounds = getBounds();
                    Rectangle2D stringBounds = font1.getStringBounds(getText(), fontRenderContext1);
                    bounds.width = (int) stringBounds.getWidth();
                    bounds.height = (int) stringBounds.getHeight();
                    setBounds(bounds);
            addMouseListener(mouseHandler);
    }

  • N8 - Ovi Maps & Routing Speech through Bluetooth

    Is there any way to route the voice directions from Ovi Maps to bluetooth headphones?
    I tried the other day, with music playing from my N8 through my bluetooth headphones the voice directions were still only coming out of the handset itself!
    Not much use if I'm using the satnav whilst riding a bicycle! That was one really useful thing I found about my HTC Desire - it would send the directions via the bluetooth headphones if connected, even if music was playing! It would pause the music, say the directions, then start playing again! Sadly then the battery would die before I reached my destination

    Loutre wrote:
    I've got the same problem... very very annoying ! Ovi maps is useless for my bluetooth crash helmet. How can it be so long to be fixe by Nokia ?
    I have posted this before but here goes again:- There is a work-around, which is not exactly elegant but at least good enough to use for this safety- relevant feature.
    Record a file with 2 mins of quiet/no sound/empty room etc. Save this to your music directory on the phone. Before using the ovi maps open the music player and set this to play the quiet.mp3 continously/repeat. THEN when connecting your blue-tooth device and using the maps you will get the sound directions. This works because idiotically the blue-tooth sound directions are only active when "music" is being played. Which normally is unusable/distracting. If the "music" is in fact at most a light backgroud "hiss..." then this is not so bad.
    p.s. One can expect a bit more battery useage this way. Good idea to have a charging facility on your vehicle. In my case with a 125cc Scooter I have built this under the seat. The BT works fine from there so I can use the maps while the N8 is charging.
    Stay safe!
    ron b.
    N8- Motorscooterist.

  • Iterating through View Object RowIterator Bug.

    I use this code to loop through the rows of a view object (As described in javadoc of RowIteratior).
    public String checkIterations() {
    String res = "Iterated through : ";
    RowIterator view = this.getDepartmentsView1();
    view.reset();
    Row row;
    while ((row = view.next()) != null) {
    System.out.println("rownum: " + row.getAttribute("RowNum"));
    res += row.getAttribute("RowNum") + " ";
    return res;
    Yet this code never goes through the first row if the executequery has been performed for view object.
    details:
    [http://adfbugs.blogspot.com/2009/07/iterating-through-view-object.html]
    Is this a bug?
    Edited by: mkonio on Jul 28, 2009 11:41 PM

    Thanks Andrejus and Steve.
    Its a development bug
    problem and solution described in:
    Fusion Developer's Guide for Oracle ADF
    9.7.6 What You May Need to Know About Programmatic Row Set Iteration

  • How to insert element to a HashMap while iterating it ?

    Hi all,
    I have a HashMap having <key, value> as <file name, size of file>.
    Before iterating HashMap is loaded with some <key, value> pairs.
    While iterating it I'm trying to find all files matching particular key (Pattern created from file name) and insert to the same HashMap.
    This ends with a "ConcurrentModificationException".
    Is there an alternative way of doing this within one loop ?
    Thanks

    cybertechsum wrote:
    you can try this approach
    Create two threads one for iterating through the list and one for adding items to the list
    then synchronize the method so that only one thread can access hashmap at one timeThat's pointless overkill. He never said anything about needing two threads, and creating an additional thread just for this, but then syncing, will lead to sequential (i.e., single-threaded) behavior anyway.
    This will avoid errorThis is more complex than the other solutions suggested, and therefore more error-prone.

  • Add to list while iterating?

    What's the best way to add an element to a list during an iterating a list and have the item be in the current iteration?
    For example...
        List<Integer> li = new LinkedList<Integer>();
        li.add(1);
        li.add(3);
        li.add(4);
        ListIterator<Integer>iter = li.listIterator();
        while(iter.hasNext()){
          int num = iter.next();
          if(num==1){
            iter.add(2);
          System.out.println(num);
        }the above code would only print 1,3,4...
    Any help would be appreciated, thank you.

    Making the simple change
              if(num==1){
                iter.add(2);
                iter.previous();
              }Seems to do the trick. Looking at the previous API we see:
    Returns the previous element in the list. This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next to go back and forth. ( Note that alternating calls to next and previous will return the same element repeatedly. )
    add() placed the element BEFORE the next() element. Calling previous() retrieves the added element. A subsequent call to next() gets that same element as per the API doc.

  • Error while scheduling through web service

    We have created Web service through WSDL of OBI Publisher. Also we created a web service proxy client to call the services offered by OBI Publisher. We actually want to  "Automate the Scheduling of Reports" according to our requirement:
    1. We used to schedule the reports manually by giving the parameters(used to populate data in reports) and other fields like select report name, report destination, format of reports ( .pdf, .docx,etc) through Oracle BI Publisher.
    2. As there are thousands of permutations of report input parameters possible, so it is difficult to schedule them manually. 
    3.We also want to schedule report to a particular folder according to some parameter, for the ease of the user visibility.
    Above requirements are not currently available with Oracle BI Publisher.
    We are getting error while scheduling through ScheduleRequest class.
    The client.java is as follows:
    public class ScheduleServiceClient
      @WebServiceRef
      private static ScheduleService_Service scheduleService_Service;
      public static void main(String [] args)
        scheduleService_Service = new ScheduleService_Service();
        ScheduleService scheduleService = scheduleService_Service.getScheduleService();
        // Add your code to call the desired methods.
        try {      
                    FTPDeliveryOption ftpdo =new FTPDeliveryOption();
                    ftpdo.setFtpServerName("ServerName");
                    ftpdo.setFtpUserName("Username");
                    ftpdo.setFtpUserPassword("Password");
                    ftpdo.setRemoteFile("/path/TestFile");
                    ftpdo.setSftpOption(true);
                    List<FTPDeliveryOption> listobj=new ArrayList<FTPDeliveryOption>();
                    listobj.add(ftpdo);
                    ArrayOfFTPDeliveryOption ar =new ArrayOfFTPDeliveryOption(); 
                    ar.setItem(listobj);
                    DeliveryChannels dc = new DeliveryChannels();
                    dc.setFtpOptions(ar);
                    ScheduleRequest scheduleRequest = new ScheduleRequest();
                    scheduleRequest.setDeliveryChannels(dc);
                    scheduleRequest.setJobLocale("en-US");
                    scheduleRequest.setUserJobName("Job_1_WebService"); 
                    scheduleRequest.setDataModelUrl("Url");
                    scheduleRequest.setStartDate("Mar 27, 2015 12:40:00 PM");
                    scheduleRequest.setJobTZ("[GMT+05:30] Calcutta, Chennai, Mumbai, New Delhi");
                    String userID = "BI_Publisher_Username";
                    String password = "BI_Publisher_Password";
                    scheduleService.scheduleReport(scheduleRequest,userID,password);
                } catch(Exception exception) {
                    exception.printStackTrace();
    Snapshot of error is attached.
    Kindly suggest the way of getting out of this error.

    Hi
    Check this thread
    WD Message Manager
    Reward opints if usefull....

  • Field Profit Center is not populated while posting through T-Code F-02

    Dear Sir / Madam,
    While posting through T-code F-02 the field Profit center is in hidden mode
    as a result I am getting the given below error.
    "GLT2201 - Balancing field profit center in line item 001 not filled"
    Please guide me as to how do I change Field status varient so that the field Profit center gets activated in optional mode in F-02.
    I tried searching the same but could not find the solution.
    Regards
    Chirag Shah

    Dear expert
    Check following steps...
    1. Use transaction ACSET and enter cost center as your account assignment for type 01 APC posting..
    2. Make sure Cost Center exists in the Asset Master..
    3. Make sure profit center is entered into Cost Center master.
    4.Check the steps where you assign the GL accounts to the splitting rules.
    suggest you to go through the below mentioned links
    Balancing Field "Profit Center" in line item 001 not filled
    Balancing field "profit center" in line item 001 not filled
    GLT2201 - Balancing field profit center in line item 001 not filled
    Balancing field "Profit Center" in line item 001 not filled
    F-51: Balancing field "Profit Center" in line item 001 not filled
    Balancinf field profit center in line item 001 not filled
    Regards,
    Ajeesh.s

  • Volume issue with new 30G IPOD and Dock while playing through a stereo.

    Sorry if this has been discussed before, I recently purchased a 30G Video IPOD and Dock. While playing through my Stereo I notice that 1) I have to turn up the volume on the IPOD to more than 50% and volume on the receiver to over 50% also and 2) the varience in volume of some of the songs varies consideably. I played by IPOD at a friends home through his Dock and stereo and he controlled through the volume control only on his stereo (same Onkyo as mine), it overode the IPOD volume control. His Dock is about a year old, seems strange that when I use my Dock on his stereo it requires the volume use on BOTH the IPOD and the Stereo. So it would appear that his older Dock is more convenient to use than my new Dock? The fluctations in volume of the odd song is still evident on his stereo as it is on mine.Any comments anyone? Thanks in advance. Larry

    Make sure Soundcheck on the iPod is enabled.
    I recall a few other people have mentioned the volume control on the iPod affected the volume out the back of the Universal dock.
    I have the older dock and it is not affected by the Volume control of the iPod.

  • I used to be able to download files from the Harddrive of my Sony Handycam, but now it won't let me import them while going through "log and transfer."  I have tried to update my settings, but this doesn't seem to work.  Any help would be much appreciated

    I used to be able to download files from the Harddrive of my Sony Handycam, but now it won't let me import them while going through "log and transfer."  I have tried to update my settings, but this doesn't seem to work.  Any help would be much appreciated

    Hard Drive:  The Hard Drive is on my camera (Sony Handycam)
    Just needed some info on what is going on with your particular system.
    Knowing the exact camera model will also assist us.
    If this camera is standard AVCHD you should be able to connect with USB to Mac with FCE open and use Log and Transfer without all the fiddling around converting etc.
    What FCE does during ingest is convert files to AIC. (Apple Intermediate Codec)
    FCE cannot read the individual files in the BDMV folder, that's why all the converting is required when you use that method.
    BTW: regards formatting drives/cards/memory on cameras; it is wise to use the actual device to format rather than a computer. This is a prime cause of read/write goof ups with solid state media. This applies to still or video cameras.
    Keeping the COMPLETE card/memory structure in tact is vital for successful transfers.
    Try here for some trouble shooting tips:
    https://discussions.apple.com/message/12682263#12682263
    Al

Maybe you are looking for