StackOverflowError (due to infinite recursion) in XMLEncoder

I try to save an Object (XmlEncoder.writeObject) which has a non default constructor (to restore the Object) and only public getter methods via XMLEncoder.
Basically I'd like to save only the stuff needed in the extended constructor so I can restore the object with just one call to this constructor and not expose a lot of (unconvenient) setters (after all the XMLEncoder/Decoder would be the only one to use them). So I added:
encoder.setPersistenceDelegate
     Session.class,
     new DefaultPersistentDelegate(new String[]{"board", "robberPosition", "players", "active"})
);The class looks like:
public class Session
     public Session();
     public Session(Board board, LandscapePosition robberPosition, Iterable<Player> players, Player active);
     public Session(Board board, LandscapePosition robberPosition, Iterable<Player> players, Session active);
     @Override
     public boolean equals(Object obj);
     public Object getActive();
     public LandscapePosition getRobberPosition();
     public Costs getCosts();
     public Board getBoard();
     public Collection<Player> getPlayers();
     public Player getActivePlayer();
}What happens is my equals is called - but the parameter is null. So I assume there is some hidden policy in the XMLEncoder programming (did I mention that the docs are horrible?) I didn't get. I tried debugging through the code but there are several oddities I don't get (why is there a Statement generated for writeObject?, why is there no recursion checking mechanism?, why is mutatesTo described differently than it's implemented?, ...).
Would be great if someone could shed some light into this dark alley.
BTW the exception is:
Exception in thread "main" java.lang.StackOverflowError
  at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:616)
  at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:262)
  at java.beans.DefaultPersistenceDelegate.instantiate(DefaultPersistenceDelegate.java:158)
  at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:113)
  at java.beans.Encoder.writeObject(Encoder.java:74)
  at java.beans.XMLEncoder.writeObject(XMLEncoder.java:274)
  at java.beans.Encoder.writeObject1(Encoder.java:231)
  at java.beans.Encoder.cloneStatement(Encoder.java:244)
  at java.beans.Encoder.writeExpression(Encoder.java:303)
  at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:389)
  at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:113)
  at java.beans.Encoder.writeObject(Encoder.java:74)
  at java.beans.XMLEncoder.writeObject(XMLEncoder.java:274)
  at java.beans.Encoder.writeObject1(Encoder.java:231)
  at java.beans.Encoder.cloneStatement(Encoder.java:244)
  at java.beans.Encoder.writeExpression(Encoder.java:303)
  at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:389)Edited by: LCID_Fire on May 23, 2010 8:44 AM

Finally after some prodding and debugging through the writeObject code I have it working.
ejp wrote:
     public boolean equals(Object obj);What's in here?I overrode all equals to be deep comparisons of the objects. One particular problem why these recursions happened were some wrong equals which returned false in the wrong situations. If there's just one equals in the cascade wrong you're very likely to encounter these recursions. Would there be a recursion check the classes could then throw an exception instead of blindly trying to do the same thing over and over.
why is there no recursion checking mechanism?Because it shouldn't be needed. There isn't one in ObjectOutputStream either. Maybe it's you that's recursing?Would you care to elaborate why you think a recursion check is not needed? If I search for similar errors on google there are quite a few recursions occuring - all because people coded their beans differently than XMLEncoder was expecting.
Imagine for example the following classes:
public class Parent
  public Parent(Collection<Child> children);
public class Child
  public Child(Parent parent);
  public Parent getParent();
}Attemting to save Parent would then again result in a infinite recursion.
why is mutatesTo described differently than it's implemented?, ...).Hadn't noticed that. Details?
Returns true if an equivalent copy of oldInstance may be created by applying a series of statements to newInstanceWhat it really does is it checks whether newInstance IS already an equivalent copy of oldInstance. So I guess the whole wording is a little bit unprecise.
Would be great if someone could shed some light into this dark alley.
Have you read the [Swing Connnection articles|http://java.sun.com/products/jfc/tsc/articles/persistence2/] linked from the Javadoc?
Yes. I have read everything I could get my hands on. And I know now why it's relatively sparse used (in contrast to the benefit it could be).
Thanks for trying to help.

Similar Messages

  • Infinite recursion (or StackOverflowError)

    I'm consolidating the wlcs demo and the portal demo, kind of like a wlcsPortal, only
    for 4.0. When I change the portal:createWebflowURL tags over to portlet:createWebflowURL,
    I experience an infinite recursion in com.bea.p13n.appflow.webflow.internal.WebflowHTTPSInfoImpl.determineIfHTTPSRequired_Recur(WebflowHTTPSInfoImpl.java:306).
    Of course, it only occurs when httpsInd="calculate". Has anyone else ran into this
    problem? The HTTPS_URL_PATTERNS is just a conglomeration of the two demos:
    <context-param>
    <param-name>HTTPS_URL_PATTERNS</param-name>
    <param-value>/security/login.jsp,
    /security/new_user.jsp,
    /security/userProcessor.inputprocessor,
    /security/loginProcessor.inputprocessor,
    /sampleapp_main/secureMain.jsp,
    /sampleapp_user/viewprofile.jsp,
    /sampleapp_user/changepassword.jsp,
    /sampleapp_user/editdemographics.jsp,
    /sampleapp_user/editprofile.jsp,
    /sampleapp_user/newusercreation.jsp,
    /sampleapp_user/profileeditaddress.jsp,
    /sampleapp_user/profileeditcc.jsp,
    /sampleapp_user/profilenewaddress.jsp,
    /sampleapp_user/profilenewcc.jsp,
    /sampleapp_user/usercreationforward.jsp,
    /sampleapp_user/newuser.jsp,
    /sampleapp_user/newuser_CustomerProfileIP.inputprocessor,
    /sampleapp_user/profilenewcc_NewCreditCardIP.inputprocessor,
    /sampleapp_user/profileeditcc_EditCreditCardIP.inputprocessor,
    /sampleapp_user/viewprofile_DeleteShippingAddressIP.inputprocessor,
    /sampleapp_user/editprofile_UpdateBasicInfoIP.inputprocessor,
    /sampleapp_user/editdemographics_UpdateInfoIP.inputprocessor,
    /sampleapp_user/profilenewaddress_UpdateShippingInfoIP.inputprocessor,
    /sampleapp_user/profileeditaddress_UpdateShippingInfoIP.inputprocessor,
    /sampleapp_user/changepassword_UpdateAccountInfoIP.inputprocessor,
    /sampleapp_user/deleteCreditCard.pipeline,
    /sampleapp_user/deleteCreditCardIP.inputprocessor,
    /sampleapp_order/addaddress.jsp, /sampleapp_order/checkout.jsp,
    /sampleapp_order/confirmorder.jsp, /sampleapp_order/orderhistory.jsp,
    /sampleapp_order/orderstatus.jsp, /sampleapp_order/payment.jsp,
    /sampleapp_order/paymenteditcc.jsp, /sampleapp_order/paymenthistory.jsp,
    /sampleapp_order/paymentnewcc.jsp, /sampleapp_order/selectaddress.jsp,
    /sampleapp_order/selecttaxaddress.jsp, /sampleapp_order/selecttaxzipcode.jsp,
    /sampleapp_order/shipping.jsp, /sampleapp_order/systemerror.jsp,
    /sampleapp_order/orderhistory_SelectOrderForViewingIP.inputprocessor,
    /sampleapp_order/addNewShippingAddress_ValidateAddressIP.inputprocessor,
    /sampleapp_order/selectShippingAddress_DeleteShippingAddressIP.inputprocessor,
    /sampleapp_order/selectShippingAddress_UpdateShippingAddressIP.inputprocessor,
    /sampleapp_order/enterShippingInfo_ValidateShippingInfoIP.inputprocessor,
    /sampleapp_order/paymentnewcc_NewCreditCardIP.inputprocessor,
    /sampleapp_order/paymenteditcc_EditCreditCardIP.inputprocessor,
    /sampleapp_order/authorizePaymentIP.inputprocessor,
    /sampleapp_order/taxVerifyShippingAddress_DecideShippingAddressPageIP.inputprocessor,
    /sampleapp_order/taxVerifyShippingAddress_UpdateTaxShippingAddressIP.inputprocessor,
    /sampleapp_order/shoppingcart_InitShippingMethodListIP.inputprocessor,
    /sampleapp_order/taxVerifyShippingAddress.pipeline,
    /sampleapp_order/commitOrder.pipeline,
    /sampleapp_order/refreshOrderHistory.pipeline,
    /sampleapp_order/refreshPaymentHistory.pipeline</param-value>
    </context-param>

    Hi, Jess,
    unfortunatelly I have not an answer for you, I only join you to report we have very
    similar problem.
    Our portal application was based on Stock portal demo. We have been using HTTPS_URL_PATTERNS/httpsInd
    with slight problems only for a week and today we wanted to remove HTTPS_URL_PATTERNS,
    or set it to a nonexisting pattern. We expected that we switch the calculation off
    by that and turn all links to http.
    Instead we are getting the StackOverflow error....
    Anyone has met a solution ... ?
    Thanks
    "Jess Evans" <[email protected]> wrote:
    >
    I'm consolidating the wlcs demo and the portal demo, kind of like a wlcsPortal,
    only
    for 4.0. When I change the portal:createWebflowURL tags over to portlet:createWebflowURL,
    I experience an infinite recursion in com.bea.p13n.appflow.webflow.internal.WebflowHTTPSInfoImpl.determineIfHTTPSRequired_Recur(WebflowHTTPSInfoImpl.java:306).
    Of course, it only occurs when httpsInd="calculate". Has anyone else ran
    into this
    problem? The HTTPS_URL_PATTERNS is just a conglomeration of the two demos:
    <context-param>
    <param-name>HTTPS_URL_PATTERNS</param-name>
    <param-value>/security/login.jsp,
    /security/new_user.jsp,
    /security/userProcessor.inputprocessor,
    /security/loginProcessor.inputprocessor,
    /sampleapp_main/secureMain.jsp,
    /sampleapp_user/viewprofile.jsp,
    /sampleapp_user/changepassword.jsp,
    /sampleapp_user/editdemographics.jsp,
    /sampleapp_user/editprofile.jsp,
    /sampleapp_user/newusercreation.jsp,
    /sampleapp_user/profileeditaddress.jsp,
    /sampleapp_user/profileeditcc.jsp,
    /sampleapp_user/profilenewaddress.jsp,
    /sampleapp_user/profilenewcc.jsp,
    /sampleapp_user/usercreationforward.jsp,
    /sampleapp_user/newuser.jsp,
    /sampleapp_user/newuser_CustomerProfileIP.inputprocessor,
    /sampleapp_user/profilenewcc_NewCreditCardIP.inputprocessor,
    /sampleapp_user/profileeditcc_EditCreditCardIP.inputprocessor,
    /sampleapp_user/viewprofile_DeleteShippingAddressIP.inputprocessor,
    /sampleapp_user/editprofile_UpdateBasicInfoIP.inputprocessor,
    /sampleapp_user/editdemographics_UpdateInfoIP.inputprocessor,
    /sampleapp_user/profilenewaddress_UpdateShippingInfoIP.inputprocessor,
    /sampleapp_user/profileeditaddress_UpdateShippingInfoIP.inputprocessor,
    /sampleapp_user/changepassword_UpdateAccountInfoIP.inputprocessor,
    /sampleapp_user/deleteCreditCard.pipeline,
    /sampleapp_user/deleteCreditCardIP.inputprocessor,
    /sampleapp_order/addaddress.jsp, /sampleapp_order/checkout.jsp,
    /sampleapp_order/confirmorder.jsp, /sampleapp_order/orderhistory.jsp,
    /sampleapp_order/orderstatus.jsp, /sampleapp_order/payment.jsp,
    /sampleapp_order/paymenteditcc.jsp, /sampleapp_order/paymenthistory.jsp,
    /sampleapp_order/paymentnewcc.jsp, /sampleapp_order/selectaddress.jsp,
    /sampleapp_order/selecttaxaddress.jsp, /sampleapp_order/selecttaxzipcode.jsp,
    /sampleapp_order/shipping.jsp, /sampleapp_order/systemerror.jsp,
    /sampleapp_order/orderhistory_SelectOrderForViewingIP.inputprocessor,
    /sampleapp_order/addNewShippingAddress_ValidateAddressIP.inputprocessor,
    /sampleapp_order/selectShippingAddress_DeleteShippingAddressIP.inputprocessor,
    /sampleapp_order/selectShippingAddress_UpdateShippingAddressIP.inputprocessor,
    /sampleapp_order/enterShippingInfo_ValidateShippingInfoIP.inputprocessor,
    /sampleapp_order/paymentnewcc_NewCreditCardIP.inputprocessor,
    /sampleapp_order/paymenteditcc_EditCreditCardIP.inputprocessor,
    /sampleapp_order/authorizePaymentIP.inputprocessor,
    /sampleapp_order/taxVerifyShippingAddress_DecideShippingAddressPageIP.inputprocessor,
    /sampleapp_order/taxVerifyShippingAddress_UpdateTaxShippingAddressIP.inputprocessor,
    /sampleapp_order/shoppingcart_InitShippingMethodListIP.inputprocessor,
    /sampleapp_order/taxVerifyShippingAddress.pipeline,
    /sampleapp_order/commitOrder.pipeline,
    /sampleapp_order/refreshOrderHistory.pipeline,
    /sampleapp_order/refreshPaymentHistory.pipeline</param-value>
    </context-param>

  • AS2.0 : Infinite recursion loop error when launching debugger

    I want to debug a project:
    When I run it from Flash, it doesn't work as expected but it
    doesn't display
    any compiling nor runtime error.
    But when I want to debug it and press the Play button of the
    debugger, it
    displays an infinite recursion loop error.
    I get this error even when I set a breakpoint at the first
    line of the
    script.
    How can I debug the debugger? lol!
    If you know Flash debugger's internal behavior, can you tell
    me how it can
    display an infinite recursion loop while a classic preview
    does not.
    Thanks.
    Henri

    What you are trying to do is not supported on Windows.
    You mention a thin client.  This has nothing to do with thin clients.  Thin clients are just dumb monitors that run a remote RDP session.
    If you are connecting to a terminal server there is a configuration in GP or in the terminal server configuration that let you specify an alternate shell.  If you are running this as a remote to a workstation then you need to specify the shell in the
    user profile.  THis can be done through group policy or via a registry edit.
    You cannot use a script for this and you cannot use an Office program without Explorer.  Office requires Explorer to run which is why you are getting that error.
    Redirecting userinit for the whole machine will likely create many bad side effects as it is a fundamental process.  It is called multiple times during logon.  Replacing it with a batch file will cause you script to be executed multiple times. 
    Usually userinit is called at least three times.  In a domain with Group Policy it can be called a dozen times.  I am pretty sure the only reason for it being in the registry is to allow for debugging.
    Another this folder.ng to knowis that userinit has to complete before many things in Office will work correctly dependin on you implementation.
    You can load the powerpoint viewer and directly launch that with the file name from the
    "startup"  .  You can also try and set the powerpoint viewer as the alternate shell.  It just might work because it is designed to run completely stand alone with no Office and is used in kiosks which generally run without Explorer. 
    You can also try to use IE to launch the ppt as it can host this with the viewer installed.  It can be set to fullscreen and it will re-launch  when exited just like Explorer does,
    ¯\_(ツ)_/¯

  • Infinite recursion detected. The loop of dependencies is x - x

    Hello,
    We have some order bucket sizes hard coded in our data warehouse, this logic was created long time ago.
    I have created a shell dimension(Order Amount) that I want to use in order to define all buckets on one place, and also define some new bucket intervals based on the others.
    It works perfect if I just assign one bucket value to the scope statement, but when I define several buckets into one I get the folowing message: "Infinite recursion detected. The loop of dependencies is x -> x"
    How can I solve this? I don't want to use "CREATE Member" because we have some drill through actions defined.
    scope
       ([Order Amount].[Order Amount].[Order Amount].&[22], --Order amount 0-10,
             [Measures].[Orders Received]) ;
    this =  aggregate({[Order].[Order Amount].[Order Amount].&[<5], [Order].[Order Amount].[Order Amount].&[5 - 10]})
    Thanks in advance
    BR.
    AL

    You would have to post an example of how you are trying to assign to multiple members in the one statement. Off the top of my head I can't think how this would be possible.
    http://darren.gosbell.com - please mark correct answers

  • Infinite recursion with JComboBox

    Hi
    i have three JComboBoxes StartingTime,EndingTime,DurationTime.When
    a user selects item from StartingTime,EndingTime should be modified
    according to DurationTime.Similarly when user selects EndingTime
    DurationTime should be modified according to StartingTime.When
    user selects DurationTime EndingTime Should modified according to
    StartingTime.
    My problem is when a user is selecting StartingTime,EndingTime is
    getting modified and so DurationTime is changing and so again EndingTime
    is getting changed and in this way an infinite recursion is giving
    me a run time error.
    Plz suggest me a best alternative.
    krishna
    bits-pilani

    temporarily turn the listener on the duration cb off when you do your update.
    ;o)
    V.V.

  • Infinite recursion - base case ignored and stack overflowed

    Hi, I've been having this logic error for 2 days, and I cannot fix it. Right now, I can barely see anything because I was looking at computer screen for 10 hours. The code I'm writing is a program that allows the user to play a list of MP3 files in a folder. Among commands we have to make, we have to sort the list according to authors, dates, and titles as desired by the user. This specific problem I'm having is from the sorting method. We have to use quick sort, and through the help of textbook and online, I was able to write the code as follows. The problem is, I'm having an infinite recursion. The base case I wrote and if else statement are completely ignored and the method keeps calling itself. Perhaps, return statement is not how you are supposed to end a recurssive method? I have no idea. Any help will be appreciated. Thank you in advance.
    public void sort (Comparator<MP3File> comp) {
              System.out.println("first: " + first  + "last: " + last);
              quickSort(first, last, comp);
              System.out.println("done");
              return;
         public void quickSort (int left, int right, Comparator<MP3File> comp) {
              int leftBound= left;
              int rightBound= right;
              System.out.println("before sorting: left - " + left + " right - " + right);
              if (left>=right) {
                   return;
               if ( ( left < 0 ) || ( left >= listOfMP3.length ) ||
                         ( right < 0 ) || ( right >= listOfMP3.length ) ) {
                       throw new IndexOutOfBoundsException();
               if (right-left>=1) {
                    System.out.println("difference between right and left: " + (right-left));
                    MP3File pivot = listOfMP3[left];
                    while (rightBound>leftBound)
                         while (comp.compare(listOfMP3[leftBound], pivot)<= 0 && leftBound<=right &&rightBound>leftBound) {
                              leftBound++;
                              System.out.println("leftBound " + leftBound);
                         while (comp.compare(listOfMP3[rightBound], pivot)>0 && rightBound>=left &&rightBound>=leftBound) {
                              rightBound--;
                              System.out.println("rightBound " + rightBound);
                         if (rightBound>leftBound) {
                              swap (leftBound,rightBound);
                        swap(left, rightBound);
                        System.out.println("swapped");
                        System.out.println("calling left sorting");
                        quickSort(left, rightBound-1, comp);
                        System.out.println("calling right sorting");
                        quickSort(rightBound+1, right, comp);
               else {
                    System.out.println("wtf");
                    return;
               System.out.println("error");
               return;
         public void swap(int index1, int index2) {
              MP3File temp = listOfMP3[index1];
              listOfMP3[index1] = listOfMP3[index2];
              listOfMP3[index2] = temp;
         }

    naranja wrote:
    Enlighten me further please? How do you use sort method using collections?[http://www.google.com/search?q=java+sort+tutorial]

  • Java.lang.StackOverflowError due to java.beans.XMLEncoder class

    Hello,
    I am using the XMLEncoder class as follows :
    private byte[] serialize(Map decodedBlob) {
    ByteArrayOutputStream bObjOut = new ByteArrayOutputStream();
    if (decodedBlob == null) {
    return null;
    } else {
    try {
    XMLEncoder encode = new XMLEncoder(new GZIPOutputStream(bObjOut));
    encode.writeObject(decodedBlob);
    encode.flush();
    encode.close();
    } catch (Exception e) {
    e.printStackTrace();
    return bObjOut.toByteArray();
    } The object decodedBlob is of type HashMap and further contains other HashMaps and ArrayLists as its values. Including values in all the childs there are more than a 200 variables conatined in this HashMap. I need to call the above serialize method for some 2000 such decodedBlob objects .However when i do run my program it gives me the following error after processing some 168 objects only:
    Exception in thread "main" java.lang.StackOverflowError
    at java.util.Collections$SynchronizedMap.containsKey(Collections.java:1988)
    at java.lang.reflect.Proxy.isProxyClass(Proxy.java:630)
    at java.beans.MetaData.getPersistenceDelegate(MetaData.java:890)
    at java.beans.Encoder.getPersistenceDelegate(Encoder.java:144)
    at java.beans.Encoder.writeObject(Encoder.java:68)
    at java.beans.XMLEncoder.writeObject(XMLEncoder.java:269)
    at java.beans.Encoder.writeObject1(Encoder.java:201)
    at java.beans.Encoder.cloneStatement(Encoder.java:209)
    at java.beans.Encoder.writeExpression(Encoder.java:273)
    at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:384)
    at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:112)
    at java.beans.Encoder.writeObject(Encoder.java:69)
    at java.beans.XMLEncoder.writeObject(XMLEncoder.java:269)
    at java.beans.Encoder.writeObject1(Encoder.java:201)
    at java.beans.Encoder.cloneStatement(Encoder.java:209)
    at java.beans.Encoder.writeExpression(Encoder.java:273)
    at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:384)
    at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:112)
    at java.beans.Encoder.writeObject(Encoder.java:69)
    at java.beans.XMLEncoder.writeObject(XMLEncoder.java:269)
    at java.beans.Encoder.writeObject1(Encoder.java:201)
    at java.beans.Encoder.cloneStatement(Encoder.java:209)
    at java.beans.Encoder.writeExpression(Encoder.java:273)
    at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:384)
    at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:112)
    at java.beans.Encoder.writeObject(Encoder.java:69)
    at java.beans.XMLEncoder.writeObject(XMLEncoder.java:269)
    at java.beans.Encoder.writeObject1(Encoder.java:201)
    at java.beans.Encoder.cloneStatement(Encoder.java:209)
    at java.beans.Encoder.writeExpression(Encoder.java:273)As can be seen the following lines keep repeating in the error:
    at java.beans.Encoder.writeObject(Encoder.java:68)
    at java.beans.XMLEncoder.writeObject(XMLEncoder.java:269)
    at java.beans.Encoder.writeObject1(Encoder.java:201)
    at java.beans.Encoder.cloneStatement(Encoder.java:209)
    at java.beans.Encoder.writeExpression(Encoder.java:273)
    at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:384)
    at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:112)I have seen the other posts regarding the same on the forum but even overriding the mutatesTo as described there doesnt help.
    I have also tried increasing the heap size but that also doesnt seem to solve the problem.
    Please please help me sort this problem out. Thanks in advance

    hey ... i just found a way out .... when i upgraded to version 6 the error simply vanished ... seems there was a bug in d previous version for the XMLEncoder class. Thanks anyway.
    So for all the others who are facing similar problem try running the code with jre 1.6 too and see if it solves your problem

  • Infinite recursive loop in Ruleframe generated CAPI-function (display_label)

    On our project we want to inforce a business rule that enforces that a row won't reference itself in a table like the following:
    create table ear as
    ( id number (10) primary key
    parent_id number (10) references ear (id)
    ;so
    insert into ear
    (id, parent_id)
    values
    (42, 42)
    /generates an error.
    In order to reach this end we defined a BR (a RER), transformed it, using the headstart business rule design transformer, and entered some code like this:
    if p_parent_id is not null
    then
    l_rule_ok := p_parent_id <> p_id;
    end if;This works, however, if we enter the abovementioned insert-statement and the capi tries to process the rule violation (using qms_transaction_mgt.process_rule_violation), it tries generating a display-label using the display_label CAPI function, which contains (between useful code) a non-terminating recursive loop:
    function display_label ( ... parameters ...) is
    -- ...usefull code
    if substr(l_mask, 2, 1) = '1'
    and l_ear_row.parent_id is not null
    then
    l_display_label :=
    l_display_label
    &#0124; &#0124;', '
    &#0124; &#0124;app_ear_capi.display_label
    ( p_id => l_ear_row.parent_id
    end if; -- substr(l_mask, 2, 1) = '1'
    -- more usefull code ...
    end display_label;Which behaves very unpleasant when p_id = p_parent_id ...
    An (greatly unsatisfying) idea we have to circumvent this behavior is making a manual hack in the generated code that either removes the recursive call or enters some stop-condition-like behaviour ( adding the parameter p_mask with the value '10', so the parent-id won't be processed a seccond time round).
    Any good options around?
    P.S.
    We are using HSU_CAPI 6.5.1.0; db 8.1.7 enterprise (on a VAX); des6i(6.5.46.1)
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Headstart Team:
    My best guess is that when you look at your table definition in Designer, and go to the foreign key column (parent_id), the "Descriptor Sequence" property is set. Kind regards,
    Peter<HR></BLOCKQUOTE>
    Alas, the Descriptor Sequence property for the parent_id is empty. The only other thing "out of the ordinary" is the presence of the tags <EXISTS_ROW><AGGREGATE_VALUE> in the notes-field (which, however, is exactly as it shoud be according to the User Guide)
    Kind regards,
    Sander
    ([email protected])
    null

  • StackOverFlowError in renderer

    Hello, I was wondering if anyone could tell me, why the following code sometimes might go to the catch phrase, and therefore cause a stackOverFlowError due to the recursion in the catch phrase.
    This code is extracted from a renderer that holds checkbox items in it and is supposed to select certain items when the GUI is launched each time.
    Your help will be greatly appreciated!
    public void selectOneIndex( int[] index) {
                  try {
                       for(int i = 0; i < list.getModel().getSize(); i++) {  
                            selState[i] = false;             
                       for(int i = 0; i < list.getModel().getSize(); i++) {
                        if(i< index.length) {     
                                 System.out.println("index "+i+": "+index);
                             selState[index[i]] = true;
              } catch(ArrayIndexOutOfBoundsException aie) {
                   System.err.println("Inside catch: "+aie.getMessage());
                   updateSelectionStateTrackers(list);
                   selectOneIndex(index);
                   return;
              if(list != null) {
                   list.revalidate();
                   list.repaint();

    Well, it's hard to say, but you assume that selState.length is equal or greater than list.getModel().getSize()
    Probably that's not always true?
    Also you assume that maximum of index is less than selState.length
    Anyway it looks like you are using try/catch mechanism for flow control in you program, this is not the best idea, you should use it for handling exceptional conditions
    Edited by: azukov on Sep 26, 2007 4:46 PM

  • Why doesn't the following method recurse infinitely?

    The following method opensquare should cause infinite recursion as far as I can see and yet it doesn't cause lockups or error messages of any kind when I run it in my program. Also I can't figure out why showgrid[x+b][x+c] isn't set to true for certain values of b and c between -1 and 1 even on the initial call (opensquare called for 1st time).
    Info about variables, arrays: x,y are always between zero and 9 and are passed to opensquare from a mousepressed method which converts the
    pixel coordinates to minegrid, showgrid etc. coordinates between 0..9.
    and showgrid[x][y] is always true before opensquare is called. For
    recursive calls it looks to me like showgrid[x][y] will always be true.
    showgrid, minegrid are 10 by 10 arrays of type boolean
    number grid is a 10 by 10 array of type int
    b & c are local ints to the method opensquare, specifically the for loops.
    assuming that the if test condition is passed and none of the squares around x,y has numbergrid>0 I would think that the method would call itself infinitely because for b& c=0 from the two for loops would mean the method would call itself for the same element (x+0,y+0)=x,y the same element. Also it would jump to one element and then the method would execute for the element it just jumped from and go back and forth... and yet this method doesn't infinitely recurse. Also, it doesn't seem to call opensquare for some values of b&c even though it passes the test condition.
    I really don't understand this. Could someone explain 1) why it doesn't infinitely recurse and 2) why for a (showgridl[x][y] element that doesn't for -1>b>1 -1>c>1, have any numbergrid[x+b][y+c] elements>0 around it and for -1>b>1 -1>c>1 no minegrid[x+b][y+c] elements that are true around it and meets the condition that [x+b]&[y+c] are both between 0 and 9) that it doesn't make showgrid[x+b][x+c] true for every x+b & y+c. In my program it doesn't make it true for every x+b,y+c assuming the previous conditions. It seems to head off in a direction of openingsquares in a x getting smaller y getting smaller direction and never seems to make showgrid[x+b[y+c] true for b>0&c=0.
    here is the method:
    public void opensquare(int x,int y){   
    int count=0;
    int squarecount=0;
    if (minegrid[x][y])
    { done=true;}
    while (!done) {
    if (showgrid[x][y]) {
    for (int b=-1; b<=1; b++)
    for (int c=-1; c<=1; c++)
    if ((x+b >= 0) && (x+b < XGRID) && (y+c >=0) && (y+c<YGRID) && (minegrid[x+b][y+c] == false ))
    showgrid[x+b][y+c]=true;
    if (numbergrid[x+b][y+c] > 0) {
    done = true;
    x=x+b; y=y+c;
    opensquare(x, y);
    else done=true;

    done is a boolean global variable and is transparent to all methods. The mousepressed method sets done to false every time the left mouse button is pressed. Opensquare is called from the mousepressed method after done is set to false.
    You say it's not recursion, it sure acts like recursion.
    I get elements in showgrid being opened that are as far as 4 elements less in x and y then the element passed to opensquare. I get a max of about 14 elements of showgrid being set to true when they were all false before opensquare was called. Since the for loops only run through 9 elements of showgrid it must be calling opensquare again which then opens more elements, unfortunately it usually only runs in one direction with x and y getting smaller and to a lesser extent x getting bigger and y getting smaller. It almost never sets showgrid[x][y] elements to true with x and y getting bigger. It is recursion ( the method calling itself is what I understand as recursion). I don't understand why it doesn't recurse infinitely as I explained before with adjacent showgrid elements calling opensquare for each other infinitely, or even a showgrid element producing a call to opensquare for itself infinitely. If I take out the else done=true statement I get multiple errors displayed in the applet viewer window coming from opensquare (I can't see the error it goes by too fast). Seems to me if it fails the boundary test done will never be true for every single branch of opensquare called.

  • Solving a StackOverflowError

    I am getting "Exception in thread "main" java.lang.StackOverflowError" when I run my program (it uses recursion). After a few minutes of running, it will produce this error and stop. I have run this program on another machine and it completed successfully, but on this machine, it does this. Are there memory limit settings somewhere I can change? I am using jGRASP.

    If you're running it from within your IDE, you'll have to look at that IDE's preferences/options. There should be a place to provide JVM arguments.
    If you run from the command line, you can just type java -X and it will give you a list of command line options.
    java -X
        -Xss<size>        set java thread stack size
    ...Usually, if you get StackOverflowError, it's because there's a bug in your code leading to infinite recursion. The fact that your code works in one environment and not another suggests that this is the less usual case where you have a legitimate reason to use more than the default stack provided in the second environment. However, if you're using multithreading, it could be that you have a bug that just doesn't happen to get exposed in one environment due to scheduler differences.

  • Method equalsIgnoreCase raise java.lang.StackOverflowError

    Is anyone encountered the following? is it an encodiong problem (java.lang.CharacterDataLatin1 etc.)? thanks, david.
    executing:
    public int getColumnIndex(String column)
    int col_id = 0;
    String col_name = null;
    int count = 0;
    try
    if (columns != null)
    count = columns.length;
    for (int i = 0; i < count; i++)
    col_name = columns;
    if (col_name.equalsIgnoreCase(column))
    col_id = i;
    break;
    catch(Exception e)
    col_id = 0;
    e.printStackTrace();
    return col_id;
    raise:
    Exception in thread "Thread-5" java.lang.StackOverflowError
         at java.lang.CharacterDataLatin1.getProperties(CharacterDataLatin1.java:58)
         at java.lang.CharacterDataLatin1.toUpperCase(CharacterDataLatin1.java:156)
         at java.lang.Character.toUpperCase(Character.java:4307)
         at java.lang.Character.toUpperCase(Character.java:4274)
         at java.lang.String.regionMatches(String.java:1214)
         at java.lang.String.equalsIgnoreCase(String.java:950)
         at model.DataEntity.getColumnIndex(DataEntity.java:118)

    That's probably not the full stack trace? I'd say that you have an infinitive recursive call some where.
    Kaj

  • Infinite loop error after using Java Sun Tutorial for Learning Swing

    I have been attempting to create a GUI following Sun's learning swing by example (example two): http://java.sun.com/docs/books/tutorial/uiswing/learn/example2.html
    In particular, the following lines were used almost word-for-word to avoid a non-static method call problem:
    SwingApplication app = new SwingApplication();
    Component contents = app.createComponents();
    frame.getContentPane().add(contents, BorderLayout.CENTER);I believe that I am accidentally creating a new instance of the gui class repeatedly (since it shows new GUI's constantly and then crashes my computer), possibly because I am creating an instance in the main class, but creating another instance in the GUI itself. I am not sure how to avoid this, given that the tutorials I have seen do not deal with having a main class as well as the GUI. I have googled (a nice new verb) this problem and have been through the rest of the swing by example tutorials, although I am sure I am simply missing a website that details this problem. Any pointers on websites to study to avoid this problem would be appreciated.
    Thanks for your time-
    Danielle
    /** GUI for MicroMerger program
    * Created July/06 at IARC
    *@ author Danielle
    package micromerger;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.swing.JFileChooser;
    import java.lang.Object;
    public class MGui
         private static File inputFile1, inputFile2;
         private static File sfile1, sfile2;
         private static String file1Name, file2Name;
         private String currFile1, currFile2;
         private JButton enterFile1, enterFile2;
         private JLabel enterLabel1, enterLabel2;
         private static MGui app;
         public MGui()
              javax.swing.SwingUtilities.invokeLater(new Runnable()
                   public void run()
                        System.out.println("About to run create GUI method");
                        app = new MGui();
                        System.out.println("declared a new MGui....");
                        createAndShowGUI();
         //initialize look and feel of program
         private static void initLookAndFeel() {
            String lookAndFeel = null;
         lookAndFeel = UIManager.getSystemLookAndFeelClassName();
         try
              UIManager.setLookAndFeel(lookAndFeel);
         catch (ClassNotFoundException e) {
                    System.err.println("Couldn't find class for specified look and feel:"
                                       + lookAndFeel);
                    System.err.println("Did you include the L&F library in the class path?");
                    System.err.println("Using the default look and feel.");
                } catch (UnsupportedLookAndFeelException e) {
                    System.err.println("Can't use the specified look and feel ("
                                       + lookAndFeel
                                       + ") on this platform.");
                    System.err.println("Using the default look and feel.");
                } catch (Exception e) {
                    System.err.println("Couldn't get specified look and feel ("
                                       + lookAndFeel
                                       + "), for some reason.");
                    System.err.println("Using the default look and feel.");
                    e.printStackTrace();
         // Make Components--
         private Component createLeftComponents()
              // Make panel-- grid layout
         JPanel pane = new JPanel(new GridLayout(0,1));
            //Add label
            JLabel welcomeLabel = new JLabel("Welcome to MicroMerger.  Please Enter your files.");
            pane.add(welcomeLabel);
         //Add buttons to enter files:
         enterFile1 = new JButton("Please click to enter the first file.");
         enterFile1.addActionListener(new enterFile1Action());
         pane.add(enterFile1);
         enterLabel1 = new JLabel("");
         pane.add(enterLabel1);
         enterFile2 = new JButton("Please click to enter the second file.");
         enterFile2.addActionListener(new enterFile2Action());
         pane.add(enterFile2);
         enterLabel2 = new JLabel("");
         pane.add(enterLabel2);
         return pane;
         /** Make GUI:
         private static void createAndShowGUI()
         System.out.println("Creating a gui...");
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("MicroMerger");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         //Add stuff to the frame
         //MGui app = new MGui();
         Component leftContents = app.createLeftComponents();
         frame.getContentPane().add(leftContents, BorderLayout.WEST);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
    private class enterFile1Action implements ActionListener
         public void actionPerformed(ActionEvent evt)
              JFileChooser chooser = new JFileChooser();
              int rVal = chooser.showOpenDialog(enterFile1);
              if(rVal == JFileChooser.APPROVE_OPTION)
                   inputFile1 = chooser.getSelectedFile();
                   PrintWriter outputStream;
                   file1Name = inputFile1.getName();
                   enterLabel1.setText(file1Name);
    private class enterFile2Action implements ActionListener
         public void actionPerformed(ActionEvent evt)
              JFileChooser chooser = new JFileChooser();
              int rVal = chooser.showOpenDialog(enterFile1);
              if(rVal == JFileChooser.APPROVE_OPTION)
                   inputFile2 = chooser.getSelectedFile();
                   PrintWriter outputStream;
                   file2Name = inputFile2.getName();
                   enterLabel2.setText(file2Name);
    } // end classAnd now the main class:
    * Main.java
    * Created on June 13, 2006, 2:29 PM
    * @author Danielle
    package micromerger;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Main
        /** Creates a new instance of Main */
        public Main()
         * @param args the command line arguments
        public static void main(String[] args)
            MGui mainScreen = new MGui();
            //mainScreen.setVisible(true);
            /**Starting to get file choices and moving them into GPR Handler:
             System.out.println("into main method");
         String file1Name = new String("");
             file1Name = MGui.get1Name();
         System.out.println("good so far- have MGui.get1Name()");
        }// end main(String[] args)
    }// end class Main

    um, yeah, you definitely have a recursion problem, that's going to create an infinite loop. you will eventually end up an out of memory error, if you don't first get the OS telling you you have too many windows. interestingly, because you are deferring execution, you won't get a stack overflow error, which you expect in an infinite recursion.
    lets examine why this is happening:
    in main, you call new MGui().
    new MGui() creates a runnable object which will be run on the event dispatch thread. That method ALSO calls new MGui(), which in turn ALSO creates a new object which will be run on the event dispatch thead. That obejct ALSO calls new MGui(), which ...
    well, hopefully you get the picture.
    you should never unconditionally call a method from within itself. that code that you have put in the constructor for MGui should REALLY be in the main method, and the first time you create the MGui in the main method as it currently exists is unnecessary.
    here's what you do: get rid of the MGui constructor altogether. since it is the implicit constructor anyway, if it doesn't do anything, you don't need to provide it.
    now, your main method should actually look like this:
    public static void main( String [] args ) {
      SwingUtilities.invokeLater( new Runnable() {
        public void run() {
          MGui app = new MGui();
          app.createAndShowGUI();
    }// end mainyou could also declare app and call the constructor before creating the Runnable, as many prefer, because you would have access to it from outside of the Runnable object. The catch there, though, is that app would need to be declared final.
    - Adam

  • Recursive Reportin in Obiee 11g

    Hi,
    Is recursive reporting possible in obiee 11g answers?
    If someone has done that then please guide me.
    Regards,
    HZ

    user8194977 wrote:
    Hi.
    I have a task flow that has 2 pages(parameters form and then table fetched from database). It's work perfectly, but now I need to proceed a "transition" to the same table. Of course I can done it by adding a second task flow with the same structure, but the problem is that "transition" can be infinite recursive...Andrey,
    What do you mean by "a transition to the same table" ? A transition to the same page?
    "adding a second task flow with the same structure"
    By definition, task flows are meant to be reusable components. If it is well-defined, you should be able to reuse the same taskflow.
    You should explain what your trying to achieve instead of what you're doing!

  • I can't uninstall/install FireFox due to a pop-up that says: Your computer must be restarted to complete a previous upgrade of Firefox..."

    This problem arose when I attempted to upgrade my existing FireFox browser to the new FireFox 7. I clicked through the auto-update, but didn't think that anything changed, as the browser didn't look like the image in the feature explanation image I was viewing. I then tried to download Firefox 7, and when I tried to instal it, this process began.
    I can't uninstall/install FireFox due to a pop-up that says: Your computer must be restarted to complete a previous upgrade of Firefox..." When restarted and attempted again, the same pop up appears and I am stuck in an infinite loop.
    I cannot locate the Mozilla file within my program files to try and delete cantankerous upgrade components, which seems to resolve this issue for many people. See: https://support.mozilla.com/en-US/questions/796566
    I also tried completely deleting Firefox, which didn't work either-- I ended up doing a system restore, only to be met with the same infinite loop.
    Now, when I click on the Mozilla icon, nothing happens. No window opens, no error message, nothing.
    Why can't I find the Mozilla folder in my Programs File but can see it in Control Panel "Add or Remove Programs" (though I can't uninstal due to infinite loop)?

    It is probably because you are not properly closing Firefox. Restarting your system would make sure that Firefox had terminated, but you do not have to do that.
    To properly close Firefox on Windows systems, use
    :File > Exit or "Firefox:" button > Exit
    When you get the message "Firefox is already running" it is too late, and you must force termination of Firefox through the Windows Task Manager before restarting Firefox. Windows 7 has a keyboard shortcut to save you a step "Ctrl+Shift+Esc" then on "Processes" tab, select "firefox.exe" and use the "End Process" button. More thorough would be to right-click on the "firefox.exec" and choose "End Process Tree".
    You would find firefox.exe in a Mozilla folder in your program files, but y0u would not want to delete it there, you would need to use the Control Panel which you have already identified and do it from there -- but generally you would not need to do that, and there is nothing in what you have posted to indicate that you should. But if you did do that, then don't let the install start Firefox for you as you would want to use you existing desktop icon or method of starting Firefox, and should decline having Firefox install start Firefox for you. When the install starts then invoke Firefox in your normal manner. This should eliminate problems of creating a new profile rather than using your old profile.

Maybe you are looking for

  • How to restrict the copy & paste in string control?

    In my application user name & password string controls are there.After typing the username in string control it is copied and paste it in password string control . I like to restrict the string copy from one string control  & paste it into another st

  • How to limit the search scope in single site collection for SP2013?

    On our SP2013 farm, there is one web application and 4 site collections under it. At the beginning I was trying to setup 4 different "Content Sources" but Sharepoint warn me that I can only setup 1 source per web application. I don't want user search

  • Nokia Asha 201 problem re car charger

    I have just bought a USB car phone charger but I only get a message Unsupportable USB device. Disconnect cable. The retailer sent me another cable but still the same. What does this mean?

  • ME3L report problem

    When I excute ME3L for a particular vendor, system displays contract with this vendor. For this contract release orders , payment is completely over ( Target value of contract is equal to MIRO value) ,yet, this show " ---  % " balance. This " -- % "

  • MM-Reports

    Hi Experts, Needs Ur Valuable Suggestion on this. My Client wants Few PURCHASE REPORTS 1.  GOODS INWARD Inputs will be -1) DATE WISE  FROM DATE TO to date                     -2) With Respect to One Supplier Vendor Or all for that month