Error in setting value with prepareStament

Dear Friends,
I've a problem with prepareStatement while setting the value. Bellow i'm mentioning the error which i get while compiling. Could any please guide me what is the problem.
String str="insert into prep (id,name,age,dob) values (?,?,?,?))";
PreparedStatement pstmt=conn.prepareStatement(str);
pstmt.clearParameters ();
pstmt.setString(1,"dhananjay",28,"10/10/1975");
pstmt.execute();
pstmt.close();
while compiling bellow error comes :-
TLogin.java:214: setString(int,java.lang.String) in java.sql.PreparedStatement cannot be applied to (int,java.lang.String,int,java.lang.String)
pstmt.setString(1,"dhananjay",28,"10/10/1975");
^
Thanking you..
Jayshri

Thanx Tom for your reply,
As you suggested i tried to use bellow code :
PreparedStatement pstmt=conn.con.prepareStatement("insert into prep(id,name,age,dob) values (?,?,?,?)");
pstmt.setString(1,1);
pstmt.setString(2,"dhananjay");
pstmt.setString(3,28);
pstmt.setString(4,"10/10/1975");
pstmt.execute();
it gave me bellow error :
TLogin.java:214: setString(int,java.lang.String) in java.sql.PreparedStatement cannot be applied to (int,int)
pstmt.setString(1,1);
^
TLogin.java:216: setString(int,java.lang.String) in java.sql.PreparedStatement cannot be applied to (int,int)
pstmt.setString(3,28);
^
so i changed the code to :
PreparedStatement pstmt=conn.con.prepareStatement("insert into prep(id,name,age,dob) values (?,?,?,?)");
pstmt.setString(1,"1");
pstmt.setString(2,"dhananjay");
pstmt.setString(3,"28");
pstmt.setString(4,"10/10/1975");
pstmt.execute();
above got compiled without error but while executing it is not inserting row in table, because id and age is integer in database and here i'm passing as string.
what i do to solve this problem?
thanking you.
Jayshri

Similar Messages

  • Import Error (Partial Set failure with RC error code = 0x84020020 for rec

    Hi,
    While importing the data through xls file , i am getting the error message "Partial Set failure with RC error code = <0x84020020> for record number
    0 through 212"  and no record get created in Data manager.
    Although i mapped all values , still it giving me an error message.
    I tried to Import other data and it was all working fine.
    Please guide
    Regards
    Sandeep Kumar

    HI,
    I checked the exl file and found that in the first column and first data  was in text format ('0001)but later on when i change the record and moved it to the last record , it worked fine. I was able to load all records including ('0001)
    I don't know wht the logic behind this:
    if my first record was ('0001), system was giving me the error and not allowing me to load the data. But when i moved the record as the last record it not only allow me to load the records but allow ('0001) also.
    If anyone have any clue , plz let me know.
    Regards
    Sandeep

  • Set value with XPath dynamically

    Dear All,
    I am wonder if the following is possiable with Set Value service using XPath, any *simple* workaround is also welcome too.
    If I have a variable myXML =
    <root>
    <item region="One">1</item>
    <item region="Two">2</item>
    </root>
    I can reference to /root/item[1] by:
    set /process/@myNum = 1
    set /process/@dummy  = /process_data/myXml/root/item[number(\process\@myNum)]
    But how can I access /root/item[@region="One"] ?
    I tried the following but all failed:
    1)
    set /process/@myString = @region="One"
    set /process/@dummy  = /process_data/myXml/root/item[string(\process\@myString)]
    2)
    set /process/@myString = One
    set /process/@dummy  = /process_data/myXml/root/item[@region='string(\process\@myString)']
    And are there any way to set a variable using template string? (i.e. You name is {$/process/@yourName$} )
    Regards
    Bill

    Bill,
    As the nature of dynamic xPath statements is very use-case dependant, there is not much in the way of documentation. However, I will forward this thread to the documentation team to see if there is anything that can be added in the future to make these types of questions covered in the docs.
    As for setting a variable by using a template, there is no way to do this in setValue service unfortunately. However, you can use the executeScript service in LC ES. This service allows you to write java code and have access to the LC ES APIs while in context of your process. If you go to http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm and look under Creating Processes Using LiveCycle Workbench ES2 / Service Reference / Execute Script you will find documentation about how ot use this service.
    http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/000580.html
    There is a method called replacePathExpressions(String aString) that is exposed by the patExecContext object. this method takes in a template like you are looking to use. Basically a string that contains some xPath expressions wrapped in {$ $}. I created a sample process (attached to this post) that has a process variable called templateString. I used a setValue service to set it's value to:
    "Your name is {$/process_data/@name$} and your address is {$/process_data/@address$}."
    Of course, I also have variables called "name" and "address" that I have tagged as input variables. Then I have the executeScript service with the following code (basically 3 lines of code with alot of comments):
    //Get the templateString process variable value.
    String template = patExecContext.getProcessDataStringValue("/process_data/@templateString");
    // Call the replacePathExpressions() method.
    // It is a built-in method that will look for all {$ $} variable text and process each xPath expression and replace them in the text.
    String result = patExecContext.replacePathExpressions(template);
    // Now, the result string contains all of the resolved xPath statements.
    // Let's set the process variable that will hold the result.
    patExecContext.setProcessDataStringValue("/process_data/@resultString",result);
    Now you can dynamically construct responses using template variables.
    Also, thanks to Florentin Wandeler for the tip on the replacePathExpressions() method.

  • Error displaying numeric values with SPREADSHEET output

    Hi, I'm using Reports 10g R2 and I have all my reports with PDF output, they render just fine.
    I want to render some of them with SPREADSHEET output but don't know why in some case numeric values are rendered as ****** instead of the corresponding number.
    The same report shows numeric values correctly in PDF but no in some Excel cells, just SOME of them, not all.
    I know that Excel column is not short because the internal value of the cell are the asterisks.
    What could be happening?
    Thanks!

    Hi Ruby,
    please refer to some very basic documentation on CRM 2007 Webclient UI or the IC Webclient of CRM 4.0.
    What you are trying to do is create a value node and your code ABAP is wrong.
    Here a code sample. Typed it by hand so there might be errors in it.
    data:
      ls_struct  type /mystructure,
      lr_struct_ref type ref to data,
      lr_node type ref to cl_bsp_wd_value_node.
    ls_struc-/attribute1/ = 'Hallo Welt'.
    get reference of ls_struct into lr_struct_ref.
    create object lr_node
    exporting iv_data_ref = lr_struct_ref.
    typed_context->/yourNode/->collection_wrapper->add( lr_node ).
    cheers Carsten

  • Problems of setting values% with 2 decimal places in any graphics. What sho

    Guys, I have the xcelsius 2008 and can not make it work chart with values % and 2 decimal places. Already set up everything that I know the spreadsheet and graphics.
    Someone knows what can I do?
    Thanks Anderson - Sao Paulo - Brazil.

    Hi Anderson,
    To get values in % and upto two decimal, follow the below steps:
    Go to Chart properties-> Appearences Tab-> Text tab.
    Select the "Vertical Axis Labels" and go to the Number format present below in the window.
    Change the format to "Percentage" and set decimal places to "2".
    This should work.
    Please revert incase you have any queries.
    Thanks,
    Amit Mathur.

  • Error in setting value of ComboBox in java script

    Hi All,
    I my jsp file I am doing the following in java script function:
    document.getElementById('form1:porcessCombo').value = strArray;
    where "strArray" is an array of Strings
    But this doesnt seem to be working....
    How do i assign an array of objects as Combo box value in Java Script?
    Please help!
    Thanks.

    Thanks for your quick reply...Couple of more
    questions:
    1.) I am now getting an error as notImplemented() -
    i think this is because of using .options....Am i
    right?
    2.) Could you please elaborate what "Option" ? I
    have an array of strings String[]....which i compute
    in a scriptlet and i access it using
    var list = <%=stringArray%>
    document.getElementById('form1:listCombo').options =
    list
    OR JUST
    document.getElementById('form1:listCombo').options =
    <%=stringArray%>
    Waiting for your replyFirst of all i would like to make some points clear,
    1) You cannot cast a Java String array object to Javascript Object...
    2) You have to create an array which would hold Option Object in it
    for a better understanding look at this code
    var arry1 = new Array("display1","display2";
    var arra2 = new Array("valu1","value2");
    var selectObj = document.getElementById("listCombo");
    selectObj.options.length = 0;
    for(var i=0;i<arry1.length;i++)
    selectObj.options.add(new Option(arry1,arry2[i]));
    or have a single array with options in it..
    var listArray = new Array(new Option("display","value").......);
    var selectObj = document.getElementById("listCombo");
    selectObj.options.length = 0;
    for(var i=0;i<listArray .length;i++)
    selectObj.options[i] = listArray[i];
    Hope I have made the concept clear....

  • Error when Setting value to Bind variable in View Link used in HGrid

    Hi
    I have requirement to pass profile id as bind variable, I have created a VO based on below Query.
    select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
    from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
    where a.child_id = b.child_id(+)
    and b.profile_id(+) = :1
    View Link Query that is being generated is
    SELECT * FROM (select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
    from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
    where a.child_id = b.child_id(+)
    and b.profile_id(+) = :1) QRSLT WHERE PARENT_ID = :Bind_ChildId
    it Shows Errors as
    ## Detail 0 ##
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    could anyone tell what could be the wrong. Do we need to set bind variable in view link Explicitly? or any other alternative.
    Its very Urgent.
    Regards
    Vimal

    Hi,
    I have faced similar problem some time ago. I could not find any solution except removing bind parameters in where clause. I tried to change binding style but it also didn't work. I think the problem is caused by view link's where clause.

  • Set value with XPath dynamically #2

    I am running into a similar problem as
    http://forums.adobe.com/message/2953296#2953296
    .but instead of constructing a string from xpath expressions, I'm trying to store a value into a Location based on a concatenated xpath expression.
    Here is what I'd like to do but it doesn't work:
    /process_data/@Approver_index = 1
    Location:/process_data/formData_flat/xdp/datasets/data/TDCR/RoutingName_[number(/process_data/@Approver_index)]
    Expression: 'Bob'
    This works if you were to put the string into the Location but Workbench won't accept this as a Location.  How can I dynamically apply a template xpath expression?  Any help would be great.

    Thanks for responding Gil.  This article is the basics of how to use the ExecuteScript service.  I'm familiar with this service.  Specifically, I'm trying to dynamically generate an XPATH location to store data.  Since I don't have a background as a java developer, I'm having trouble figuring out the method to accomplish this.
    The link I originally quoted was helpful because it outlined how to dynimcally build the Expression (which I also need ...and actually got working) but it doesn't mention how to build the XPATH location.  For this operation, I need to dynamically build both the Expression and the Location.  I'm halfway there.

  • Dynamic Action Set Value - PLSQL Error - cannot contain an expression

    I am trying to use below in a Dynamic Action to Set Value with PL/SQL Function. The dynamic action does not update the item appropriately. I tried to run the below directly in SQL Workshop but received the error "PLS-00372: In a procedure, RETURN statement cannot contain an expression". How can I get below to return the value needed?
    DECLARE
    rqstdaloe number;
    rqstdeloe number;
    devpercent number;
    rqsttarget date;
    timeleft number;
    PSPTime number;
    DevTime number;
    DevPer number;
    BEGIN
    SELECT SUM("TRACK_TIME_SPENT") INTO rqstdaloe
    FROM "TIME_TRACKER"
    LEFT JOIN "TBL_R66_TASK_TYPE" ON "TASK_TYPE_ID" = "TRACK_TYPE"
    WHERE "TRACK_REQUEST_ID" = :P2_REQUEST_ID AND "TASK_TYPE_TYPE" = 'DEV';
    rqstdeloe := :P2_REQUEST_ELOE;
    SELECT SUM(TT1."TRACK_TIME_SPENT") INTO DevTime
    FROM "TIME_TRACKER" TT1
    LEFT JOIN "TBL_R66_TASK_TYPE" TT2 ON TT1."TRACK_TYPE" = TT2."TASK_TYPE_ID"
    WHERE TT1."TRACK_USER" = :P2_PSP_ASSIGNED_PRIMARY AND TT2."TASK_TYPE_TYPE" = 'DEV';
    SELECT SUM(TT1."TRACK_TIME_SPENT") INTO PSPTime
    FROM "TIME_TRACKER" TT1
    WHERE TT1."TRACK_USER" = :P2_PSP_ASSIGNED_PRIMARY;
    DevPer := ROUND(DevTime/PSPTime,2)*8;
    timeleft := TRUNC(((NVL(rqstdeloe,0) - NVL(rqstdaloe,0))/DevPer)+.99999,0);
    rqsttarget := to_date(sysdate,'mm/dd/yyyy') + timeleft;
    RETURN rqsttarget;
    END;

    Hi Dave,
    just a quick hint. If you just want to have the time part of a date/sysdate, you can use TRUNC to do that. So your existing code
    rqsttarget := to_date(sysdate,'mm/dd/yyyy') + timeleft;could be changed to
    rqsttarget := trunc(sysdate) + timeleft;If you perform a TO_DATE on a date variable, the PL/SQL engine will first convert that date variable with an implicit type conversion to a VARCHAR2, because the TO_DATE interface only supports VARCHAR2's and NUMBER's.
    But implicit type conversions are always dangerous, because if your default date format mask isn't mm/dd/yyyy your TO_DATE will fail.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Enter a value using set value dynamic action

    Hi,
    I'm using Oracle 11g XE with apex 4.0.2.
    I've been trying to use a dynamic action on a text field 'item_group'. Button doesn't have this facility. I created an advanced action using 'set value' with no condition the value being 'RAM.' The event is "change", selection type 'event source', set type is 'static assignment' and value is RAM. It is supposed to trigger when the create button is pressed but nothing happens and the field is still null. I've tried variations on this but nothing works. Can anyone help.
    Thanks
    Tim

    are you looking dynamic sql ?
    Refer this
    http://docs.oracle.com/cd/B10500_01/appdev.920/a96590/adg09dyn.htm

  • Error: Object variable or With block variable not set.

    Hi,
    when i try to fill the control tables and browse for the target period in HFM (sys 9.3.1) i get the error: Error: Object variable or With block variable not set.
    When browsing for the target value in the location for the value no problem occurs.
    Anybody a clue?

    Hi SAP collegues,
    At my site, BPC Excel created this problem too "Object Variable or With Block Variable not set" .
    It turned out that this is symptom of a a dys-functioning BPC COM Plug-in in XL2007 or XL2010!
    This is a consequence that your Excel recently crashed while using BPC. And it relates to an Excel Add-in becoming disabled when the applications crashes.  Please check the following.
    Note before doing the following, close all other open Excel and BPC sessions.
    Within Excel go to File à Options
    Select the Add-Ins option on the left
    Select the <<COM Add-ins >> option in the Manage drop down, and click Go
    Make sure that the Planning and Consolidation option is selected.  If not, mark this box and click OK.
    If you do not see anything listed, return to the Add-in screen and select the Disabled Items option, and see if Planning and Consolidation is listed there.
    Let me know if you have any queries,
    Kind Regards,
    robert ten bosch

  • Exception setting property value with CGLIB ( in hibernate)

    My hbm.xml file is:
    <hibernate-mapping>
    <class name="com.dst.fourx.model.codeModel.CodeGroupDisplay" table="CODE_GROUP_DISPAY1">
    <composite-id name="codeGroupDisplayKey" class="com.dst.fourx.model.codeModel.CodeGroupDisplayKey">
    <key-property name="nlsLanguage" type="java.lang.String" column="LANG_CD" />
    <key-many-to-one name="codeGroupCode" class="com.dst.fourx.model.codeModel.CodesGroup" column="CD_GRP_CD" />
    </composite-id>
    <property name="createDate" column="CREATE_DT" type="java.util.Date" not-null="true"/>
    <property name="createUserCode" column="CREATE_USER_CD" type="java.lang.String" not-null="true"/>
    <property name="updateDate" column="LAST_MOD_DT" type="java.util.Date"/>
    <property name="updateUserCode" column="LAST_MOD_USER_CD" type="java.lang.String"/>
    <property name="displayText" column="DISPLAY_TXT" type="java.lang.String" not-null="true"/>
    </class>
    <query name="findAllEditableCodeGroups">
    <![CDATA[from CodeGroupDisplay]]>
         </query>
    </hibernate-mapping>
    I m getting the following error while running the above query:
    org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.dst.fourx.model.codeModel.CodeGroupDisplayKey.setCodeGroupCode
         at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:63)
         at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:262)
         at org.hibernate.type.ComponentType.resolve(ComponentType.java:447)
         at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:182)
         at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:759)
         at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:292)
         at org.hibernate.loader.Loader.doQuery(Loader.java:412)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
         at org.hibernate.loader.Loader.doList(Loader.java:1593)
         at org.hibernate.loader.Loader.list(Loader.java:1577)
         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
         at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
         at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
         at com.dst.fourx.core.impl.ao.dao.actions.HibernateNamedQueryAction.execute(HibernateNamedQueryAction.java:79)
         at com.dst.fourx.core.impl.ao.dao.BaseDAOHibernate.execute(BaseDAOHibernate.java:129)
         at com.dst.fourx.core.impl.ao.dao.AddEditCodeDAO.getAllFundingTypes(AddEditCodeDAO.java:47)
         at com.dst.fourx.core.impl.ao.dao.AddEditDAOTest.testGetCreditBankAccts(AddEditDAOTest.java:29)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at junit.framework.TestCase.runTest(TestCase.java:154)
         at junit.framework.TestCase.runBare(TestCase.java:127)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
         at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: net.sf.cglib.beans.BulkBeanException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
         at com.dst.fourx.model.codeModel.CodeGroupDisplayKey$$BulkBeanByCGLIB$$ae2c0401_2.setPropertyValues(<generated>)
         at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:59)
         ... 32 more
    Caused by: java.lang.ClassCastException: com.dst.fourx.model.codeModel.CodesGroup$$EnhancerByCGLIB$$fd9c7e4e
         ... 34 more

    check the setter method for the property LANG_CD in com.dst.fourx.model.codeModel.CodeGroupDisplay.
    it must be like -
    setNlsLanguage(CodesGroup xyz) { ... }
    The paremeters must be objects, not the type of the database column. We can specify the actual field in CodesGroup which acts as the foreign key in CodeGroupDisplay in the "property-ref" attribute of <many-to-one> element in the mapping file for CodeGroupDisplay.
    This worked for me. Hope it works for you too.

  • Set JArray values with invalid key value: "LastUpdatedTime" on new alert rule creation

    Hey all!
    I'm trying to create a new alert rule using version 0.9.11 of the Monitoring Library and am getting this error on alertsClient.rules.CreateOrUpdate:
    "Set JArray values with invalid key value: "LastUpdatedTime". Array position index expected."
    That's interesting because LastUpdatedTime is a DateTime object, and whether I set it or I don't, if I set a breakpoint, it does set itself correctly, but the API appears to be expecting a JSON hash?
    I've tested alertsClient and I'm able to get existing alerts (also metrics with metrics client), so I don't believe it's an access issue.
    Any ideas?
    The full code I'm using for the test (borrowed virtually verbatim from the Cloud Cover video
    here): 
    Rule newRule = new Rule
        Name = "CPU Over 90%",
        Id = Guid.NewGuid().ToString(),
        Description = "CPU Has been over 90% for 5 minutes",
        IsEnabled = true,
        LastUpdatedTime = DateTime.Now,
        Condition = new ThresholdRuleCondition
            Operator = Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.ConditionOperator.GreaterThan,
            Threshold = 90,
            WindowSize = TimeSpan.FromMinutes(5),
            DataSource = new RuleMetricDataSource
                MetricName = "Percentage CPU",
                ResourceId = "",
                MetricNamespace = ResourceIdBuilder.BuildCloudServiceResourceId(<cloudservicename>, <deploymentname>)
    RuleAction action = new RuleEmailAction
        SendToServiceOwners = true,
    newRule.Actions.Add(action);
    OperationResponse alertResponse = alertsClient.Rules.CreateOrUpdate(new
    RuleCreateOrUpdateParameters { Rule = newRule });
    Console.WriteLine("Create alert rule response: " + alertResponse.StatusCode);

    Hi Greg,
    Thanks for your post!
    Error "JArray" has been fixed in the latest nugget package.
    Refer to:
    http://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Monitoring/
    Hope this helps!
    Regards,
    Sadiqh

  • Conversion Error setting value ''{0}'' for ''{1}''

    Hi
    I have to populate a drop-down list on my page with the values coming from the DB.
    JSF code:
    <td align="right"><div id="wait" style="visibility:hidden;">Select an existing Application</div></td>
    <td align="left"><div id="wait1" style="visibility:hidden;" >
    <h:selectOneMenu id="exist" value="#{processApplication.selectedOwner}" styleClass="selectOneMenu">
    <f:selectItems value="#{processApplication.existingOwners}"></f:selectItems>
    </h:selectOneMenu>
    </div>
    </td>
    processApplication bean:
    public List<SelectItem> getExistingOwners() {                    
    //existingOwners = this.getOwners();
    try{
         List < SelectItem > existingOwners = new ArrayList < SelectItem > ( ) ;
         SelectItem si_0 = new SelectItem();
         SelectItem si_1 = new SelectItem();
    SelectItem si_2 = new SelectItem();
         si_0.setValue("11");
         si_0.setLabel("sri");
         si_1.setValue("21");
         si_1.setLabel("ADAMS");
         existingOwners.add(si_0);
         existingOwners.add(si_1);
         logger.info("values in the list" +existingOwners.get(1).getValue());
              }catch(Exception e){
                   logger.debug(e.getCause());
                   e.printStackTrace();
              return existingOwners;
         public void setExistingOwners(List<SelectItem> existingOwners) {
              try{
              this.existingOwners = existingOwners;
              }catch(Exception e){
                   logger.debug("%%%%");
                   logger.debug(e.getCause());
                   e.printStackTrace();
    public String getSelectedOwner() {
         try{
         List<SelectItem> test = this.getExistingOwners();
         selectedOwner = (String)test.get(1).getValue();
         logger.debug("selected owner from the list" +selectedOwner);
         }catch(Exception e){
         logger.debug(e.getCause());
         e.printStackTrace();
         return selectedOwner;
         public void setSelectedOwner(String selectedOwner) {
              this.selectedOwner = selectedOwner;
    public List<SelectItem> getExistingOwners() should actually be a call to the DB to get the list.
    But since i was getting exception I tried to hard code the list in the method itself.
    But , I get this exception:
    logger.info values in the list 21
    [6/15/09 12:49:45:687 EDT] 0000003d ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /processApplication.jsp. Exception thrown : javax.servlet.ServletException: Conversion Error setting value ''{0}'' for ''{1}''.
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:658)
         at com.ibm._jsp._processApplication._jspService(_processApplication.java:149)
         at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
         at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
         at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
    Earlier, I had a drop down list that was working perfectly fine.
    But its values came from a Helper class and not the DB.
    What is it that Iam missing or doing wrong?
    Please help me.
    Thanks.

    Based on your example on the link that you referred to I tried to do this
    fillSelectItems();
    as the initialization block (I read what it means)
    changed my getter method to
    public List<SelectItem> getExistingOwners() { return existingOwners; }
    private void fillSelectItems() {
    this.existingOwners = new ArrayList<SelectItem>();
    try{
         existingOwners.clear();
         List test = this.getOwners();
         SelectItem[] myitem = new SelectItem[test.size()];
         for(int i=0;i<test.size();i++) {
         Object[] arrayOne = (Object[])test.get(i);
    try{
         SelectItem tmp = new SelectItem();
         tmp.setLabel(arrayOne[0].toString()+(String)arrayOne[1]);
         tmp.setValue((Integer)arrayOne[0]);
         myitem[i] = tmp;
    this.existingOwners.add(myitem);
    }catch(Exception e){
              logger.debug(e.getCause());
              e.printStackTrace();
         }catch(Exception e){
              logger.debug(e.getCause());
              e.printStackTrace();
    Basically, I moved what I had earlier in getter method I have it now in the fillSelectItems()
    Butthen, I get a NullPointerException.

  • IllegalArgumentException: Conversion Error setting value ''{0}'' for ''{1}'

    Hi all i am facing one problem while using <h:selectManyMenu style="height:100;" value="#{cityf.cityLook}">
    <f:selectItems value="#{cityf.city}" />
    </h:selectManyMenu>
    so ,plz help me about this error.!!!!!!
    java.lang.IllegalArgumentException: Conversion Error setting value ''{0}'' for ''{1}''.
         com.sun.faces.util.Util.getSelectItems(Util.java:670)
         com.sun.faces.renderkit.html_basic.MenuRenderer.getOptionNumber(MenuRenderer.java:509)
         com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:486)
         com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:451)
         javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740)
         com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:473)
         com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:470)
         com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:253)
         javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721)
         javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:629)
         javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:566)
         com.sun.faces.taglib.html_basic.PanelGridTag.doEndTag(PanelGridTag.java:460)
         org.apache.jsp.Demo_jsp._jspx_meth_h_005fpanelGrid_005f0(Demo_jsp.java:192)
         org.apache.jsp.Demo_jsp._jspx_meth_h_005fform_005f0(Demo_jsp.java:159)
         org.apache.jsp.Demo_jsp._jspx_meth_f_005fview_005f0(Demo_jsp.java:125)
         org.apache.jsp.Demo_jsp._jspService(Demo_jsp.java:90)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
         org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
    city.jsp:
    <html>
    <body>
    <f:view>
    <h:form id="select">
    <h:panelGrid columns="1">
    <h:column>
    <h:outputText value="Select City : "/>
    <h:selectManyMenu style="height:100;" value="#{cityf.cityLook}">
    <f:selectItems value="#{cityf.city}" />
    </h:selectManyMenu>
    </h:column>
    </h:panelGrid>
    </h:form>
    </f:view>
    </body>
    </html>
    City Bean:
    public class City {
         private CityIDLookup[] city;
         private String[] cityLook;
    public CityIDLookup[] getCity() {
         return city;
    public void setCity(CityIDLookup[] city) {
         this.city = city;
    public String[] getCityLook() {
         return cityLook;
    public void setCityLook(String[] cityLook) {
         this.cityLook = cityLook;
    faces.config.xml:
    <managed-bean>
    <managed-bean-name>cityf</managed-bean-name>
    <managed-bean-class>com.class.City</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>

    With SelectItem I mean the javax.faces.model.SelectItem class.
    <h:selectManyMenu value="#{myBean.selectedItems}">
        <f:selectItems value="#{myBean.selectItems}" />
    <h:selectManyMenu>MyBeanprivate String[] selectedItems; // + getter + setter
    private List<SelectItem> selectItems; // + getter

Maybe you are looking for

  • Unable to Update Illustrator

    I am unable to get the latest update - The message from Creative Cloud is Failed, error UM441I210 When I did a search on the error number the steps it suggested were to Restart (still failed), uninstall and re-install (still failed) and finally to lo

  • Pdf created for android

    I use manuals to work from. They are supplied from a company and work on a pc. You start with a navigation page that takes you to the relevant manual. It works with ghostscript but does not work on an Android device. I can read the pdf's and navigate

  • Listing directory path for all Itunes songs

    I have songs in my Itunes that I've managed to put in a number of different places on my computer, as well as on a second hard external hard drive. I want to list the inventory of all my songs, and be able to see what the path is for each, which I kn

  • Link of EHS to PM

    Hi, What is the link of EHS and plant maintenance,where is the configuration. Regards, SS

  • X64 drivers for RS480M2-IL

    Hello all, Anyone knows when the drivers for Windows x64 will come out ? It's hard to believe that they sell a 64 bit motherboard without any drivers for it. Thanks Lorenz