Conversion error with non-primitive types

I'm wondering if anyone else is seeing this problem or has a potential solution.
The problem, in a nutshell:
I have beans that use non-primitive types (Float instead of float) in the getters and setters. However I keep getting conversion error problems. If I switch to primitive types, I don't get conversion errors. The built-in FloatConverter says (in the documentation at least) that it supports both primitives and boxed types. This was all working in EA4, though. I am discovering this problem as I migrate from EA4 to 1.0.
The code is pretty straightforward:
public class Bean implements Serializable {
public float getProp() {...}
public void setProp(float) {...}
public Float getPropOld() {...}
public void setPropOld(Float) {...}
<!-- works -->
<h:inputText id="floatinput" value="#{BeanInstance.prop}"/>
<!-- doesn't work -->
<h:inputText id="floatinputold" value="#{BeanInstance.propOld}"/>
Any ideas? I have tried explicitly calling the FloatConverter but that gave the same problems.

Okay, I figured out my problem.
The JSF spec implies that f:convertNumber may be used inside an h:inputText tag. The early versions of Core JSF go further and show f:convertNumber being used inside an h:inputText tag in one of the examples. (Chapter 7, conversions).
However, this has been the source of my problem. When using f:convertNumber, the converter would automatically determine the data type without regard to the data type in the backing bean. Hence, it would try to pass Longs or Doubles to the bean instead of Floats.
I believe this may be an issue in the 1.0 FR release.

Similar Messages

  • @protocol doesn't seem to work with non-primitive arguments

    Any idea why this works.
    CustomProtocol1.h
    @protocol CustomProtocol1
    - (void) start:(int) offset;
    @end
    But this doesn't:
    CustomProtocol2.h
    @protocol CustomProtocol2
    - (void) start:(CustomClass*) custom;
    @end
    The only difference is that CustomProtocol1 uses a non-primitve argument. Here is the error I get for CustomProtocol2: "Syntax error before 'CustomClass'. Method definition not in @implementation context"
    It seems CustomProtocol2 has problems finding the CustomClass.h but if I add #import "CustomClass.h" into CustomProtocol2.h I get this error: "Cannot find protocol declaration for 'CustomProtocol2'"
    So far, I can only conclude that Objective-C @protocol does not work with non-primitives.
    Any help would be MUCH appreciated.
    Anthony

    The compiler doesn't know what CustomClass is. You have to tell it. However, it is a pointer and, hence, actually is a "primitive" (AKA POD - plain 'ole data) type. So, you need to forward declare CustomClass like so:
    @class CustomClass;
    @protocol CustomProtocol2
    - (void) start:(CustomClass*) custom;
    @end

  • ERROR-With non-valuated GR, please also enter GR indicator

    Hi,
    We are on SRM 5.0 SP12,Extended Classic scenario.
    For all PO's which have no follow on docs created,whenever the
    Confirmation-Related Invoice Verification (GR_BASEDIV) and Confirm
    Performance of Service/Goods Receipt(GR_IND) fields are changed,the
    changes are not transferred to ECC backend .The SRM PO status is set
    to "ERROR IN PROCESS" and in RZ20 we see the folling messages:
    PurchOrder 5000012063: Purchase order still contains faulty items
    PO 5000012063: With non-valuated GR, please also enter GR indicat or
    PO 5000012063: Instance 5000012063 of object type PurchaseOrder c ould
    not be changed
    Has anybody come across such an issue?

    Hi,
    We also faced similar issues. In such cases, do minor changes to line item of the PO quantity / price or other fields which are relevent for creation of the new versions of the PO.
    Then use Function module BBP_PO_EXE_TRANSFER to push all the changes along with GR Indicator of the PO in to ECC.
    In you case, the changes to PO is not triggerig the new Version of the PO. Hence it is not updating in back end.
    Thanks
    Giri

  • How to check a lot of conversion errors with one TRY-CATCH?

    Hi,
    I've to import a lot of data from a flatfile.
    To avoid short dumps when there are non-numeric data's for a numeric field in the file, I load every record in a structure that have only CHAR fields.
    Then I move this fields in a TRY-Catch block to the real fields like this:
    TRY.
        field1 = field_from_file1
        field2 = field_from_file2
        field3 = field_from_file3
    CATCH cx_sy_conversion_no_number INTO lr_exception.
        PERFORM fehler USING lr_exception.
    ENDTRY.
    This construct works until the first field has a conversion error. However I will test all fields to get a complete list of the errors. And I am to lazy to make a TRY-CATCH construct for hundred of move-statements.
    Is there a better trick to check the success of <b>all</b> move operation?
    Regards,
    Stefan

    Hi Stefan,
    sorry, the development system is down right now, so I could not test. But I'm convinced you can figure it out:
    You may specify the parameters of a method as TYPE REF TO DATA.
    Then, in the calling routine you may have
    data:
      anyrefsource type ref to data,
      anyreftarget type ref to data.
    GET REFERENCE OF p_source INTO anyrefsource.
    GET REFERENCE OF p_target INTO anyreftarget.
    call method try_conv
      exporting
        source = anyrefsource
        target = anyreftarget.
    and in the method:
    ASSIGN source->* TO <fs_source>
    and so on...
    BTW: I know you have to use typed parameters in OO. Can't you use "TYPE ANY"?
    regards,
    C.

  • UISelectMany - Conversion error with HashMap Property

    Hi,
    I have a Backing Bean with a HashMap Property.
    public HashMap getItem()
    public void setItem(HashMap map)
    so I bind a Value of an UIInputText Component like that:
    <h:inputText id="txtname" value="#{MyBean.item['myKey']}" />
    this works pretty well.
    But when I try to do the same with an <h:selectManyCheckbox> Component I got a "Conversion Error".
    For what reason? I expected an Array or List Object.
    Thanks for help
    Ralph

    I solved the problem by creating a custom converter, which checks if the current valueBinding is null.
    If so, it replace the valueBinding with an empty ArrayList().
    public class MultiValueConverter implements Converter {
         public final static String CONVERTER_ID = "org.imixs.workflow.j2ee.faces.MultiValueConverter";
         public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException {
    // no changes
    return value;
         public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException {
    // Check if current value Binding is bind to an null-Object
    javax.faces.el.ValueBinding valueBinding=component.getValueBinding("value");
    if (valueBinding!=null && valueBinding.getValue(context)==null) {
    // replace binding with empty ArrayList
    valueBinding.setValue(context,new ArrayList());
    // no changes
    return value.toString();
    you can find the full code under www.imixs.org (an open source project for a EJB based workflow engine)

  • Error with Exchange rate type

    Hello all,
    While releasing the billing document to accounting, getting the error:
    'An exchange rate type is not defined for country US'.
    In customer master, have maintained Exchange rate as 'M'.
    where do we maintain the exchange rate type for country.
    Thanks
    Gauravjit.

    HI Gauravjit,
    Try this:
    SPRO-F5- General Settings-Currencies-Define Translation ratos for currency translaction
    Reward if it helps
    regards
    Srini

  • LSMW: Codepage conversion error with a Unicode data file

    Hi all,
    I am currently developing a LSMW upload program which has to use a Unicode data file. The underlying system/target system is NOT a Unicode system. The data file also contains non-Latin2 characters.
    In the step "Specify Files", I have specified my Unicode data file and specified the codepage type "4110 - Unicode UTF-8".
    In the step "Read Data", then I get the runtime error "CONVT_CODEPAGE", exception "CX_SY_CONVERSION_CODEPAGE".
    I would expect that all non-Unicode characters are automatically transformed to "#", but the conversion progam breaks. The character transformation to "#" would be fine.
    I am really wondering why, at first, I am able to specify the Unicode codepage type, but then, the file cannot be converted correctly.
    What do I make wrong, what can I do to avoid the error?
    Thanks a lot in advance for helping me out...
    Regards,
    Klaus

    Hello,
    You need convert the file with the format UTF-8. In notepad you can choose this option.
    Regards,
    Oscar.

  • CRC errors with non-home hub device

    Hey folks
    When I first replaced my dying BT Home Hub with a third party DSL modem, there were initially a lot of CRC errors and poor SNR ratios. I called BT Broadband support and the agent appeared to rectify the problem on by undertaking actions on BT's side. It was something like performing two line tests back-to-back -- I know sounds odd, but it worked and the the third party DSL modem worked happily for 6 months.
    This week the third party modem started reporting high numbers of CRC errors, much like when first connected, it works for a while then resets when the CRC error count overflows. I'm wondering if there is some other state on BT's side that could rectify the problem. I've spoke with two agents this week, and they had no idea what I was talking about (and I agree it sounds like voodoo).
    Any ideas on what the initial action was on BT's side that enabled the modem to work in the first place?
    Thanks
    Solved!
    Go to Solution.

    Hi John
    I didn't understand the question about the test socket (physical socket?).
    The line passes the quiet line test.
    The third party router shows:
            Downstream    
    Upstream
    SNR Margin
    0.1
    6.2
    db
    Line Attenuation
    53.5
    27.0
    db
    Data Rate
    5705
    1023
    Kbps
    Max Rate
    22116
    1036
    Kbps
    POWER
    0.0
    12.3
    dbm
    CRC
    5786
    0
    The CRC errors accumulate until they hit a threshold and the device resets dropping the connection.
    The Home hub shows:
    ADSL settings
    VPI/VCI    0/38
    Type    PPPoA
    Modulation    ITU-T G.992.5
    Latency type    Interleaved
    Noise margin (Down/Up)    2.8 dB / 5.3 dB
    Line attenuation (Down/Up)    49.5 dB / 26.1 dB
    Output power (Down/Up)    0.0 dBm / 12.9 dBm
    The obvious difference is 3dB in line attenuation and noise margin. This was the case when I first connected the third party router before BT did the line reset that allowed the device to work. It has worked flawlessly for months.
    Thanks
    BTW, I don't want to appear unduly ornery, but BT tech support repeatedly ask on the telephone "why aren't you using HH2 we provided?".
    1) It randomly drops OS X wifi connections which makes me really unpopular in the house.
    2) It has poor wifi interaction with work lenovo laptop.
    3) It has no support for QoS provisioning so kids streaming video interferes with work.
    4) It has unreliable and undocumented USB storage, cf third-party solution which offers glitchless SMB and FTP.
    5) Printer support is undocumented (though works better than my third-party alternative :-) )
    My first HomeHub 2 had exactly the same issues before it died at which time I invested in a third party alternative. To credit BT they sent a refurbished replacement but this has all the same issues and a non-functioning reset switch.

  • Advanced CAN Frame to Channel Conversion: Error with LV 8.5.1

    Hello!
    I´ve tried to read in a DBC-file with the "Advanced CAN Frame to Channel Conversion Example" on a LabVIEW 8.5.0 system and it works fine.
    On a LabVIEW 8.5.1 System I get the error:
    Scan From String (arg 6) in CAN FtoC Parse Channels and Mode.vi->CAN FtoC Parse CANdb Messages and Channels.vi->CAN Channel Data Import.vi
    Does anybody know a solution for this error?
    Thank you for your help,
    demo66
    regards,
    demo66

    Hi!
    It is a problem of localized decimal point.
    In a german Windows, LabVIEW will use Komma as decimal point.
    So the Scan From String.vi will convert string 0,21 in a double but not 0.21. From the file dbc you receive the values with period "." that's why it create the error 85.
    You have 2 possibilities: change the localized decimal point in LabVIEW (Tools -> Options) or you say to the Scan From String.vi to use "." as a decimal point.
    Go to CAN FtoC Parse Channels and Mode.vi and search the 2 Scan From String.vi
    Add at the beginning of the Format String %.; so that the format String will use the "." as decimal point (see Attachement).
    After that the example will work.
    Best regards
    Ken
    Attachments:
    Scan From String.jpg ‏51 KB

  • Syntax Error with Table Parameter (type: ANY) when Creating Function Module

    Hello experts,
    I want to create a function module with a table parameter and table type is ANY. But when I check (Ctrl+F7) this function module, syntax error occurs - "In this statement, the internal table "MSG_TABLE_ITEM" must have the type "STANDARD TABLE"."
    Could anyone tell me what the wrong is? And how can I fix it?
    Thanks,
    Shelwin

    Hi,
    For table parameters, you can only pass
    MSG_TABLE_ITM   TYPE STANDARD TABLE
    or
    MSG_TABLE_ITM  ( don't fill other columns TYPING ASSOCIATED TYPE  ).
    For reference check FM 'GUI_UPLOAD' - Table parameters
    Regards,
    DPM

  • OVM Manager 2.2.2: server pool error with file system type

    I'm just getting started with OVM. I've installed OVM on one machine and the manager on another.
    I created a server pool, which seemed to work OK but shows "Error" in the table under the "Server Pools" tab in the manager interface
    When I edit it I see
    Error: OVM-1011 OVM Manager communication with NNN.NNN.NN.NNN for operation Pre-check cluster root for Server Pool failed: <Exception: SR '/dev/sda3' not supported: type 'ocfs2.local' not in ['nfs', 'ocfs2.cluster']>
    Can anyone explain this? Does this mean I can't use a local file system in OVM 2.2.2? I understood this was the case with OVM 3, which is why I went with 2.2.2.
    Thanks.

    Roger Ford wrote:
    Error: OVM-1011 OVM Manager communication with NNN.NNN.NN.NNN for operation Pre-check cluster root for Server Pool failed: <Exception: SR '/dev/sda3' not supported: type 'ocfs2.local' not in ['nfs', 'ocfs2.cluster']>
    Can anyone explain this? Does this mean I can't use a local file system in OVM 2.2.2? I understood this was the case with OVM 3, which is why I went with 2.2.2.You can't created a clustered pool with a local filesystem. You need to format the filesystem with ocfs2 in clustered mode.

  • 2d object with multiple primitive types

    I've done some research and tried a few options and finally decided that I want a two dimensional object to handle several different types of primitives. My current plan is to just put them all in a 2d String array, then parse them to whatever type I need when I need to do calculations with the integers or doubles. But I also wanted to ask if there was already an object type that could handle this for me without the parsing. I need more than one value per key, so I don't think that a map will work (although I've admittedly never used one before and may not fully understand how it operates).
    My other thought was to just make a new object with several different arrays of different types and to use the indices to relate one to another. This would at least clean up my code and take out some repetitive parsing steps, but it seems a very roundabout way to handle the situation.
    Any suggestions?
    Should I just use a 2d String array?
    Should I make a new object?
    Does an object already exist for this application?
    Also, if I muddied any of this up by using improper word choice, please let me know so that I can try to clarify.

    Fair enough. I'm working on analyzing some data for a videogame. I want to find the optimal set of items on a character by trying every combination and analyzing it's effectiveness. In order to do this, I want to store about a dozen different stats (some integers, some doubles) for about 30 different items along with the item's name, then use some nested loops to evaluate each combination. There is no 'perfect answer', so I need to perform this process multiple times under varying circumstances. I figure this would be easiest to accomplish if every stat is associated with an x value and every item is associated with a y value because I could then use the index of a for loop to process the information.
    In short, I have several different data types that I want to store in a manner that allows me to load and retrieve all the information using loops. Each set of data has the exact same format (String, int, int, double, double, double...).
    I know it doesn't sound like an important project, but I like to take any opportunity I can to practice my programming. I think it's an important skill in today's world and I'm always trying to improve.

  • Error with VPRS condition type in Quotation

    Hi,
    When go through the pricing conditions of my quotations, I see a red signal indicating error before the VPRS Condition type (Condition category G). When i do the condiotn analysis, the diagnosis read as below.
    "Error in quantity / value updation"
    Diagnosis:
    This condition has not been determined using condition records. The amount or value should be determined from another data source. For cost (condition category 'G') it is read using conditions from the material valuation segment, for a cash discount condition it is read using conditions from the terms of payment table.
    In this transaction an error occurs - the material valuation segment or the terms of payment table could not be read or a currency translation has failed.
    System Response
    The condition has been provided with the deactivated indicator 'X'.
    Could you please let me know what could be causing this?
    regards,
    Ashok

    Hi Ashok,
    Your problem seems intresting, may be this thread can help you
    [SCN|VPRS- Error in quantity/value determination]
    Please provide feedback after getting it solved.
    Thanks,
    Raja

  • Getting error  with oracle oci type driver

    Hi,
    while I'm using the oracle oci type driver I got the error but it works fine with the thin driver.
    so where should I the information regard this.I'm working with oracle 8i.
    with
    raghu

    while I'm using the oracle oci type driver I got the
    error but it works fine with the thin driver.What is the error ?
    so where should I the information regard this.I'm
    working with oracle 8i.As long as you have the 8i client set up properly, the JDBC OCI drivers will work. To test just go to the command prompt and try tnsping and/or sqlplus to connect to your DB.
    Post your JDBC URL and the exception you are getting if you are still having problems.

  • Replication - Error with real data type

    Hi Everybody,
    I have a replication problem on a certain SQL Server 2012 build 2100. First of all:
    - Tables are the same on Publisher and Subscriber (double-checked)
    The problem is 8152 - String or binary would be truncated. Since I know this error, I looked for the command (xact_seqno) and it shows:
    {CALL [sp_MSins_tbl2Replicate]
    ({7B914E3E-25ED-E411-BC82-005056A54F21}
    ,{BA54EA41-ECE1-4F4B-7A63-08D05A57DCC9}
    ,{51BEC1B8-F6D2-E411-BC82-005056A54F21}
    ,1
    ,NULL
    ,N'2015-04-27'
    ,{87766F58-A0C8-41E6-E7D4-08CFE45FE017}
    ,2
    ,2.81122997072606E-313
    ,N'2015-04-27 23:34:59.7600274'
    ,{87766F58-A0C8-41E6-E7D4-08CFE45FE017}
    ,NULL
    ,{0AB7C33E-0B3E-E211-A06F-005056A54F21},NULL,NULL,0,NULL,NULL)}
    My problem is the value "2.81122997072606E-313" since this field is a real field. I dont understand that. The Value is way to small and a SELECT in the Publisher-DB shows a "1". Does anybody has an idea?
    Thanks
    Dave

    Hi,
    first of all thanks for your help. Publisher-Table-Schema:
    [EV_GUID] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
        [EV_PV_Profilvariable] [uniqueidentifier] NOT NULL,
        [EV_Empfaenger] [uniqueidentifier] NOT NULL,
        [EV_EmpfaengerTyp] [tinyint] NOT NULL,
        [EV_Gruppe] [uniqueidentifier] NULL,
        [EV_ErbrachtDatum] [date] NOT NULL,
        [EV_AN_Erbringer] [uniqueidentifier] NOT NULL,
        [EV_Zeitwert] [int] NOT NULL,
        [EV_Anteil] [real] NOT NULL,
        [EV_ErfasstZeitpunkt] [datetime2](7) NOT NULL,
        [EV_AN_Erfasser] [uniqueidentifier] NULL,
        [EV_SC_Statistikcode] [uniqueidentifier] NULL,
        [EV_OE_Auftraggeber] [uniqueidentifier] NOT NULL,
        [EV_KST_Kostenstelle] [uniqueidentifier] NULL,
        [EV_Bemerkung] [varchar](max) SPARSE  NULL,
        [EV_Flags] [int] NOT NULL,
        [EV_MN_Massnahme] [smallint] NULL,
        [EV_Fremdkey] [varchar](100) NULL
    Subscriber-Table-Schema:
    just the same....
    SELECT EV_Anteil FROM tbl2Replicate WHERE EV_GUID = '7B914E3E-25ED-E411-BC82-005056A54F21'
    returns "1". The reported value wont fit in a real-field or am I missing something? I tested this and it would fill in a "0" for such a tiny number. Therefore it cant be in the publisher database. Also tested with SELECT MIN(EV_Anteil)
    and returned "0.02040816" with another PK of course.
    Other Options in Transactional Replication:
    Replicate schema changes - True
    Copy objects all to false, except clustered index, unique key constraints, Collation and INSERT, UPDATE, DELETE stored procedures
    Convert data types = False
    Thanks
    Dave

Maybe you are looking for