Rocket U2 | UniVerse & UniData

 View Only
  • 1.  Erratic behaviour executing command

    Posted 9 days ago

    We're having an ellusive error calling a BP from Java code.

    The Java code is this

    public synchronized String executeBncCommand(String command, UniSession us, String params) throws UniSubroutineException,UniSessionException {
        try {
            UniSubroutine uSub = null;
            uSub = us.subroutine("***ProgramName***", 3);
            uSub.setArg(0, command);
            uSub.setArg(1, params);
            uSub.setArg(2, "");
            uSub.call();
            return uSub.getArg(2).toString();
        } catch (UniSubroutineException | UniSessionException e) {
            throw e;
        }
    }

    The BASIC lines that are crashing are these ones:

    * Devuelve el PID del usuario
          CASE COMANDO='GET.PID'
             RESPUESTA=XUSR

    Where XUSR is a variable that contains the PID of the user.

    The error is: asjava.uniobjects.UniSubroutineException: An argument was requested from the RPC that was of an invalid type. 

    Looking at the documentation the error code is 81008.

    The problem is that this call is done several times and it works fine. Then, suddenly, fails.

    It's failing on two different platforms:

    Versión UV: 11.2.5 Build 4801 uv112_150724_4801 running on CentOS Linux release 7.9.2009 (Core)
    Versión UV: 11.3.1 113_190426_6025 hf22 running on CentOS Linux release 7.9.2009 (Core)



    ------------------------------
    Héctor Cortiguera
    Quiter Servicios Informaticos SL
    ------------------------------


  • 2.  RE: Erratic behaviour executing command

    ROCKETEER
    Posted 7 days ago

    The error 81008 is "Bad parameter passed to the UniRPC. When you see this error, you must quit and reopen the session. ".  You must have some bad parameter information passed into the subroutine parameter. Please add some debugging information in the exception section.



    ------------------------------
    Paul Chang
    Principal Technical Support Engineer
    Rocket Internal - All Brands
    ------------------------------



  • 3.  RE: Erratic behaviour executing command

    PARTNER
    Posted 4 days ago
    Edited by Christine Rizza 4 days ago

    I have seen this before.  You should only send a single value with every SetArg. I am not sure what command or params values are. My guess is params is the problem variable. The easy way to find out is the System.out.println("My variable "+params); every time it is executed and you will see if the is the problem variable.



    ------------------------------
    Doug Averch
    Owner
    U2 Logic
    ------------------------------