Impossible to get a String field with GetFieldID !!!!!!

Hi, I write here my classes and explain my problem :
------------------------- Class Lexicon.java ---------------------------
package SlpTkJava.JavaCode;
public class Lexicon {
public native void next(SearchReturn search);
static {
System.loadLibrary("slptkjava");
--------------------------- Class SearchReturn.java --------------------
package SlpTkJava.JavaCode;
public class SearchReturn {
public LexItem access;
-------------------------- Class LexItem.java --------------------------
package SlpTkJava.JavaCode;
public class LexItem {
public int lemma;
public String graphy;
--------------------------- File Lexicon.c -----------------------------
* Class: SlpTkJava_JavaCode_Lexicon
* Method: next
* Signature: (LSlpTkJava/JavaCode/SearchReturn;)V
JNIEXPORT void JNICALL Java_SlpTkJava_JavaCode_Lexicon_next(JNIEnv *env,
                                   jobject obj,
                                   jobject search){
jfieldID accessFID, graphyFID, lemmaFID;
jclass searchReturnCls, lexItemCls;
jobject access;
searchReturnCls = (*env)->FindClass(env, "SlpTkJava/JavaCode/SearchReturn");
if ((*env)->ExceptionOccurred(env)){
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
accessFID = (*env)->GetFieldID(env, searchReturnCls, "access", "LSlpTkJava/JavaCode/LexItem;");
if ((*env)->ExceptionOccurred(env)){
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
access = (*env)->GetObjectField(env, search, accessFID);
if ((*env)->ExceptionOccurred(env)){
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
lexItemCls = (*env)->FindClass(env, "SlpTkJava/JavaCode/LexItem");
if ((*env)->ExceptionOccurred(env)){
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
lemmaFID = (*env)->GetFieldID(env, lexItemCls, "lemma", "I");
if ((*env)->ExceptionOccurred(env)){
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
graphyFID = (*env)->GetFieldID(env, lexItemCls, "graphy", "LJava/lang/String;");
if ((*env)->ExceptionOccurred(env)){
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
When I run this function in a testFile, I get this exception :
Exception in thread "main" java.lang.NoSuchFieldError: graphy
at SlpTkJava.JavaCode.Lexicon.next(Native Method)
at TestLexicon.main(TestLexicon.java:58)
I can't understand because the system can load the int field from the "access" object and not the String field !
I can precise that I'm on Solaris.
Please help me it's urgent !
Thank you.
Zigune

I think your problem is:
graphyFID = (*env)->GetFieldID(env, lexItemCls, "graphy", "LJava/lang/String;");
should be
graphyFID = (*env)->GetFieldID(env, lexItemCls, "graphy", "Ljava/lang/String;");
i.e. java/lang/String - java is lower case.

Similar Messages

  • How to set a string field with people picker control group

    Hi Guys
    I have a problem with a form list, when I need to set a string field with de content of people picker control that have more than one "user".
    Is there any way to put in string a list of user like the people picker control shows in a form?
    The really problem is I don't know how to read an array of user in a formula rule.
    any example or idea should be appreciated.
    tnks.

    Hi ,
    Please try out in following way :
            /// <summary>
            /// Set value to people picket control
            /// </summary>
            /// <param name="key"></param>
            /// <param name="ppl"></param>
            /// <param name="item"></param>
            private void SetDatatoPeopleEditor(string key, PeopleEditor ppl, SPListItem item)
                try
                    if (item[key] != null)
                        string users = string.Empty;
                        SPFieldUserValueCollection userCol = new SPFieldUserValueCollection(web, item[item.Fields.GetField(key).Id].ToString());
                        foreach (SPFieldUserValue usrItm in userCol)
                            users += usrItm.User.ToString() + ",";
                        ppl.CommaSeparatedAccounts = users.Remove(users.LastIndexOf(","), 1);
                catch (Exception ex)
                    lblErrorMessage.Text = ex.Message;
    private SPUser GetAccountName(PeopleEditor accountPE)
                SPUser user = null;
                string strAccountName = String.Empty;
                try
                    for (int i = 0; i < accountPE.ResolvedEntities.Count; i++)
                        PickerEntity objEntity = (PickerEntity)accountPE.ResolvedEntities[i];
                        user = web.AllUsers[objEntity.Key];
                    return user;
                catch (Exception ex)
                return user;
    It works for me .

  • Getting all VARCHAR fields with string length different then x

    Hello,
    I am trying to get from a table all the rows which contain in a certain varchar field a string length different than x (5 i.e.):
    varchar field
    treds
    fd <-
    grgrt
    sdfsdfsdf <-
    fdsds
    the marked rows will been given out.
    Thanks!

    Term, the Oracle SQL manual contains documentation on the Oracle functions. Most of the functions can be classified as either character functions, number (math) functions, date functions, and conversion functions.
    If you are going to work with Oracle you will benefit from looking on the list of available functions to become familiar with what is available.
    HTH -- Mark D Powell --

  • How to get the search field with API UCM  for a specific UCM Profil

    We have UCM 10g
    For the checkIn we have for exemple the URL : http://xp-ucm1.oth.prs/idc/idcplg?IdcService=CHECKIN_NEW_FORM&dpTriggerValue=1&dpDisplayLabel=Codification%201&IsSoap=1
    To obtain all the field for the checkIn is very simple with this service(IdcService=CHECKIN_NEW_FORM) and RIDC, but for search we don't find the idc service ?
    <SOAP-ENV:Envelope>

    <SOAP-ENV:Body>

    <idc:service IdcService="CHECKIN_NEW_FORM">

    <idc:document dRevLabel="1" dUser="sysadmin" dDocName="" dDocTitle="">
    <idc:field name="xClbraUserList:isExcluded">1</idc:field>
    <idc:field name="xsgti_top_rule:isSetDefault">1</idc:field>
    <idc:field name="xlist1:isExcluded">1</idc:field>
    <idc:field name="xsgti_g_ll_niv1_1:isExcluded">1</idc:field>
    <idc:field name="xsgti_chrono_soc"/>
    <idc:field name="xsgti_g_entier4:isExcluded">1</idc:field>
    any ideas

    Hi,
    In fact, I don't want to send parameters to the search service but to get the fields to display an advanced search form of my own.
    Some rules and profiles filters the amount of fields availables and having a service that can do this filtering for me would be very useful.
    The check-in service do this for a trigger value (profile), but I can't find how UCM uses services to display the search form with the right fields depending on the rules and rights of the user.
    When I call a search form, UCM calls a service : http://xxx.xxx.xxx.xxx:xx/idc/idcplg?IdcService=GET_DOC_PAGE&Action=GetTemplatePage&Page=STANDARD_QUERY_PAGE&dpTriggerValue=xxx&dpDisplayLabel=xxx
    But with &IsSoap=1, the values returned are not good, some fields are missing, the field captions are not right... I guess UCM calls sub-services but which ones ?
    Thanks :)

  • Get a strings length with FontMetrics

    Hi,
    I am using the following code to get the width of a string with FontMetrics. The problem is that the ToolKit .getFontMetrics has been deprecated. My class is a going to be used by a xslt stylesheet, so I do not have Components. How do I obtain the width of a string without a component?
    import java.awt.Font;
    import java.awt.FontMetrics;
    import java.awt.Toolkit;
    public class StringLength {
         public static void main(String[] args) throws NumberFormatException {
              if(args.length < 2){
                   System.out.println("StringLength <string> <int font size>");
                   System.exit(0);
              }else{
                   getStringLength(args[0], Integer.parseInt(args[1]));                                   
         @SuppressWarnings("deprecation")
         public static int getStringLength(String str, int size){
              Toolkit toolkit =  Toolkit.getDefaultToolkit();
              int stringlen = 0;                    
              Font font = new Font("Arial", Font.PLAIN, 9);          
              FontMetrics fontMetrics = toolkit.getFontMetrics(font); //Depreciated
              System.out.println ("[Stylesheet Info] Calculating width for: " + str + ": "  + fontMetrics.stringWidth(str));
              stringlen = fontMetrics.stringWidth(str);     
              return stringlen;
    }

    Thanks - when all else fails, read the directions :)
    Solution:
    Font font = new Font("Arial", Font.PLAIN, 9);
    FontRenderContext frc = new FontRenderContext(null, false, false);          
    int stringWidth = (int)font.getStringBounds(str, frc).getWidth();
    System.out.println ("[Stylesheet Info] Calculating width for: " + str + ": "  + stringWidth);          
    return stringWidth;

  • How to programati​cally get enum strings in RT code?

    Hi all,
    In desktop programs, I can programatically get a list of enum strings by creating a (possibly-hidden) FP control, linking it to a property node, and reading from the Strings[] property.
    Unfortunately, property nodes aren't supported on RT targets. What other options are there?
    Thanks in advance!

    I'm assuming you have one value of an Enum (from, say, a Control, or possibly from an "Enum constant" that you have available) and want to create an array of strings holding all possible values of the Enum.  There are two really nice features that LabVIEW has to allow you to easily accomplish this goal.
    First, the Format into String function will accept an Enum and will return a String representing it's "value", i.e. if you create an Enum for a State Machine with values "Initialize", "Acquire", "Process", and "Exit" (corresponding to numbers 0, 1, 2, 3), then putting the Initialize Enum into Format into String returns the string "Initialize".
    The other nice feature is that the Increment function (on the Numerics page) "wraps around" on Enums, so that incrementing "Exit" (in the previous example) gives you "Initialiize"
    So consider the following:  Create a For Loop with a Shift Register and a tunnel beneath it.  Wire "Initialize" into both the Shift Register and the Tunnel.  Inside the For Loop, take the value on the Shift Register, get its String representation with Format into String (and bring it out through an Indexing tunnel), increment it and connect the incremented value to the output Shift Register.  Wire this incremented value, along with the input tunnel holding the initial value, into an "Is Equal?" comparator that you wire to the While's Stop control.
    This will neatly step through every value of the enum exactly once (as it exits when the "wrap-around" occurs), giving you an array corresponding to the values of the Enum.  If you start the process with the first Enum value (using a Constant, for example), the String Array will exactly correspond to your Enum (that is, the first element will be the name of the first Enum value), but even if you put an arbitrary member of the Enum as the input, you will still get an array of all of the Enum values.
    Bob Schor

  • Need help with string field formula

    Post Author: dshallah
    CA Forum: Formula
    What I am trying to accomplish:
    The report has item numbers and each item number has the
    potential to be associated with up to three u2018binsu2019. So the fields are u2018item
    numberu2019, u2018bin1, u2018bin2u2019 and u2018bin3u2019.
    I tried to write a u2018if thenu2019 statement that would only show
    records that had a value of less than 1 in each u2018binu2019 field. When I try to
    write the statement I get a message that says u2018A string is required hereu2019 and
    it highlights the number 1 in my statement. I have a feeling itu2019s because the u2018binu2019
    fields are string fields and not number fieldsu2026? So I am not sure the proper
    procedure to correct this. Thus help is needed and appreciated.
    Here is what I wrote:
    if {IC_LOC_HIST.BIN_NAME_1} < 1 then
    {IC_LOC_HIST.BIN_NAME_1}
    What is correct way to write a statement that will show me
    the zero values in each column of bin fields?
    Thanks!

    Post Author: bettername
    CA Forum: Formula
    You must have a non-numeric value in there somewhere - up in the top left of the formula editor window, it'll show you the variables you've passed to the formula, which should help track down what's going on.
    You could try and check that the value is a number first by using something like:
    if isnull({IC_LOC_HIST.BIN_NAME_1}) = false and isnumeric({IC_LOC_HIST.BIN_NAME_1}) = false and then "Error - Should be a Number!"
    else
    if isnumeric({IC_LOC_HIST.BIN_NAME_1}) = true and tonumber({IC_LOC_HIST.BIN_NAME_1})<1 then {IC_LOC_HIST.BIN_NAME_1})

  • A record selection problem with a string field when UNICODE database

    We used report files made by Crystal Reports 9 which access string fields
    (char / varchar2 type) of NON-UNICODE database tables.
    Now, our new product needs to deal with UNICODE database, therefore,
    we created another database schema changing table definition as below.
    (The table name and column name are not changed.)
        char type -> nchar type
        varchar2 type -> nvarchar2 type
    When we tried to access the above table, and output a report,
    the SQL statement created from the report seemed to be wrong.
    We confirmed the SQL statement using Oracle trace function.
        SELECT (abbr.) WHERE "XXXVIEW"."YYY"='123'.
    We think the above '123' should be N'123' because UNICODE string
    is stored in nchar / nvarchar2 type field.
    Question:
    How can we obtain the correct SQL statement in this case?
    Is there any option setting?
    FYI:
    The environment are as follows.
        Oracle version: 11.2.0
        ODBC version: 11.2.0.1
        National character set: AL16UTF16

    With further investigating, we found patterns that worked well.
    Worked well patters:
        Oracle version: 11.2.0
        ODBC version: 11.2.0.1
        National character set: AL16UTF16
        Report file made by Crystal Reports 2011
        Crystal Reports XI
    Not worked patters:
        Oracle version: 11.2.0 (same above)
        ODBC version: 11.2.0.1 (same above)
        National character set: AL16UTF16 (same above)
        Report file made by Crystal Reports 2011 (same above)
        Crystal Reports 2008 / 2011
    We think this phenomenon is degraded behavior of Crystal Reports 2008 / 2011.
    But we have to use the not worked patters.
    Anything wrong with us? Pls help.
    -Nobuhiko

  • How to get a minus sign with the cost  field in ALV.

    Hi ,
    How to get a minus sign with the cost field in ALV.
    The Ouput will be displayed like  Rs -1500 instead of 1500-
    I can't use concatenate also as i may have to use the sum functionality of ALV .
    Cheers
    Sunny

    Hi sunny,
    1. The OTHER FIELD
       has to be character field of say length 15.
    2. Write the original numeric value to
       this character field (in a loop)
    3. But simply writing won't help.
    4. use this kind of logic.
    5.
    REPORT abc.
    DATA : m TYPE i.
    DATA : chr(15) TYPE c.
    m = -100.
    WRITE m TO chr.
    IF m < 0.
      SHIFT chr RIGHT BY 1 PLACES.
      CONDENSE chr.
      CONCATENATE '-' chr INTO chr.
    ENDIF.
    WRITE chr.
    regards,
    amit m.

  • Updated to CR 2008 - now have new problem with truncated String fields.

    Hi there
    I'm hoping someone has a simple answer for this one...  notice there's a lot of it on forums but I haven't found an answer.
    Since updating to Crystal 2008 (Crystal 12), we have found that some reports are suddenly truncating string fields at 255 characters, despite the field value being much longer in the database.
    Does anyone know what to do to allow these fields to print in completion?
    Database connection is ODBC RDO.
    regards
    -Karen

    What is the database Oracle, SQL server etc.
    Can you query the database directly with another query tool, eg SQL Server Management Studion or SQL developer/Toad for Oracle.
    You can then run the Crystal query directly and see if its your ODBC connection that is truncating the datafield or Crystal.
    I have memo fields on SQL server with up to 2000 characters and these display in Crystal 2008 without any problem. We use ODBC (RDO) too.
    Ian

  • Alv field with string

    hi,
    I HAVE A TABLE IN WHICH ONE FIELD SAY F1 IS OF TYPE STRING
    I HAVE CREATED AN ALV REPORT IN WHICH THIS FIELD F1 IS editable
    when i press save button it ads the new row in the database
    the Problem lies here is that the output length is viewed only to lenght of 15 infact outlen of fieldcatalog is set to 30
    and i could only ad 30 character at max infact of being a type string
    how can i add data in the table through alv with lenght more than 256 characters

    (1)  How do you build the transparent table with type string field. This type is not allowed in transparent table.
    Do you mean CHAR (til 255) or LCHR type (<a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.pdf">BC - ABAP Dictionary</a>)
    <i><b>STRING</b>: Character string with variable length This type can only be used in types (data
    elements, structures, table types) and domains. It cannot be used in database tables. In ABAP, this type is implemented as a reference to a storage area of variable size.
    <b>CHAR</b>: Character string. Fields of type CHAR may have a maximum length of only 255 in tables. If longer character fields are to be used in tables, you must choose data type LCHR. There are no restrictions on the length of such fields in structures.
    <b>LCHR</b>: Character string of any length, but with a minimum of 256 characters. Fields of this type must be located at the end of transparent tables and must be preceded by a length field of type INT2. If there is an INSERT or UPDATE in ABAP programs, this length field must be filled with the length actually required. A fields of this type cannot be used in the WHERE condition of a SELECT statement.</i>
    (2) Use of long text (in fact that's your need ?) in ALV
    <i>1. Declare the internal and the external length of the field to the ALV Grid Control.
    • For fields with DDIC reference, the ALV Grid Control automatically uses the internal and the external length.
    • For fields without DDIC reference, you must specify the internal length using field INTLEN and the external length using field DD_OUTLEN of the field catalog (see Parameters for Fields Without DDIC Reference).
    2. Specify the conversion exit using field EDIT_MASK of the field catalog (see Formatting Column Contents).
    3. Pass the field catalog with method</i>
    If you really need long text, you may declare an output length of say 80 in the ALV grid, and provide an icon to edit a very-long text (via a popup screen with a container and a use of class cl_gui_textedit for example)
    Regards

  • I get error message DB745 with EDIT ALV on a field type DEC?

    Hi,
    I have an ALV which has a field type DEC.
    The ALV is open for edit.
    Once I put negative number in, I get the error message DB745.
    This error is retrieved from SAP code and I do not see any reason why.
    I checked the field cat and it looks fine (ref to a field type DEC).
    I am using lcl_grid_event_receiver with method: handle_data_changed FOR
    EVENT data_changed OF cl_gui_alv_grid.
    In that method I get the error in er_data_changed->mt_protocol.
    There is no problem to show negative data if it is saved in the database
    as negative.
    Can anyone throw ideas how to fix that?
    Thanks,
    Itay

    If you simply check the domain WERT7, you'll see that the checkbox for "Sign" is <b>not</b> checked. Therefore negative numbers are <b>not</b> allowed.
    Just because a field is decimal or currency does <b>not</b> mean that negatives are allowed.
    Many times, the sign is handled by a separate debit/credit indicator field such as a field with a domain of SHKZG.
    Rob
    Message was edited by:
            Rob Burbank

  • AutoPopulating a field with a string plus value from another field

    Hi: I have a table with two fields
    create table LINKREQUEST (
    requestid int primary key,
    INCIDENT_NUMBER varchar2(16),
    REQUESTID is auto populated using a sequence. I want to auto populate the INCIDENT field with the string "INC" plus the value from REQUESTID. Can someone help.
    TIA
    Ravi

    REQUESTID is auto populated using a sequence. I want to auto populate the INCIDENT field with the string "INC" plus the value from REQUESTIDSomething like this?:
    SQL> create table linkrequest (
    requestid int primary key,
    incident_number varchar2(16)
    Table created.
    SQL> create sequence linkrequest_seq
    Sequence created.
    SQL> create or replace trigger linkrequest_trg before insert on linkrequest
    for each row
    begin
    select linkrequest_seq.nextval,
            case when :new.incident_number = 'INC' then 'INC' || linkrequest_seq.nextval else :new.incident_number end
       into :new.requestid, :new.incident_number from dual;
    end;
    Trigger created.
    SQL> insert into  linkrequest (incident_number) values ('XY')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('INC')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('VW')
    1 row created.
    SQL> insert into  linkrequest (incident_number) values ('INC')
    1 row created.
    SQL> select * from linkrequest
    REQUESTID INCIDENT_NUMBER
             1 XY             
             2 INC2           
             3 VW             
             4 INC4           
    4 rows selected.

  • How to get two fields with same tech name in LIS Extractors?

    Hi Experts,
    I need "ERDAT" field from two structures (QMSM & QMFE) in 2LIS_18_IOTASK extractor.
    In LBWE first I moved ERDAT from QMSM. When I moved ERDAT from QMFE it gives an error:
    "Field with same technical name is already available in the Extract Structure".
    I don't want to create Append Structure as we need to write User exit.
    Can any one tell me how to get this field added in the extractor from QMSM and QMFE?
    Thanks for your help.
    Regards,
    Sree

    this is not possible as the all those fields are put in one structure. per definition you can't put the same field name twice in a structure, table in the data dictionary...
    hence, you really need to use an append and fill via user exit
    M.

  • Filter anomaly with string fields

    Is anyone else have an issue with string fields and filtering? What I notice is if I choose a custom string field in the metadata filter bar I'll see the usual list in the column like:
    All (2 values)
         50
    String 1
           2
    No Value
         48
    If I choose All or an actual entry (like String 1) the correct images are filtered. However if I choose No Value I don't see 48 images but only the images I would see if I had chosen String 1.  The built in string fields (such as Label) don't behave in this fashion.
    Is this a bug or something I can program around?

    Thanks Eric. Just use the custom metadata sample plugin from the SDK. It exhibits the same behavior. Everything works fine so long as EVERY image has an entry in the string field. If any are empty the filter shows a No Value line. This doesn't happen for the builtin string fields. They do not show that line in the filter bar.
    Choosing the No Value line does not show you the images that actually have no value in the field but some other group of images, some with values and some without.

Maybe you are looking for