Skip to main content

Erratic behaviour executing command

  • June 6, 2024
  • 2 replies
  • 1 view

Héctor Cortiguera
Forum|alt.badge.img

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 replies

Paul Chang
Forum|alt.badge.img
  • Participating Frequently
  • 33 replies
  • June 7, 2024

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
------------------------------

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
------------------------------

Doug Averch
Forum|alt.badge.img
  • Participating Frequently
  • 67 replies
  • June 9, 2024

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
------------------------------

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
------------------------------