Queue returns blank strings from template VI

I have created a master VI which creates a named queue, this VI then spawns multiple copies of a template VI. These sub VIs all gain access to the queue and try writing data to it. I understood that the queue VI was protected so this should not cause a problem. Infact this does not work at all, when i extract element within the master VI it only finds a few of the elements and returns blank strings between. Help what is going on. I am not destroying the queue or such, it seems to be a problem with the protection of the queue when using template VIs.
Cheers Tom.

I have not been able to reproduce the problem on LV 6.0.2 Win98. Do you check the error cluster when an empty element is returned? Posting your code might help to find the problem.
LabVIEW, C'est LabVIEW

Similar Messages

  • Returning XML String From Servlet

              Is there a simple way to disable the HTML character escaping when returning
              a string from a servlet. The returned string contains well formed XML, and
              I don't want the tags converted to > and < meta characters in the
              HTTP reply.
              The code is basically "hello world", version 7.0 SP2.
              Thanks
              > package xxx.servlet;
              >
              > import weblogic.jws.control.JwsContext;
              >
              >
              > /**
              > * @jws:protocol http-xml="true" form-get="false" form-post="false"
              > */
              > public class HelloWorld
              > {
              > /** @jws:context */
              > JwsContext context;
              >
              > /**
              > * @jws:operation
              > * @jws:protocol http-xml="false" form-post="true" form-get="false" soap-s
              tyle="document"
              > * @jws:return-xml xml-map::
              > * <HelloWorldResponse xmlns="http://www.xxx.com/">
              > * {return}
              > * </HelloWorldResponse>
              >
              > * ::
              > * @jws:parameter-xml xml-map::
              > * <HelloWorld xmlns="http://www.xxx.com/">
              > * <ix>{ix}</ix>
              > * <contents>{contents}</contents>
              > * </HelloWorld>
              >
              > * ::
              > */
              > public String HelloWorld(String s)
              > {
              > return "<a> xyz </a>";
              > }
              > }
              

              Radha,
              We have a client/server package which speaks SOAP over a
              streaming HTTP channel for which we are writing a WebLogic
              servlet. For reasons of efficiency, we want to deserialize
              only the very top-level tags of the messages as they pass
              through the servlet. Yes, in theory, we should probably
              deserialize and validate the entire message contents...
              When we add support for other clients, we will fully
              deserialize inside those servlets.
              I have not looked any further into how to stop the inner
              tags from being escaped yet -- it is an annoyance more than
              a disaster, since the client handle meta escapes.
              My current guess is to use ECMAScript mapping...
              -Tony
              "S.Radha" <[email protected]> wrote:
              >
              >"Tony Hawkins" <[email protected]> wrote:
              >>
              >>Is there a simple way to disable the HTML character escaping when returning
              >>a string from a servlet. The returned string contains well formed XML,
              >>and
              >>I don't want the tags converted to > and < meta characters in the
              >>HTTP reply.
              >>
              >>The code is basically "hello world", version 7.0 SP2.
              >
              >>
              >>Thanks
              >>
              >>> package xxx.servlet;
              >>>
              >>> import weblogic.jws.control.JwsContext;
              >>>
              >>>
              >>> /**
              >>> * @jws:protocol http-xml="true" form-get="false" form-post="false"
              >>> */
              >>> public class HelloWorld
              >>> {
              >>> /** @jws:context */
              >>> JwsContext context;
              >>>
              >>> /**
              >>> * @jws:operation
              >>> * @jws:protocol http-xml="false" form-post="true" form-get="false"
              >>soap-s
              >>tyle="document"
              >>> * @jws:return-xml xml-map::
              >>> * <HelloWorldResponse xmlns="http://www.xxx.com/">
              >>> * {return}
              >>> * </HelloWorldResponse>
              >>>
              >>> * ::
              >>> * @jws:parameter-xml xml-map::
              >>> * <HelloWorld xmlns="http://www.xxx.com/">
              >>> * <ix>{ix}</ix>
              >>> * <contents>{contents}</contents>
              >>> * </HelloWorld>
              >>>
              >>> * ::
              >>> */
              >>> public String HelloWorld(String s)
              >>> {
              >>> return "<a> xyz </a>";
              >>> }
              >>> }
              >>
              >>
              >Hi Tony,
              >
              > Can you let me know for what purpose you want to disable the
              >HTML character
              >escaping.In case if you
              >
              >have tried this using someway,pl. let me know.
              >
              >rgds
              >Radha
              >
              >
              

  • Returning the string from the SimpleDateFormat

    Hi guys,
    Can someone tell me how to return the string from the SimpleDateFormat?
    I've created the method to do this, but i don't know the exact code to use. Here's my code so far...
        public String convert (Calendar gc)
            String s = convert(gc);
            return // I need to return the s here, but don't know how to code it.
        }BTW, i've already wrote the code for the SimpleDateFormat (so if you want me post that, i will).

    DrLaszloJamf wrote:
    LevelSix wrote:
    DrLaszloJamf wrote:
    No.Can you tell me what it is, because i've went through the API and i don't know.
    Have you looked for a tutorial: [http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html]
    Thanks a lot DrLaszloJamf, this is useful.
    DrClap wrote:
    Nope. Suppose you were on a construction site and the foreman told you to move a pile of concrete blocks from a truck into the building. What do you suppose would happen if you asked the foreman what a concrete block was, and where the building was, and whether you should drive the truck into the street, and then you tried to pick up the whole pile all at once, and then you asked if you could kick the blocks like footballs? This is what you're doing here. You'd be fired from the construction site within half an hour.Sir...

  • Return a string from a method: a problem in C++ but is it a problem in java

    I have a method which return a String from it as:
    String pattern(short i)
    String s="":
    if (i==1)
    s = "test1";
    else
    s = "test2";
    return s;
    Since s is a local vaariable to pattern(), does the code above
    create problems? I know it is a problem for C++ since the local
    variable memory address will be reused by others and thus the
    returned value may take other values sometime later or not
    readable.

    Actually, this is not a problem in C++ either if you
    just use the string class instead of the old-style
    char* from C.True, I was assuming he/she meant (in C++):
    char mylocalbuf[80];
    // put stuff in mylocalbuf here
    return mylocalbuf;
    which would be very very bad to do indeed.

  • Returning a string from one class to another

    I have a file from where i creating an object of another class and calling the fuctionsl
    This is how i am doing
    public login()
    String input =new String (passwordField.getPassword());
         input= input.trim();
    tempuser= userField.getText();
              db2sqln patientsqln =new db2sqln(); //creating an object
              patientsqln.connectdb2();// calling a connect to database function
              patientsqln.dbselect(tempuser);// passing the login informaiont
    in patientsqln i am getting the password from the database and want to pass it back to login class so that i can compare the entered password and the database password
    here is i am using my patientsqln.dbselect()
    //public void dbselect(String userinput)
              try
              Statement stmt = con.createStatement();
              String select = "Select patientpass from patient where PATIENTUSER="+"'"+userinput+"'";
              ResultSet rs = stmt.executeQuery(select);
              while (rs.next())
              name=rs.getString("PATIENTPASS");
              name = name.trim();
              System.out.println(name+"from db2sqln");
              rs.close();
    My question is that everything else works fine, but i donot get any password back in login() class it returns null value. looks like i am not returing the string back. how should i do that
    I am comparing like this
    if(input.equals("name"))
    System.out.println("Correct password");
    else{
    System.out.println("Incorrect password");
    //

    I have a file from where i creating an object of another class and calling the fuctionsl
    This is how i am doing
    public login()
    String input =new String (passwordField.getPassword());
    input= input.trim();
    tempuser= userField.getText();
    db2sqln patientsqln =new db2sqln(); //creating an object
    patientsqln.connectdb2();// calling a connect to database function
    patientsqln.dbselect(tempuser);// passing the login informaiont
    in patientsqln i am getting the password from the database and want to pass it back to login class so that i can compare the entered password and the database password
    here is i am using my patientsqln.dbselect()
    //public void dbselect(String userinput)
    try
    Statement stmt = con.createStatement();
    String select = "Select patientpass from patient where PATIENTUSER="+"'"+userinput+"'";
    ResultSet rs = stmt.executeQuery(select);
    while (rs.next())
    name=rs.getString("PATIENTPASS");
    name = name.trim();
    System.out.println(name+"from db2sqln");
    rs.close();
    My question is that everything else works fine, but i donot get any password back in login() class it returns null value. looks like i am not returing the string back. how should i do that
    I am comparing like this
    if(input.equals("name"))
    System.out.println("Correct password");
    else{
    System.out.println("Incorrect password");
    //

  • How do I execute a returned sql string from a function on the command line?

    Hi,
    I have written a pl/sql function that will dynamically create a sql select statement. I need to be able to execute this statement from the command line. e.g from sqlplus
    Say my function is called "sql_create" and it returns "select * from customer"
    How do I execute the returned value from the command line?" Is it possible?
    SQL> select sql_create from dual;
    SQL_CREATE
    select * from customer
    SQL>
    So I try:
    SQL> exec execute immediate 'select sql_create from dual';
    SQL>
    I don't get an error but I don't get the result set either.
    Is there a command I can use instead of execute immediate?
    thanks,
    Susan
    Edited by: Susan123456 on Jul 2, 2009 1:21 AM

    depends on the frontend. Most frontends (like Java and .Net) know how to handle REF CURSORS. Instead of returing a "string" which represents a query, return a ref cursor
    SQL> ed
    Wrote file afiedt.buf
      1  create function sql_q return sys_refcursor
      2  is
      3     rc sys_refcursor;
      4  begin
      5     open rc for select * from emp;
      6     return rc;
      7* end;
    SQL> /
    Function created.
    SQL> var r refcursor
    SQL>
    SQL> exec :r := sql_q
    PL/SQL procedure successfully completed.
    SQL> print r
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        900                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1700        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1350        500         30
          7566 JONES      MANAGER         7839 02-APR-81       3075                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1350       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2950                    30
          7782 CLARK      MANAGER         7934 09-JUN-81       2551                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3100                    20
          7839 KING       PRESIDENT            17-NOV-81       5100                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1600          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1200                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81       1050                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3100                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1400                    10

  • Awk returns different string from what appears to be the exact same?

    Hey, this is more of a general awk issue. 
    I'm running Arch on an x200 Thinkpad tablet and trying to improve on the rotate script in the wiki.
    Currently, the wiki's script has predefined values for the stylus/eraser devices that don't work for all systems (mine for example).  I would like to make it so that these device names are discovered by the script at runtime so that the user doesn't have to edit the script to make it work.
    In order to do this, I'm using
    stylus="$(xsetwacom --list | grep STYLUS | awk '{$NF="\b"; print}')"
    and likewise for the eraser.
    The problem is that when the script runs, it says "Cannot find device 'Serial Wacom Tablet stylus'." even though that's the exact thing I had in the script before messing with the variable assignment. 
    What makes these strings different? Is there some nuance of awk that I'm missing?

    #!/bin/bash
    #### rotate.sh - A script for tablet PCs to rotate the display.
    ## This software is licensed under the CC-GNU GPL.
    ## http://creativecommons.org/licenses/GPL/2.0/
    ## http://wiki.archlinux.org/index.php/Tablet_PC
    ## REQUIRES: linuxwacom (http://linuxwacom.sourceforge.net/)
    #### Function(s)
    function set_normal {
    xsetwacom set "$stylus" Rotate 0
    xsetwacom set "$eraser" Rotate 0
    xrandr -o normal
    function set_right {
    xsetwacom set "$stylus" Rotate 1
    xsetwacom set "$eraser" Rotate 1
    xrandr -o right
    function set_left {
    xsetwacom set "$stylus" Rotate 2
    xsetwacom set "$eraser" Rotate 2
    xrandr -o left
    function set_inverted {
    xsetwacom set "$stylus" Rotate 3
    xsetwacom set "$eraser" Rotate 3
    xrandr -o inverted
    #### Variable(s)
    orientation="$(xrandr --query --verbose | grep connected | grep -v dis | awk '{print $5}')"
    eraser="$(xsetwacom --list | grep ERASER | awk '{$NF="\b"; print $0}')"
    stylus="$(xsetwacom --list | grep STYLUS | awk '{$NF="\b"; print $0}')"
    #### Main
    if [ "$orientation" = "normal" ]; then
    set_right
    elif [ "$orientation" = "right" ]; then
    set_inverted
    elif [ "$orientation" = "inverted" ]; then
    set_left
    elif [ "$orientation" = "left" ]; then
    set_normal
    fi
    #### EOF
    Like I said, a slight modification of the original wiki script. 
    xsetwacom --list returns
    Serial Wacom Tablet stylus STYLUS
    Serial Wacom Tablet eraser ERASER
    Edit:
    I whipped up a short script to illustrate my problem
    #! /bin/bash
    therightthing="Serial Wacom Tablet stylus"
    stylus="$(xsetwacom --list | grep STYLUS | awk '{$NF="\b"; print}')"
    if [ "$therightthing" = "$stylus" ]; then
    echo "Equal"
    else
    echo "Not Equal"
    echo "$stylus |"
    echo "$therightthing |"
    fi
    The vertical line is my check for trailing whitespace.  When run, it returns that they're not equal, but the strings look the exact same.
    Output:
    Not Equal
    Serial Wacom Tablet stylus |
    Serial Wacom Tablet stylus |
    Last edited by Pursuit (2010-09-27 23:05:39)

  • Returning strings from OLE2 Word object (Forms 4.5)

    Below is an example of how to return string and numeric values from OLE2 objects. In this example the OLE2 object is a MS Word document, and I want to fetch all the bookmarks in the Document into a Forms 4.5 Varchar2. To do this I first need to get the count of bookmarks.
    Getting a string property from an OLE2 object is a common OLE2 requirement but is poorly documented. This is the ONLY way it can be done, as OLE2.INVOKE_CHAR returns a single character not a string. Use OLE2.INVOKE_OBJ, then OLE2.GET_CHAR_PROPERTY which does return a string, as shown below, to return a string from an OLE object (or OLE property).
    Also note how you can only get the child object from its parent, not the grandchild (etc) object, so multiple (cascading) GET_OBJ_PROPERTY calls are required.
    /* by: Marcus Anderson (Anderson Digital) (MarcusAnderson.info) */
    /* name: Get_Bookmarks */
    /* desc: Returns a double quoted CSV string containing the document*/
    /* bookmarks. CSV string will always contain a trailing comma*/
    /* EG: "Bookmark1","Bookmark2",Bookmark3",Bookmark4", */
    /*               NB: This requires that Bookmarks cannot contain " chr */
    PROCEDURE Get_Bookmarks (pout_text OUT VARCHAR2)
    IS
    v_text           VARCHAR2(80);
    v_num                         NUMBER(3);
         v_arglist OLE2.LIST_TYPE;
         v_Application     OLE2.OBJ_TYPE;
    v_ActiveDoc      OLE2.OBJ_TYPE;
    v_Bookmarks          OLE2.OBJ_TYPE;
    v_Item                    OLE2.OBJ_TYPE;
    v_i                              NUMBER(3);
    BEGIN
              v_Application     := LDWord.MyApplication; -- Word doc opened elsewhere
                   /* Set v_num = ActiveDocument.Bookmarks.Count */
    v_ActiveDoc := OLE2.GET_OBJ_PROPERTY (v_Application, 'ActiveDocument');
    v_Bookmarks := OLE2.GET_OBJ_PROPERTY (v_ActiveDoc , 'Bookmarks');
    v_num := OLE2.GET_NUM_PROPERTY (v_Bookmarks, 'Count'); -- NB: Returns numeric property
                   /* Build the output string, pout_text. */
    FOR v_i in 1..v_num LOOP
                        /* Set v_item = ActiveDocument.Bookmarks.Item(v_i) */
    v_arglist := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG (v_arglist, v_i);
    v_Item := OLE2.INVOKE_OBJ (v_Bookmarks, 'Item', v_arglist); -- NB: returns parent object (array element)
    OLE2.DESTROY_ARGLIST (v_arglist);
                        /* Set v_text = ActiveDocument.Bookmarks.Item(v_i).Name */
    v_text := OLE2.GET_CHAR_PROPERTY (v_Item, 'Name');                    -- NB: Returns string/varchar2 property
    pout_text := pout_text || '"' || v_text || '",' ;
    END LOOP;
    END;

    Please repost in the Forms discussion forum.
    - OTN

  • Returning String[] from C program

    How can I return a string[] from a cprogram to a java program?
    private native String[] readRFIDData();
    JNIEXPORT jobjectArray JNICALL Java_RfidDM_readRFIDData
    (JNIEnv *, jobject);
    Above is the definition of a jni method .
    I have gone through the sample code, but they explain how to return arrays from C++.
    Can someone please suggest? I am not good at C.
    Much thanks,
    Ann

    Thanks Scott.
    This code works fine for me...
         jclass sclass = (*env)->FindClass(env, "java/lang/String");
         jobjectArray ret = (*env)->NewObjectArray(env, length, sclass, NULL);
         for(i=0;i<37;i++){
              (*env)->SetObjectArrayElement(
                   env,ret,i,(*env)->NewStringUTF(env,&buf));     
              printf(&buf[i]);

  • Need to return String from C Program to Java

    I need to execute a C Program, which returns a string, from my java application. I was thinking of using RMI to execute this C program. Any idea ?

    There are lots of ways to do this. The simplist is probably for the C program to write it's output to a temporary file, and then have the java program read that file. Or, you could open a socket and pass the string that way (say, have your java program listen on a port and have the C program open a connection to the java program and write it's string).
    Hope that gives you a starter

  • Printing to PDF from CrystalReportViewing returns blank page

    Hi All,
       I have a web report that I run. When the report generates in the CrystalReportViewer I see my results. However, if I click the button to Print to PDF, it results in a PDF with no data. If I click on the Next button as well to go to the next page in my report, it returns blank results.
    This apparently started happening when I used date parameters being passed to my stored procedure:
            parameterField = report.ParameterFields("@callstdate")
            parameterField2 = report.ParameterFields("@callendate")
    I'm using VS 2008 and CR2008.
    Any ideas why this is happening?
    Thank you in advance,

    1)Any export type I use returns no data on the exported report
    2)Changed PDF to ActiveX and it printed the report with no data
    3)Remove parameters from my webapp and let the Viewer prompt for them. Now PDF works and everything else.
    Here's my code:
        Protected Sub display_report()
            parameterField.CurrentValues.Clear()
            parameterField2.CurrentValues.Clear()
            parameterField3.CurrentValues.Clear()
            CrystalReportViewer2.ParameterFieldInfo.Clear()
            parameterField = report.ParameterFields("@callstdate")
            parameterField2 = report.ParameterFields("@callendate")
            parameterField3 = report.ParameterFields("Group")
            For Each li As ListItem In Me.ListBox1.Items
                If li.Selected = True Then
                    ' Add all parameters value here
                    parameterField3.CurrentValues.AddValue(li.Value)
                End If
            Next
            report.SetParameterValue("@callstdate", CDate(st_date.Text))
            report.SetParameterValue("@callendate", CDate(st_date.Text))
            CrystalReportViewer2.ReportSource = report
        End Sub

  • Trouble returning String from JNI method

    I'm a JNI newbie who is going through the SUN online book on JNI and have put together the 2nd program example (right after "helloworld"), but it is not working right. It is supposed to prompt you for a string, then returns the string that you type in. Right now it compiles without error, but it returns only the first word that I type, not the whole sentence. What am I doing wrong?
    Here's the code:
    Prompt.java
    package petes.JNI;
    public class Prompt
        private native String getLine(String prompt);
        static
            System.loadLibrary("petes_JNI_Prompt");
        public static void main(String[] args)
            Prompt p = new Prompt();
            String input = p.getLine("Type a line: ");
            System.out.println("User typed: " + input);
    }petes_JNI_Prompt.h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class petes_JNI_Prompt */
    #ifndef _Included_petes_JNI_Prompt
    #define _Included_petes_JNI_Prompt
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     petes_JNI_Prompt
    * Method:    getLine
    * Signature: (Ljava/lang/String;)Ljava/lang/String;
    JNIEXPORT jstring JNICALL Java_petes_JNI_Prompt_getLine
      (JNIEnv *, jobject, jstring);
    #ifdef __cplusplus
    #endif
    #endifpetes_JNI_Prompt.c
    #include <jni.h>
    #include <stdio.h>
    #include "petes_JNI_Prompt.h"
    JNIEXPORT jstring JNICALL Java_petes_JNI_Prompt_getLine
      (JNIEnv *env, jobject this, jstring prompt)
         char buf[128];
         const jbyte *str;
         str = (*env)->GetStringUTFChars(env, prompt, NULL);
         if (str == NULL)
              return NULL;  /*  OutOfMemoryError already thrown */
         printf("%s", str);
         (*env)->ReleaseStringUTFChars(env, prompt, str);
         // assume here that user will ty pe in 127 or less characters
         scanf("%s", buf);
         return (*env)->NewStringUTF(env, buf);
    }Thanks in advance!
    /Pete

    OK, I have something that works now by substituting fgets for scanf. I have two other questions:
    1) Do I need to free the memory created in buf? Will it allocate memory every time the method is run? Or will it allocate only once on creation, and so is no big deal?
    2) A minor question: When I run this program in eclipse, the prompt string is displayed in the console only after the input string is entered and displayed. It works fine when I run it from the command line however. I have a feeling that this is a problem with how Eclipse deals with native methods and perhaps nothing I can fix. Any thoughts?
    Thanks
    Pete
    Addendum, the updated code:
    #include <jni.h>
    #include <stdio.h>
    #include "petes_JNI_Prompt.h"
    JNIEXPORT jstring JNICALL Java_petes_JNI_Prompt_getLine
      (JNIEnv *env, jobject this, jstring prompt)
         char buf[128];
         const jbyte *str;
         str = (*env)->GetStringUTFChars(env, prompt, NULL);
         if (str == NULL)
              return NULL;  /*  OutOfMemoryError already thrown */
         printf("%s", str);
         (*env)->ReleaseStringUTFChars(env, prompt, str);
         //scanf("%s", buf);
         fgets(buf, 128, stdin);
         return (*env)->NewStringUTF(env, buf);
    }Message was edited by:
    petes1234

  • Error returning large String arrays from web service

    Hi,
    I currently have an EJB that returns a String[] array that I have implemented as
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don't have a problem
    as long as the returned array is relatively small, but when the array starts to get
    a little larger (say 20 elements, about 30 chars each), I consistently get:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running under MS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as 15000 - 20000
    array elements in one call. And since I am calling the same Weblogic EJB with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I might be doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

    Hi Steve,
    Sure we're interested...I'll pass this along to the XML folks.
    Thanks for the feedback,
    Bruce
    Steve Alexander wrote:
    In case anyone is interested, I solved my problem. I was mis-diagnosing the problem
    - thinking it was a size issue when it actually was a data issue. On the calls where
    I was returning a large array, some of the array members were null. When I made them
    enpty strings "", it worked. Apparently the default SAX parser BEA uses doesn't like
    the nulls, whereas the MS parser doesn't care.
    "Steve Alexander" <[email protected]> wrote:
    Thanks Bruce,
    FYI - I have reproduced the problem on WL7.0. I have turned it in to support
    as you
    suggested.
    Steve
    Bruce Stephens <[email protected]> wrote:
    Hi Steve,
    This does not ring any bells, however I would suggest that you file a support
    case. If it
    is an option you might try a later release (7.0).
    Bruce
    Steve Alexander wrote:
    Hi,
    I currently have an EJB that returns a String[] array that I have implementedas
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don'thave a problem
    as long as the returned array is relatively small, but when the arraystarts to get
    a little larger (say 20 elements, about 30 chars each), I consistentlyget:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running underMS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as15000 - 20000
    array elements in one call. And since I am calling the same Weblogic
    EJB
    with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I mightbe doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

  • Returning strings from Java- C JNI calls

    <newbie to JNI>
    I have an application written in Java that accesses a .DLL written in C. The .DLL does low-level communication to a hardware device. I've got it all working except for one little problem:
    For all of the functions I need to return an integer return code and for some of them I also need to return a string, such as a serial number, version string, or whatever.
    Try as I might, I can't find any information on how to return two values from a function call (pretty sure I can't in Java).
    SO, I tried to find out how to stuff the version string into a string object variable in the class object the DLL API is defined in. I can't figure out how to do that either...
    e.g. the following Java code:
    class LLDev {
    /* --- Load the .DLL -------------------- */
    static { System.loadLibrary("LLDev"); }
    /* --- Error Codes ---------------------- */
    public static final int LLDOk = 0;
    public static final int LLDInitErr     = -1;
    /* --- Public Variables ----------------- */
    public static String DLLVersion;
    /* --- Public Methods ------------------- */
    public native int InitLLDev();
    When I invoke LLDev.InitLLDev() from Java I want the C .DLL function Java_LLDev_InitLLDev to put the DLL Version string in the LLDev object's DLLVersion field and return an error code as the function result.
    Is this possible???? Is this the right way to do this?? I tried to define the API with methods that return strings instead of integer return codes but the customer using the class wants all of the methods to return a return code in case of some error (e.g. reading the serial number from the device could fail...)

    1. In general, the java way to deal with errors is by throwing exceptions, not using return codes. But OK, you are stuck with the user requirement.
    2. I suggest you have the native method take as an argument a java object which will accept a string as input. In other words, it has a string "setter".
    3. So in your native method, if the function succeeds, it writes your string result to that object, and you can futrther process it when the native method returns a "success" code.
    4. There are JNI methods for
    o looking up the class of a java object.
    o looking up the method of a java class.
    o invoking the method.

  • Return String from values in int array

    Hi
    I am very new to Java and have been asked to carry out the following task.
    Returns a string version of counterGroups. For each
    group it gives its number (1 more than its index) and (in
    parentheses) the number of counters currently in that group.
    Each is followed by two spaces. Thus if there are 3 groups
    with 7, 9 and 11 counters the string returned is
    "1(7) 2(9) 3(11) "
    I have created an array of type int referenced by counterGroups. It stores values 7,9 and 11.
    I have made a start on my method but I am struggling. Any help would be appreciated. Please see my method below to see how far I have got. It does not compile.
    public String toStr()
    String output1;
    String temp;
    String other;
    for (int i=0; i<counterGroups.length(); i++)
    int num1 = counterGroups;
    output1 = String.valueOf(num1);
    other = "(" + output1 + ")";
    temp =
    int num1 = counterGroups[0];
    output1 = String.valueOf(num1);
    return "(" + output1 + ")";
    regards
    Paul

    When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
    Paste in the exact error message and clearly indicate which line it's complaining about.

Maybe you are looking for

  • New field data not passed from BupaSearch to BupaCreate

    Hi, We have 2 new fields on BupaSearch. When we hit the create button to create a new BP, any data entered in the 2 new fields is not then passed through to the BupaCreate view. I've debugged in method 'CREATE_ACCOUNT' in BupaSearch, where it sets up

  • Many users--Major issues--Apple doesn't seem to know or care

    I fear that this post is borderline inappropriate to this forum, but I'm going to throw it out there because I'm feeling quite like the neglected stepchild of Apple as of late. Many, many users are having trouble with their iPods/iTunes since upgradi

  • Changing the printer cartridges for a HP laserjet 2840

    Having a problem with the wheel not going to the next cartridge...there is a message on the display saying "incorrect yellow" but the yellow cartridge has been taken out and it will not go to the next slot. I am out of warranty and need my printer ca

  • Why do photos come back after deletion on the IMAC?

    The photos continue to show back up after deletion???

  • Header for ADF Input Date Component.

    Hi, I am using af:inputdate, if i click icon it will display a popup which is of choose date(in which we can select the date). For the choose date popup i need a header like"Choose Date". How to do it. If i add a tag in af:convertdatetime with in af: