Hello,

I am accessing our Unidata server from PHP using the java bridge for a few 
months  It has been working pretty well up until the current project I am 
working on.

PHP calls a method in a U2 object, which uses Uniobjects for Java to 
invoke a UniBasic Subroutine on our Unidata 7.1 redhat based server. 
Recently I have intermittently received the following error message. 
******************************************************
Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: 
[[o:U2]]->PbrGetMgrList. 
Cause: java.lang.NoSuchMethodException: PbrGetMgrList(). 
Candidates: 
[] Responsible VM: [EMAIL PROTECTED]://java.sun.com/" at: 
#-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1045) 
#-4 php.java.bridge.Request.handleRequest(Request.java:405) 
#-3 php.java.bridge.Request.handleRequests(Request.java:481) 
#0 java.inc(257): java_ThrowExceptionProxyFactory->getProxy(52, '@N', 
true) 
#1 java.inc(473): java_Arg->getResult(true) 
#2 java.inc(479): java_Client->getWrappedResult(true) 
#3 java.inc(672): java_Client->getResult() 
#4 java.inc(1786): java_Client->invokeMethod(51, 'PbrGetMgrList', Array) 
#5 java.inc(1910): java_JavaProxy->__call('PbrGetMgrList', Array) 
#6 java.inc(2072): java_AbstractJava->__call('PbrGetMgrList', Array) 
#7 [internal function]: Java->__call('PbrGetMgrList', Array) 
#8 /var/www/pbr/pbr.php(14): Java->PbrGetMgrList() 
#9 {main}] thrown in java.inc on line 220
********************************************************
I am not sure what this is referring to.  I don't find a java.inc anywhere 
on the web server host.

This works most of the time, but sometimes not.  and I don't see a 
pattern.  Most of the time it can be "fixed" by recompiling and rejarring 
the Java object, but that doesn't always fix it.  One thing I wondered 
about is that this is the first time that I have called a program with no 
input parameters.

Here is the java code.

/**
 * @param                       none
 * @return          Tab delimited list of MGR_NAMES
 */
public String PbrGetMgrList() {
        String result = "";
        try {
                OpenU2Session();
                UniSubroutine uSub = uSession.subroutine("PbrGetMgrList", 
1);
                uSub.call();
                result = uSub.getArg(0);
                CloseU2Session();
        } catch (UniSessionException e) {
                result = "N";
        } catch (UniSubroutineException e) {
                result = "N";
        } finally {
                return result;
        }
}

Here is the UniBassic Subroutine code

$BASICTYPE 'U'
SUBROUTINE PbrGetMgrList(RESULT)
        ****************************
        * Tab delimits data items
        EQU HTAB        TO CHAR(9)

        ************************************
        * Select records for this supervisor
        ************************************
        RESULT = 'N'
        ECMD = "SELECT MGRACCT.DATA SAVING UNIQUE NAME"
        EXECUTE ECMD
        IF @SYSTEM.RETURN.CODE <= 0 THEN RETURN
 
        ***********************************
        *  Build the list
        ***********************************
        RESULT = ''
        FIRST = 1
        LOOP
                READNEXT ID ELSE ID = ''
        UNTIL ID = ''
                * Insert a delimiter unless this is the first record
                IF FIRST = 0 THEN
                        RESULT := HTAB
                END ELSE
                        FIRST = 0
                END
                * ADD THE ID
                RESULT := ID
        REPEAT
RETURN

I suspect that an exception is happening that is not being handled.  Any 
ideas?
 
Senior Analyst
NTN-Bower Corporation
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to