Weird GetFieldID return value

Hi,
I have a problem where GetFieldID returns weird values, that is not NULL. Those values, when further used in Get<Type>Field, crashes my program.
Below my small test program.
#include <jni.h>
#include <jni_md.h>
#include <windows.h>
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
    return JNI_VERSION_1_2;
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
    return;
void main()
    JavaVM *jvm=NULL;
    JavaVMInitArgs args;
    JNIEnv *env=NULL;
    int rc=0;
    jclass testClass;
     jfieldID field;
jvalue jv;
jobject obj;
jmethodID meth;
jbyte b;
         args.version = JNI_VERSION_1_2;
   //JNI_GetDefaultJavaVMInitArgs(&args);
    args.nOptions = 0;
    args.options = NULL;
    args.ignoreUnrecognized = JNI_FALSE;
     rc=JNI_CreateJavaVM(&jvm, (void**)&env,&args);
    if(rc != 0)
        printf( "JNI_CreateJavaVM failure");
        exit(1);
     testClass=(*env)->FindClass(env,"java/util/Vector");
    printf("FindClass java/util/Vector %p\n",testClass);
    field=(*env)->GetFieldID(env,testClass,"capacityIncrement","I");
    printf("GetFieldID %p\n",field);
     testClass=(*env)->FindClass(env,"java/lang/Byte");
    printf("FindClass java/lang/Byte %p\n",testClass);
    field=(*env)->GetFieldID(env,testClass,"value","B");
    printf("GetFieldID %p\n",field);
    field=(*env)->GetStaticFieldID(env,testClass,"MIN_VALUE","B");
    printf("GetStaticFieldID %p\n",field);
     jv.b=0x73;
     meth=(*env)->GetMethodID(env,testClass,"<init>","(B)V");
    printf("GetMethodID %p\n",meth);
     obj=(*env)->NewObjectA(env,testClass,meth,&jv);
    printf("obj %p\n",obj);
     b=(*env)->GetByteField(env,obj,field);
    printf("b= %x\n",b);
exit(0);
}I tested it on W2K, using Sun JSK 1.3.01 and 1.4b2. Althought the return value arent the same, here what is writtent to the console, befoire the crash that occurs xhen calling GetByteField :
FindClass java/util/Vector 00955D28
GetFieldID 00000016
FindClass java/lang/Byte 00955D2C
GetFieldID 0000000A
GetStaticFieldID 00AE7B50
GetMethodID 00AE7B78
obj 00955D30
You can see that fieldIDs does not look like pointer values, whereas other methodIDs and class/object refs are OK.
Any idea ???

Hey, guys !
Stop doing strange things !
Let's see your code:
field=(*env)->GetStaticFieldID(env,testClass,"MIN_VALUE","B");
b=(*env)->GetByteField(env,obj,field);
Anothere SEVERE ERROR - you try get STATIC FIELD by using wrong function !
Your function must be:
NativeType GetStatic<type>Field(JNIEnv *env, jclass clazz,
jfieldID fieldID);
STATIC !!!
Good luck!

Similar Messages

  • MX 7 CFObject multiplying returned value

    I've upgraded our customer's ColdFusion server from 4.5 to MX
    7. It utilized a custom COM object (written in C++) which when
    called, returns a value. This worked under ColdFusion 4.5, and
    still works when used from .NET and VB application. However, now
    when called from ColdFusion MX 7 using cfobject tag, it returns
    value multply by 10000. So for $2.50 it return $25000.00.
    I never had such a weird issue, as ColdFusion is really good
    at backward compatibility. This isn't isolated to one computer,
    it's EVERY SERVER we upgraded to MX 7. Any ideas what's going on?
    To me, it appears to be a ColdFusion MX 7 bug. Maybe a casting
    issue now that ColdFusion is written using Java?

    I've upgraded our customer's ColdFusion server from 4.5 to MX
    7. It utilized a custom COM object (written in C++) which when
    called, returns a value. This worked under ColdFusion 4.5, and
    still works when used from .NET and VB application. However, now
    when called from ColdFusion MX 7 using cfobject tag, it returns
    value multply by 10000. So for $2.50 it return $25000.00.
    I never had such a weird issue, as ColdFusion is really good
    at backward compatibility. This isn't isolated to one computer,
    it's EVERY SERVER we upgraded to MX 7. Any ideas what's going on?
    To me, it appears to be a ColdFusion MX 7 bug. Maybe a casting
    issue now that ColdFusion is written using Java?

  • Execution flow doesn't wait for return values

    I have created JNI wrappers for existing dlls. However I'm getting weird behavior. My Java function calls a c function which communicates with an old mainframe. If I retrieve one row at a time its fine but if I do a loop the virtual machine crashes. Sometimes, if I add an empty loop for (30000 iterations) then its fine. Its like java is already trying to retrieve the next row while the first row is still being printed on my screen. I've tried adding synchronized in case the dlls where multi-threaded but it has not made a difference. Is there any way to control the execution flow so that it can't go to the next line until the values are truly returned from the c dll.
    thanks
    MA

    There are many function being called on the native side. Since I didn't want to modify the native side
    (because the old dlls are used by another application), I added my own dll as an intermediary between the old c dlls and the java side.
    To fix the problem I am having, I've heard of another project where the native side would write the returned values to a file and only once the file is written can the Java side continue. Is this the only way to control the execution flow?
    Right now I have about 5 empty loops which run to 100000 and things work most of the time. But I would prefer to find a way to say wait until the values are returned correctly.
    Essentially, what I'm doing is
    for (int i=1;i<10; i++){
       test.init(Integer.toString(i),Integer.toString(i),"english desc"+  Integer.toString(i),"french desc"+ Integer.toString(i));
       test.execute(test.ActionAdd);
    }This is supposed to add one row with four fields. I'm just putting junk for the test. If I call the two main lines
    test.init(Integer.toString(i),Integer.toString(i),"english desc"+  Integer.toString(i),"french desc"+ Integer.toString(i));
    test.execute(test.ActionAdd);just once it works fine but if I loop them then it crashes after a few loops. If I put a loop as shown below then it works fine. This is part of the code when I'm adding. Is it being looped 10 times from the code above.
    jsession.scanTable(table,errorlist);
                rtc = table.getRecordCount(errorlist);
                if (rtc > 0)
                publish(rtc+" records found.");
                    for(int i = 1; i <= rtc; ++i)
                        for (int j = 0; j < ElementName.size();j++)
                            publish((String)ElementName.get(j)+ ": " + table.getFieldByName((String)ElementName.get(j),i,errorlist));
                            for (int k = 0; k<100000;k++);
                else
                    publish("No records found.");
                }In the code, when the rows are added, I print them out just to make sure they were added correctly. This is where I got the idea that the Java code was not in synch with the native side because it would crash while writting out a line but it didn't happen every time at the same place.
    This is the function getFieldByName
    public String getFieldByName (String p_FieldName, int p_LineNum, ErrorList p_Errors)
              String retval = "";
              int ret;
              try
                   p_FieldName = prepareFieldName(p_FieldName);
                   retval = new String();
                   ret    = 0;
                   if (this.ptrTableView == NOT_SET)
                        p_Errors.addMessage(p_Errors.SEV_SYSTEM_ERROR(), "Table View Pointer not set");
                        throw (new Exception());
                   // allocating string buffer for value returned
                   StringBuffer m_FieldValue = new StringBuffer();
                   // determining length of value
                   int m_length[] = {0};
                   ret = gti.GetFieldLen(this.ptrTableView, p_FieldName, m_length, eb.getErrorBlockPtr());
                   if (m_length[0] == 0) m_length[0] = 100;
                   m_FieldValue = new StringBuffer(m_length[0]);
                   // get line field          
                   ret = gti.GetLineField(this.ptrTableView, p_FieldName, p_LineNum, m_FieldValue, eb.getErrorBlockPtr());           
                   if (ret != 0)
                          p_Errors.addMessage(p_Errors.SEV_ERROR(), "Error retrieving field value ("+p_FieldName+")");
                   else
                          retval = m_FieldValue.toString();
              catch (Throwable t)
                   p_Errors.addMessage(p_Errors.SEV_ERROR(), "Error retrieving field value ("+p_FieldName+")");
              return retval;
        }The main functions are
    GetFieldLen
    GetLineField
    They go to the native side through my dll which wraps the old dlls.
    Here are is one of the main functions in my dll. I also have the source for the functions they are calling but they are calling other functions which are calling other functions. There is a lot of code . Yes, they use arrays.
    JNIEXPORT jint JNICALL Java_advantagewrapperspk_GtiNative_GtiGetLineField
      (JNIEnv *env, jclass cls, jint p_tableViewPtr, jstring VIEWFIELDNAME, jint VIEWFIELDNUM, jobject VIEWFIELDVALUE, jint iErrBlockPtr)
           //printf("\n\nGtiGetLineField in C:\n");
           jint iResult = 0;
           char *temp1 = (*env)->GetStringUTFChars(env,VIEWFIELDNAME,0);
           char *temp2 = (*env)->GetStringUTFChars(env,VIEWFIELDVALUE,0);
         iResult = GtiGetLineField(p_tableViewPtr,temp1,VIEWFIELDNUM,temp2,iErrBlockPtr);
           //printf("VIEWFIELDNUM %d ",VIEWFIELDNUM);
           //printf("\ntemp1 %s ",temp1);
           //printf("\ntemp2 %s ",temp2);
         (*env)->ReleaseStringUTFChars(env,VIEWFIELDNAME,temp1);
         if (temp2 == 0)      return iResult;
        if (temp2 != NULL)
                cls = (*env)->GetObjectClass(env,VIEWFIELDVALUE);
                jmethodID mid = (*env)->GetMethodID (env,cls,"append","(Ljava/lang/String;)Ljava/lang/StringBuffer;");
                 if (mid == 0) return iResult;
                 jstring sfinal = (*env)->NewStringUTF (env, temp2);
                (*env)->CallObjectMethod(env,VIEWFIELDVALUE,mid,sfinal);
              if (VIEWFIELDVALUE != NULL) (*env)->ReleaseStringUTFChars(env,VIEWFIELDVALUE,temp2);
         //(*env)->ReleaseStringUTFChars(env,VIEWFIELDVALUE,temp2);
         return iResult;
      }This calls
    * Function Name : GtiGetLineField()
    * Description   : Retrieves the value of a line field in a table view
    * Parameters    : pTableViewPtr pTableView--the table view from which to
    *                                           retrieve the value of a line
    *                                           field
    *                 VIEWFIELDNAME szFieldName--the name of the line field
    *                                            whose value is returned
    *                 VIEWLINENUM iLineNum--number of line from which to retrieve
    *                                       field value.  Lines are numbered
    *                                       beginning with 1.
    *                 VIEWFIELDVALUE szFieldValue--returns the value of the
    *                                              line field
    *                 ErrBlockPtr sourceeb--error context info from calling
    *                                       function
    * Return values : int--returns RCT_RETURNOK, RCT_WARNCORECONNECT, or
    *                      RCT_FAILCORECONNECT
    * Modifications : REH - 05/25/93
    int GtiGetLineField ( TableViewPtr pTableView,
                          VIEWFIELDNAME szFieldName,
                          VIEWLINENUM iLineNum,
                          VIEWFIELDVALUE szFieldValue,
                          ErrBlockPtr sourceeb )
       int iRc ;      /* return code */
       ELOG_INIT( sourceeb,
                  "GtiGetLineField",
                  "retrieving the value of a line field in a table view" ) ;
       /* in Gti, we start numbering lines from 1, because that is the way a user
          sees them on the screen.  In Ldm, following C conventions, we start
          numbering lines at 0.  So in LdmSetField, we subtract 1 from iLineNum */
       iRc = LdmGetField( pTableView->pTran,
                          szFieldName,
                          szFieldValue,
                          iLineNum - 1,
                          0,                  /* map occurrence = 1 */
                          ELOG_ERRBLOCK ) ;
       /* in case Ldm returned a warning, indicate so to the calling function */
       iRc = ( iRc == LDM_RETURNOK ) ? RCT_RETURNOK : RCT_WARNCORECONNECT ;
       return( iRc ) ;
       /* if exception was raised, it was due to COREConnect */
       ELOG_END( RCT_FAILCORECONNECT ) ;
    }which calls
    /****************************** API Header *********************************\
    * API Name: LdmGetField
    * This function copies the string value of a specified FIELDNAME into a
    * buffer specified by FIELDVALUE.  The string is NULL terminated.
    * The first OCCUR determines which occurrence of the field in the map.
    * The second OCCUR determines which occurence of the map in the transaction
    * area.  Remember that occurrences are numbered like C arrays: a transaction
    * with ten occurrences of a field will have fields numbered zero through
    * nine.
    * It is assumed that FIELDVALUE has enough space to accommodate the field's
    * value.
    int LdmGetField( HTRAN       htran,
                     FIELDNAME   fieldname,
                     FIELDVALUE  fieldvalue,
                     FIELDOCCUR  fieldoccur,
                     MAPOCCUR    mapoccur,
                     ErrBlockPtr seb )
       ELOG_INIT ( seb, "LdmGetField", "getting transaction field value" ) ;
       if ( htran->Occurrence <= mapoccur ) {
          ElogFail1( LDM_FAILOCCNOTFOUND, htran->TranName ) ;
       }  /* END if. */
       /* Since 'blank' values for field or map occurrences are zero, there
          is no need to set a default. */
       LdmsGetField( htran->Map->CCMap,
                     htran->TranData,
                     fieldname,
                     fieldvalue,
                     fieldoccur,
                     mapoccur,
                     ELOG_ERRBLOCK ) ;
       return( LDM_RETURNOK ) ;
       ELOG_END ( ELOG_ERRBLOCK->Rc ) ;
    }  /* END LdmGetField. */which calls
    /****************************** API Header *********************************\
    * API Name: LdmsGetField
    * Put the value of FIELDNAME into FIELDVALUE.  The field must be an element
    * of the specified map.  The new value will be set in the specified data
    * buffer.  The occurrences refer to the occurrence of the field in the map
    * and the occurrence of the map in the data buffer.
    int LdmsGetField ( CCMapPtr    rcmap,
                       char        *dataarea,
                       FIELDNAME   fieldname,
                       FIELDVALUE  fieldvalue,
                       FIELDOCCUR  fieldoccur,
                       MAPOCCUR    mapoccur,
                       ErrBlockPtr seb )
       ElementPtr element ;
       char       *fieldoffset ;
       ELOG_INIT ( seb, "LdmsGetField", "getting a field of a map" ) ;
       /* Search the transaction definition area (map) for matching
          FIELDNAME. If found, copy FIELDVALUE to defined offset in
          transaction buffer. */
       element = LdmsFindField( rcmap, fieldname, fieldoccur, &localeb ) ;
       /* Copy the value from the transaction data area into FIELDVALUE. */
       fieldoffset = dataarea +
                     ( ( rcmap->BufferLength * mapoccur ) + element->Offset ) ;
       strncpy( fieldvalue, fieldoffset, element->Length ) ;
       fieldvalue[ element->Length ] = '\0' ;
       return( LDM_RETURNOK ) ;
       ELOG_END ( ELOG_ERRBLOCK->Rc ) ;
    }  /* END LdmsGetField. */and on it goes
    I gather from your question about arrays that they might be the source of the problem. Could it be that the pointer to the array is returned while the array is not completed? Any information would help. Thanks.

  • Unable to capture return values in web services api

    At the time of login to web services if my server is down ,
    it returns following error :
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            at java.lang.String.substring(String.java:1438)
            at java.lang.String.substring(String.java:1411)
    I want to capture this error so that i can try another server to login. how do i capture this error
    Another place where i want to capture the return Value is when i look for a report on the server
    rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
                               "@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
    oInfoObjects = rh.getInfoObjects();
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    Here if the report is not there on the server , it returns a null handler exception.
    but if i try catching it by checking my responsehandler is null  like rh == null  it does not catch it.
    Any help will be appreciated
    thanks
    Rakesh Gupta

    Ted : i have two cases
    1)   server = server_st.nextToken();
        providerURL = "http://"server"/dswsbobje/services";
        sessConnURL = new URL(providerURL + "/session");
       Connection boConnection = new Connection(sessConnURL);
       Session boSession = new Session(boConnection);
      EnterpriseCredential boEnterpriseCredential = new    EnterpriseCredential();
                  boEnterpriseCredential.setLogin(userid);
      boEnterpriseCredential.setPassword(pwd);
      boEnterpriseCredential.setAuthType(auth);
    SessionInfo boSI = boSession.login(boEnterpriseCredential);
    I have got a list of servers running web servcies stored in my tokens. when i pass the first server name say " test:8080" and that server is down , i want to catch somewhere in the code above that it did not get the connection so that i can loop back and try with the second server say test1:8080
    This is for failover purposes.
    at present when i was trying to capture return value of boSI it  breaks giving the error
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1438)
    at java.lang.String.substring(String.java:1411)
    2nd case :
    I am geeting reports from the server and scheduling them:
    i run the following code which works fine if reports is there
    rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
    "@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
    oInfoObjects = rh.getInfoObjects();
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    Here if  the  report  is not there on the server  then i should be able to catch from the response handle rh that it has got a null value.
    but rh does not return a null value 
    the code ultimately throws a null handle at the following line
    CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
    i am not able to catch the null value there also.
    hope you got my issue.

  • Multiple return values (Bug-ID 4222792)

    I had exactly the same request for the same 3 reasons: strong type safety and code correctness verification at compile-time, code readability and ease of mantenance, performance.
    Here is what Sun replied to me:
    Autoboxing and varargs are provided as part of
    JSRs 14 and 201
    http://jcp.org/en/jsr/detail?id=14
    http://jcp.org/en/jsr/detail?id=201
    See also:
    http://forum.java.sun.com/forum.jsp?forum=316
    http://developer.java.sun.com/developer/earlyAccess/adding_generics/index.html
    Multiple return values is covered by Bug-ID 4222792
    Typically this is done by returning an array.
    http://developer.java.sun.com/developer/bugParade/bugs/4222792.html
    That's exactly the problem: we dynamically create instances of array objects that would better fit well within the operand stack without stressing the garbage collector with temporary Array object instances (and with their backing store: 2 separate allocations that need to be recycled when it is clearly a pollution that the operand stack would clean up more efficiently)
    If you would like to engage in a discussion with the Java Language developers, the Generics forum would be a better place:
    http://forum.java.sun.com/forum.jsp?forum=316
    I know that (my report was already refering to the JSR for language extension) Generics is not what I was refering to (even if a generic could handle multiple return values, it would still be an allocated Object
    instance to pack them, i.e. just less convenient than using a static class for type safety.
    The most common case of multiple return values involve values that have known static datatypes and that should be checked with strong typesafety.
    The simple case that involves returning two ints then will require at least two object instances and will not solve the garbage collection overhead.
    Using a array of variable objects is exactly similar, except that it requires two instances for the components and one instance for the generic array container. Using extra method parameters with Integer, Byte, ... boxing objects is more efficient, but for now the only practical solution (which causes the least pollution in the VM allocator and garbage collector) is to use a custom class to store the return values in a single instance.
    This is not natural, and needlessly complexifies many interfaces.
    So to avoid this pollution, some solutions are used such as packing two ints into a long and returning a long, depacking the long after return (not quite clean but still much faster at run-time for methods that need to be used with high frequencies within the application. In some case, the only way to cut down the overhead is to inline methods within the caller code, and this does not help code maintenance by splitting the implementation into small methods (something that C++ can do very easily, both because it supports native types parameters by reference, and because it also supports inline methods).
    Finally, suppose we don't want to use tricky code, difficult to maintain, then we'll have to use boxing Object types to allow passing arguments by reference. Shamely boxed native types cannot be allocated on the operand stack as local variables, so we need to instanciate these local variables before call, and we loose the capacity to track the cases where these local variables are not really initialized by an effective call to the method that will assign them. This does not help debugging, and is against the concept of a strongly typed language like Java should be:
    Java makes lots of efforts to track uninitialized variables, but has no way to determine if an already instanciated Object instance refered in a local variable has effectively received an effective assignment because only the instanciation is kept. A typical code will then need to be written like this:
    Integer a = null;
    Integer b = null;
    if (some condition) {
    //call.method(a, b, 0, 1, "dummy input arg");
    // the method is supposed to have assigned a value to a and b,
    // but can't if a and b have not been instanciated, so we perform:
    call.method(a = new Integer(), b = new Integer(), 0, 1, "dummy input
    arg");
    // we must suppose that the method has modified (not initialized!)
    the value
    // of a and b instances.
    now.use(a.value(), b.value())
    // are we sure here that a and b have received a value????
    // the code may be detected at run-time (a null exception)
    // or completely undetected (the method() above was called but it
    // forgot to assign a value to its referenced objects a and b, in which
    // case we are calling in fact: now.use(0, 0); with the default values
    // or a and b, assigned when they were instanciated)
    Very tricky... Hard to debug. It would be much simpler if we just used:
    int a;
    int b;
    if (some condition) {
    (a, b) = call.method(0, 1, "dummy input arg");
    now.use(a, b);
    The compiler would immediately detect the case where a and b are in fact not always initialized (possible use bere initialization), and the first invoked call.method() would not have to check if its arguments are not null, it would not compile if it forgets to return two values in some code path...
    There's no need to provide extra boxing objects in the source as well as at run-time, and there's no stress added to the VM allocator or garbage collector simply because return values are only allocated on the perand stack by the caller, directly instanciated within the callee which MUST (checked at compile-time) create such instances by using the return statement to instanciate them, and the caller now just needs to use directly the variables which were referenced before call (here a and b). Clean and mean. And it allows strong typechecking as well (so this is a real help for programmers.
    Note that the signature of the method() above is:
    class call {
    (int, int) method(int, int, String) { ... }
    id est:
    class "call", member name "method", member type "(IILjava.lang.string;)II"
    This last signature means that the method can only be called by returning the value into a pair of variables of type int, or using the return value as a pair of actual arguments for another method call such as:
    call.method(call.method("dummy input arg"), "other dummy input arg")
    This is strongly typed and convenient to write and debug and very efficient at run-time...

    Can anyone give me some real-world examples where
    multiple return values aren't better captured in a
    class that logically groups those values? I can of
    course give hundreds of examples for why it's better
    to capture method arguments as multiple values instead
    of as one "logical object", but whenever I've hankered
    for multiple return values, I end up rethinking my
    strategy and rewriting my code to be better Object
    Oriented.I'd personally say you're usually right. There's almost always a O-O way of avoiding the situation.
    Sometimes though, you really do just want to return "two ints" from a function. There's no logical object you can think of to put them in. So you end up polluting the namespace:
    public class MyUsefulClass {
    public TwoInts calculateSomething(int a, int b, int c) {
    public static class TwoInts {
        //now, do I use two public int fields here, making it
        //in essence a struct?
       //or do I make my two ints private & final, which
       //requires a constructor & two getters?
      //and while I'm at it, is it worth implementing
      //equals(), how about hashCode()? clone()?
      //readResolve() ?
    }The answer to most of the questions for something as simple as "TwoInts" is usually "no: its not worth implementing those methods", but I still have to think about them.
    More to the point, the TwoInts class looks so ugly polluting the top level namespace like that, MyUsefulClass.TwoInts is public, that I don't think I've ever actually created that class. I always find some way to avoid it, even if the workaround is just as ugly.
    For myself, I'd like to see some simple pass-by-value "Tuple" type. My fear is it'd be abused as a way for lazy programmers to avoid creating objects when they should have a logical type for readability & maintainability.
    Anyone who has maintained code where someone has passed in all their arguments as (mutable!) Maps, Collections and/or Arrays and "returned" values by mutating those structures knows what a nightmare it can be. Which I suppose is an argument that cuts both ways: on the one hand you can say: "why add Tuples which would be another easy thing to abuse", on the other: "why not add Tuples, given Arrays and the Collections framework already allow bad programmers to produce unmainable mush. One more feature isn't going to make a difference either way".
    Ho hum.

  • Unable to see function return values in Visual Studio 2013 debugger

    Hi!
    I can't see function return values in
    Microsoft Visual Studio Ultimate 2013
    Version 12.0.31101.00 Update 4
    Microsoft .NET Framework
    Version 4.5.51650
    Installed Version: Ultimate<o:p></o:p>
    as described in  http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/27/seeing-function-return-values-in-the-debugger-in-visual-studio-2013.aspx
    So what can I do to get this functionality back?
    MsdnMezzo

    Hi MsdnMezzo,
    Reference:
    http://blogs.msdn.com/b/visualstudioalm/archive/2013/06/27/seeing-function-return-values-in-the-debugger-in-visual-studio-2013.aspx
    If use the same sample in the above blog provided by you, how about the result? Could you debug it with the same steps? I could debug it in my side using the VS2013.
    So to make sure that whether it is your VS IDE issue, please debug it with this sample, if it works well, I doubt that we would think about your specific project and the debugging steps.
    If so, to really repro this issue, could you share us a sample with one drive? You could upload your project to one drive and share us the downloaded link in your new reply, I will download and repro this issue in my side.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Best way to use return values in a webservices

    Hi all,
    Scenario: We have three web services. What is the best way to do this acitivity or is it possible?
    webservice1
    webservice2
    webservice3
    Call invoke webservice1 & 2 (they need to their work do be done parallely and will return a value eg "string")and call webservices3 with input values as the returned value from webservice 1 & 2.
    Thanks,
    Shashi
    Edited by: Shashi_sr on Sep 17, 2010 1:46 PM

    Hi Shashi,
    The way to achieve your desired functionality is as follows:
    Create a flow activity, and within that flow activity, you will call web services (using an invoke activity) webservice1 and webservice2.
    After the flow activity, you will then use another invoke activity to call the 3rd webservice using the output given by the first 2 webservices.

  • How to handle return values in AppleScript

    Warning: AppleScript newbie on the loose without adult supervision.
    I have an Omnis Studio app that calls an AppleScript that in turn invokes a couple of shell commands. As an aside, I don't believe Omnis Studio can invoke a shell script directly without other complications.
    What I would like to do is capture the return code and/or any stdout from the shell commands in the AppleScript, then pass that result out as a return value from the AppleScript.
    Q1. How does one hold the return values, exit code, stdout, etc. of a shell script in AppleScript?
    Q2. How do I tell AppleScript to pass the results back to the calling routine?
    Examples, links to documentation, etc, will be gratefully accepted.

    There is a whole forum for just Applescript here:
    http://discussions.apple.com/forum.jspa?forumID=724

  • Accessing function's return value

    Hi there. I have created several pl/sql procedures and functions that I can run as standalone programs and I have no problem integrating them into my java code also. However I cannot access the return value of any created function from my java code. The functions appear to execute correctly because when I deliberately enter an invalid select statement I get the errors I expect to get for that instance nad if I enter a valid select statement in the function the program executes correctly but I still cannot access the function's return value. My java code where I execute the pl/sql function is as follows:
    CallableStatement p = cont.conn.prepareCall("{call ? := Hellen.FUNC}");
    p.setString(1, "z006"); //hellen.FUNC = function name
    p.execute();
    How do I access the return value of my function?
    Do I need to get a ResultSet?
    My function is as follows:
    function func
    return varchar
    is tester varchar(4);
    BEGIN
    select cfcc_code into tester from hellen.test1 where test1.cfcc_code = 'A21';
    return tester;
    END;
    Any help will be gratefully received, Joe

    You need to do something like
    p.registerOutParameter(1, java.lang.String);
    p.execute();
    String result = p.getString(1);Cheers, APC

  • Help : Complex parameter and return value in WebService?

    Hi guys
       These days, I publish a WebService, in it there is an
    operation like this:
       List search(List para);
       in this operation, parameter "para" is a java.util.List, which contains many elements, every element is an instance of customizing class "MyItem", I made "MyItem" implements java.io.Serializable interface. Strangely, when I call this operations in my java client,
    I found that I could not get out every element from para in server-side, but para.size() is showing it contains 10 elements in it. The same thing happen to the return value of this operation, in client, I got an instance of java.util.List class as the return value, when I try
    System.out.println(result.get(0)); it output "null", but
    result.size() is 10, I don't know how to explain this
       Does anyone who encounter this issue too?
    I guess it has something to with the Serializable issue ,but I have made every List item serializable, why it looks like this??

    Hi Kevin,
    I answered you by mail some days ago, but just to complete the thread, I am posting the hint also here:
    Custom types should be manually added to the Virtual Interface, so that they can be serialized.
    Best regards,
    Alexander

  • Display and return value in select list.

    hi,
    i want to display the value in select list coming from this quary .
    select student_id from class_record where class_id =:p1_class_id and SECTION =:p1_section
    minus
    select student_id from STUDENT_TYPE_DETAILS where class_id =:p1_class_id and SECTION =:p1_section;
    but i want f_name and last name with student_id .f_name and l_name store in table s_per_det.student is also in that table.
    how can i define display value and return value in this quary using 3rd table s_per_det.
    How can i do this.
    Thanks
    manoj

    Ooh, MINUS.... Can you not use a NOT EXISTS in this case, could have a big effect on the execution plan?
    Something like this perhaps?
    SELECT f_name||' '||l_name,
           stundent_id
    FROM class_record a,
         s_per_det b
    WHERE a.student_id = b.student_id
    AND   a.class_id   = :P1_CLASS_ID
    AND   a.section    = :P1_SECTION
    AND   NOT EXISTS(SELECT 'X'
                     FROM student_type_details c
                     WHERE a.student_id = c.student_id
                     AND   c.class_id = :P1_CLASS_ID
                     AND   c.section = :P1_SECTION)Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • How to get return values from task flow in af:region ?

    Hi!
    I'm working with a taskFlow that is rendered inside a popup using the "popup inside a region pattern" (http://www.oracle.com/technology/products/adf/patterns/popupregionpattern.pdf), but now this taskFlow has an input parameter and a return value definition. So the question is how to get a value returned by this taskFlow thas is called inside a region?
    Any suggestion?
    Thanks in advance!

    Hi,
    write the value to a shared memory scope like session and read it in the regionNavigation listener. If you follow the paper you refer to then the listener determines of the viewId is null, this a return happens. It wuld then look in the memory scope for the return value.
    Another option would be to use an object that you pass as an argument to the task flow you open in the popup. Then you change the object you passed in, which then makes the return information available in teh calling flow. The object you pass in would have to be in a shared scope too
    Frank

  • Return values from a jpd to a jpf

    I basically want to call a jpd from a page flow and then receive the results back from the jpd in my page flow. I have created a process control from the jpd and have included it in my page flow controller file using the following annotation.
    * @common:control
    private controls.leaveProcessPControl leaveControl ;
    But since my jpd has a client response node for sending back the results (which corresponds to callback interface in the code), my page flow controller file is throwing an error saying that leaveControl implements a callback interface and page flow cannot receive asynchronous callbacks. Can anyone tell me how to resolve this.
    I would also like to know if there are different approaches for returning values back to the jpf from a jpd.
    Thanks,
    RK

    We are talking web interface here, so forget about Callbacks. I suggest that
    you create Web Servicethat implements your proces or a control that calls
    proces. Then Call that WS fro a controller, but in sync. way. Send a request
    and then pull for response. This pull can be implemented as while loop in
    Controler, with wait inside loop.
    That wont work realy well if jour proces is long running, as controller will
    block. In that case you will have to implement some kind of pulling in every
    action method in your controller and react - fill data in internal variable
    of controller for example.
    I hope it helps, butt remember thin is not always the best.
    "rohini k" <[email protected]> wrote in message
    news:4042178.1101851602508.JavaMail.root@jserv5...
    I basically want to call a jpd from a page flow and then receive the
    results back from the jpd in my page flow. I have created a process control
    from the jpd and have included in my page flow controller file using the
    following annotation.
    * @common:control
    private controls.leaveProcessPControl leaveControl ;
    But since my jpd has a client response node for sending back the results
    (which corresponds to callback interface in the code), my page flow
    controller file is throwing an error saying that leaveControl implements a
    callback interface and page flow cannot receive asynchronous callbacks.
    Can anyone tell me how to resolve this.
    I would also like to know if there are different approaches for returning
    values back to the jpf from a jpd.
    Thanks,
    RK

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

Maybe you are looking for

  • Problems Installing ColdFusion 9 (64 bit) on Windows 7 and IIS 7.5

    Problem:  Empty response for static Files including images, CSS and js files. The response code is 200 OK, but there is no actual response (it's empty). The ColdFusion Administration web site works correctly except it's not displaying any images, css

  • JCO_ERROR_FIELD_NOT_FOUND

    Hi All, My  problem is that the message flows through the outbound proxy( From R3) into the XI but after that it is failing at the outbound side. The Error is as follows (127) JCO_ERROR_FIELD_NOT_FOUND: Field DYNAMIC not a member of INPUT at com.sap.

  • Internal airport card ID

    I have a G5 imac 3 1/2 years old and where do I find what card is installed from the factory? 802 n or 802 g or what the card is. Thank You Dcik

  • A problem with events

    Hi, first of all, sorry for my poor english :( My problem is: Have a page jsf with 2 SelectOneMenu and 1 commandButton like this <h:selectOneMenu binding="#{nuevoExpediente.cbObra}" valueChangeListener="# {bean.cbObra_OnChange}" onchange="submit()" >

  • GRC AC 10 Mitigation Tables

    Is anyone aware of the specific tables that contain the mitigating control data (description, name, ID, organization, etc)? I'm aware of the mitigation control object tables (user, role etc). Also is the only ay to import the mitgating controls throu