9 Replies Latest reply on Apr 5, 2019 6:13 AM by Karthick Krishnan

    Some strange behavior with ARServerUser object

    Stephan Gasterstaedt
      Share This:

      Hello BMC-Community,

       

      we are facing a strange behavior with the ARServerUser of the com.bmc.arsys.api library.

       

      At the start of our program we initialize the object and re use it for multiple entries that we send to remedy. We tested how our program will behave when we block the port of remedy and after 10 seconds (we setted the timeout with mARServerUser.setTimeoutNormal(10) to 10 seconds) the arServerUser throws the following exception as expected:

       

      During create of Remedy Entry. ERROR:ERROR (90): 90; Connection timed out (Connection timed out) dev00-itsm-01.vip.vipcon.com:51430

       

       

      but...

      because we are inside a loop that tries to send multiple tickets the next try will happen immediately. Then the arServerUser object does not throw any exception it just gets stucked and nothing happens for a long time.

       

      Can you explain us the behavior and how to avoid to get stucked with the ARServerUser object when we try to send another ticket?

       

      Greetings from Germany

      Stephan Gasterstädt

      VIPCON GmbH

        • 1. Re: Some strange behavior with ARServerUser object
          LJ LongWing

          can you post the section of code, the try/catch block, etc....and the output you have from the program?

          1 of 1 people found this helpful
          • 2. Re: Some strange behavior with ARServerUser object
            Carl Wilson

            Hi Stephan,

            sounds like the object is being invalidated, therefore you may need to re-instantiate the connection after it has timed out.

            You could add validation in your loop to see if the object is still valid, if not call a routine to re-instantiate.

             

            Cheers

            Carl

            1 of 1 people found this helpful
            • 3. Re: Some strange behavior with ARServerUser object
              Stephan Gasterstaedt

              Hey Carl Wilson,

               

              this could be indeed an option for us. But than we need to know if the arServerUser Object is invalidated. Is there a method to check if the arServerUserObject has been invalidated? I checked: ARServerUser (AR System Java API)  but was not able to find invalidate inside the whole page.

               

              Greetings

              Stephan Gasterstädt

              VIPCON GmbH

              • 4. Re: Some strange behavior with ARServerUser object
                Stephan Gasterstaedt

                For better understanding how the arServerUser Object behave we developed a short example of it. Please note that we are using groovy.

                import com.bmc.arsys.api.*;

                 

                import java.text.SimpleDateFormat;

                 

                formatString = "yyyy-MM-dd'T'HH:mm:ss";

                sdf = new SimpleDateFormat(formatString)

                 

                ARServerUser mARServerUser = new ARServerUser(

                  'XXXXX',

                  'XXXXx',

                  'en-EN',

                  "xxxx-XXXX-XX.xxxxx.com",

                  51430

                );

                 

                mARServerUser.setTimeoutNormal(10);

                 

                String formName = "HPD:Help Desk";

                try {

                  mARServerUser.verifyUser();

                  } catch (ARException e) {

                  println e;

                }

                 

                while(true) {

                  try {

                  println "";

                  println "----------------------------------------------";

                  println sdf.format(new Date()) + " - start";

                  mARServerUser.setTimeoutNormal(10);

                 

                  try {

                  mARServerUser.verifyUser();

                  } catch (ARException e) {

                  println sdf.format(new Date()) +  "Verify User Error: " + e.getMessage();

                  }

                 

                  List<Object> fields = mARServerUser.getListFieldObjects(formName);

                  println sdf.format(new Date()) + " - success";

                 

                  } catch (Exception e) {

                  println sdf.format(new Date()) +  "Error: " + e.getMessage();

                  }

                }

                 

                When we run the testcase scenario we get first the success message. When we are blocking the port to stop the communication to the arServer, after 10 seconds (as excpected), we get an error message. But at the next iteration the timeout will take much longer (we measured 47 seconds). From now on the arServerUser object will ignore our timeout of 10 seconds and always takes much longer. Even when we recreate the object and reset the timeout it will be ignored. If we free the port to the arServerUser, the connection will be re-established immedately.

                 

                ----------------------------------------------

                2019-04-03T14:10:33 - start

                2019-04-03T14:10:34 - success

                 

                ----------------------------------------------

                2019-04-03T14:10:34 - start

                2019-04-03T14:10:35 - success

                 

                ----------------------------------------------

                2019-04-03T14:10:35 - start

                2019-04-03T14:10:36 - success

                 

                ----------------------------------------------

                2019-04-03T14:10:36 - start

                2019-04-03T14:10:47Error: ERROR (93): Zeitüberschreitungsfehler während des Datenabrufs: Server ist ausgelastet. Versuchen Sie den Vorgang erneut.; dev00-itsm-01.vip.vipcon.com:51430 ONC/RPC call timed out

                 

                ----------------------------------------------

                2019-04-03T14:10:47 - start

                2019-04-03T14:11:29Verify User Error: ERROR (90): Zum AR System-Server kann keine Netzverbindung hergestellt werden; Connection timed out: connect dev00-itsm-01.vip.vipcon.com:51430

                2019-04-03T14:12:11Error: ERROR (90): Zum AR System-Server kann keine Netzverbindung hergestellt werden; Connection timed out: connect dev00-itsm-01.vip.vipcon.com:51430

                 

                ----------------------------------------------

                2019-04-03T14:12:11 - start

                2019-04-03T14:12:37 - success

                 

                 

                Carl Wilson LJ LongWing

                • 5. Re: Some strange behavior with ARServerUser object
                  Carl Wilson

                  Hi,

                  there are 3 timeout values that can be set, have you looked at what these are set at as they maybe coming into play here e.g. getTimeoutNormal, getTimeoutLong, getTimeoutXLong?

                  It might be falling back to the Long Timeout after the normal??

                  Best to check what the values are and seeing if setting these makes a difference.

                   

                  Cheers

                  Carl

                  • 6. Re: Some strange behavior with ARServerUser object
                    Karthick Krishnan

                    Hi Stephan,

                     

                    Try setting timeout for the java program itself.

                     

                    Regards

                    Karthick

                    • 7. Re: Some strange behavior with ARServerUser object
                      Stephan Gasterstaedt

                      Hi Carl,

                       

                      we assumed that the 3 timeout methods where for different datatypes (as the names Normal, Long and XLong indicate). We tested and indeed they do not influence each other (if we set XLong the normal value stays the same). But the overall behavior leaded to the same result as before. Sadly the api documentation does not give us a detailed description about these functions. So we are not able to check for what these methods are for.

                       

                      Thank you anyway .

                       

                       

                      Greetings

                       

                      Stephan Gasterstädt

                      VIPCON GmbH

                      • 8. Re: Some strange behavior with ARServerUser object
                        Stephan Gasterstaedt

                        Hey Karthick Krishnan,

                         

                        What do you mean exactly by setting the timeout for the java program itself? Is there something like as static value inside the REST handler or something similar that we can set?

                         

                        Greetings

                         

                         

                        Stephan Gasterstädt

                        VIPCON GmbH