JSF: Conversion Error setting value

Anyone knows how to fix this? I got the following error when I tried to put 50 numbers in the dropdown list:
javax.servlet.ServletException: "{2}" Conversion Error setting value ''{0}'' for ''{1}''.
Here is the bean
     private String[] items=null;
     public String[] getItems() {
          items = new String[50];
          for (int i=0; i <50; i++){
               String va = String.valueOf(i);
               items= va;
          return items;
     public void setItems(String[] it) {
          items = it;
Here is the tag:
<h:selectOneMenu id="test" value="1">
     f:selectItems value="#{QuestionBean.items}"/>
</h:selectOneMenu>

f:selectItems value attribute must be a list of SelectItem objects.
Transform your items list and it'll work.

Similar Messages

  • 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

  • Conversion Error setting value '33'  for 'null Converter'

    Hi,everyone,it looks my custom Converter dosen't work.
    CreditCard class:
    package com.corejsf;
    public class CreditCard {
         private String number;
         public CreditCard(){
         public CreditCard(String number){
              this.number=number;
         public String toString(){
              return this.number;
    ==============================
    PaymentBean:
    package com.corejsf;
    import java.util.Date;
    public class PaymentBean {
         private double amount;
         private Date date=new Date();
         private CreditCard card;
         public PaymentBean(){
         public double getAmount(){
              return this.amount;
         public void setAmount(double newValue){
              this.amount=newValue;
         public Date getDate(){
              return this.date;
         public void setDate(Date newValue){
              this.date=newValue;
         public CreditCard getCard(){
              return this.card;
         public void setCard(CreditCard newValue){
              this.card=newValue;
    =================================
    CreditCardConvert:
    package com.corejsf;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    import javax.faces.application.FacesMessage;
    public class CreditCardConvert implements Converter{
         public Object getAsObject(FacesContext context,UIComponent component,String newValue) throws ConverterException{
              StringBuilder builderForNewValue=new StringBuilder(newValue);
              boolean foundInvalidCharacter=false;
              char invalidChar;
              int newValueLength=newValue.length();
              int i=0;
              char chFromNewValue;
              while(i<newValueLength && !foundInvalidCharacter){
                   chFromNewValue=builderForNewValue.charAt(i);
                   if(Character.isDigit(chFromNewValue) || Character.isSpaceChar(chFromNewValue)){
                        i++;
                   }else{
                        foundInvalidCharacter=true;
                        invalidChar=chFromNewValue;
                        FacesMessage message=new FacesMessage();
                        message.setDetail("detail error convert message for CreditCard with error Char:"+invalidChar);
                        message.setSummary("summary error convert message for CreditCard with error Char:"+invalidChar);
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        throw new ConverterException(message);
              return new CreditCard(builderForNewValue.toString());
         public String getAsString(FacesContext context,UIComponent component,Object newValue) throws ConverterException{
              return newValue.toString();
    ===============================
    faces-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">
         <managed-bean>
              <managed-bean-name>payment</managed-bean-name>
              <managed-bean-class>com.corejsf.PaymentBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <converter>
              <converter-id>com.corejsf.CardConvert</converter-id>
              <converter-class>com.corejsf.CreditCardConvert</converter-class>
         </converter>     
         <navigation-rule>
              <from-view-id>/index.xhtml</from-view-id>
              <navigation-case>
                   <from-outcome>result</from-outcome>
                   <to-view-id>/result.xhtml</to-view-id>
                   <redirect/>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/result.xhtml</from-view-id>
              <navigation-case>
                   <from-outcome>index</from-outcome>
                   <to-view-id>/index.xhtml</to-view-id>
                   <redirect/>
              </navigation-case>
         </navigation-rule>
    </faces-config>
    ==================================================
    index.xhtml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
         <h:head>
              <title>index page</title>
         </h:head>
         <h:body>
              <h:form>
                   <table>
                        <tr>
                             <td>
                                  <h:inputText id="iptCard" label="card" required="true" convert="com.corejsf.CardConvert" value="#{payment.card}">
                                  </h:inputText>
                                  <h:message for="iptCard"></h:message>
                             </td>
                        </tr>
                        <tr>
                             <td>
                                  <h:inputText id="iptAmount" label="amount" required="true" value="#{payment.amount}">
                                       <f:convertNumber minFractionDigits="2"></f:convertNumber>
                                  </h:inputText>
                                  <h:message for="iptAmount"></h:message>
                             </td>
                        </tr>
                        <tr>
                             <td>
                                  <h:inputText id="iptDate" label="date" required="true" value="#{payment.date}">
                                       <f:convertDateTime pattern="MM/yyyy"></f:convertDateTime>
                                  </h:inputText>
                                  <h:message for="iptDate"></h:message>
                             </td>
                        </tr>
                        <tr>
                             <td>
                                  <h:commandButton value="sumbit" action="result"></h:commandButton>
                             </td>
                        </tr>
                   </table>
              </h:form>
         </h:body>
    </html>
    Can anyone help me,TKS!

    And besides,if I change the first inputText to:
    <td>
    <h:inputText id="iptCard" label="card" required="true" value="#{payment.card}">
         <f:convert convertId="com.corejsf.CardConvert"></f:convert>
    </h:inputText>
    <h:message for="iptCard"></h:message>
    </td>
    The app runs and result in:
    WebContent/index.xhtml @13,55 <f:convert> Tag Library supports namespace: http://java.sun.com/jsf/core, but no tag was defined for name: convert
    Is any configuration problem there?
    TKS!

  • Problem overriding default JSF conversion error messages

    Hello !
    I have a problem to override default JSF conversation error message. I have an inputText which is binded to BigDecimal attribute, so when I enter a character in that field I get this error message: "- Conversion failed."
    I think I need to register the message bundle in my faces config, and put the key of this error message to my properties file.. am I right ?
    Can somebody help me with this ? Which key I need to put into the properties file ?
    Miljan

    Get [Sun's Java EE tutorial |https://www.sun.com/offers/details/JavaEETutorial.xml?cid=20090723ZA_TACO_JVEE_0004] and read the relevant section so you don't have to guess what you need to do.

  • JSF Conversion error for h:selectManyListbox

    There's an exception (*Conversion error occurred*) from JSF on <h:selectManyListbox> component for id availableUsers which is bound to myBean*.*roleId
    Now myBean*.*roleId is of Long datatype and so is the usersList*.*SelectItem*.*value. So, would not be any datatype mismatch. Tried using a converter too with no luck.
    If you have come across any such issue, please do let me know, thanks!
    Exception
    javax.faces.model.SelectItem@1b115c1b]
    [8/14/08 1:59:44:645 IST] 00000061 jsf E com.sun.faces.context.FacesContextImpl addMessage Adding Message[sourceId=emailmessage:*availableUsers* ,summary=*Conversion error occurred*.)
    [8/14/08 1:59:44:661 IST] 00000061 jsf E com.sun.faces.context.FacesContextImpl addMessage Adding Message[sourceId=emailmessage:selectedUsers,summary=Conversion error occurred.)
    JSF
    <h:selectManyListbox id="*availableUsers* " value="#{myBean.roleId}" converter="javax.faces.Long"
    binding="#{myBean.usersListBox}" size="5" style="width: 138px; height: 102px">
    <f:selectItems id="usersItems" value="#{myBean.usersList}"
    binding="#{myBean.usersListBoxSelectItems}" />
    </h:selectManyListbox></td>
    CLASS
    *{code}*
    *class MyBean*
    *private Long roleId;*
    *private List usersList;*
    *{code}*
    usersList is an arraylist of SelectItem where each SelectItem is composed of a Long value and a String label as per the convention.

    I tried using a List<Long>, but getting another error now, any help would be greatly appreciated, thanks!
    Error:
    [8/15/08 0:11:32:692 IST] 0000007e jsf E com.sun.faces.context.FacesContextImpl addMessage Adding Message[sourceId=emailmessage:selectedUsers,summary=Validation Error: Value is not valid)
    JSF Code:
    h:selectManyListbox id="selectedUsers" binding="#{myBean.selectedUsersListBox}" value="#{myBean.recipientIdList}" size="5"
    converter="#{myBean.recipientIdListConverter}" style="width: 138px; height: 102px">
    <f:selectItems id="selectedUsersItem" value="#{myBean.recipientList}" binding="#{myBean.selectedUsersListBoxSelectItems}" />
    </h:selectManyListbox>
    backing Bean Code for class myBean:
    {code}public List recipientList;
    private ArrayList recipientIdList;
    private HtmlSelectManyListbox selectedUsersListBox;
    private UISelectItems selectedUsersListBoxSelectItems;
    public Converter getRecipientIdListConverter() {
              return new Converter() {
                   public Object getAsObject(FacesContext facesContext,
                             UIComponent component, String value)
                             throws ConverterException {
                        if (value == null)
                             return null;                                                       
                        for (Iterator i = recipientIdList.iterator(); i.hasNext();) {
                             Long item = (Long) i.next();
                             String val = String.valueOf(item);
                             if (val.equals(value)) {
                                  return item;
                        return null;
                   public String getAsString(FacesContext facesContext,
                             UIComponent component, Object object)
                             throws ConverterException {
                        if (object instanceof SelectItem) {                         
                             return ((SelectItem) object).getValue().toString();
                        } else if (object instanceof Long) {
                             return String.valueOf(object);
                        } else {
                             return object.toString();
         }{code}

  • JSF doesn't set values for optionally rendered fields

    When I enter a value into an optionally rendered inputText, the resulting object property is never updated, but when I remove the "rendered=" code then the objects set property works every time.
    I am using the version of JSF that downloads with the latest version of Facelets, jsf-1.1_02-b08, since the newer version isn't compatible with the version of JSP that Tomcat 5.5.x runs. I'm not sure I have the option to run any newer versions of JSF/Facelets with Tomcat 5.5.x, much trial and error previously failed to get anything newer working.
    Is this a bug with an older version of JSF, and if so how can I get a new version to deploy with the version of JSP that Tomcat 5.5.x supports?

    There is a select box tied to the backing object that I change from "no" to "yes", and it triggers a submit, and when the page reloads there is an inputText with something like rendered="#{obj.listboxvalue == 'yes'}", the tex box renders when I select the "yes" option in the list box but the values are never set in the backing object. Pretty simple stuff, but it just doesn't work.

  • Selectitems conversion Error

    Hi ,
    I am using a selectitems tag :
    <h:selectOneMenu id="title">
    <f:selectItems value="#{WorkFLowBean.workFlowTitleOptions}" />
    </h:selectOneMenu>
    But i am getting the following error:
    javax.servlet.ServletException: Conversion Error setting value ''{0}'' for ''{1}''.
    Can it come from my faces-config.xml ?
    Here it is:
    <managed-bean>
    <description>
    TODO
    </description>
    <managed-bean-name>WorkFlowBean</managed-bean-name>
    <managed-bean-class>com.vivacances.boPackages.WorkFlowBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>waitRules</property-name>
    <property-class>java.lang.String</property-class>
    <value>cancel,sent</value>
    </managed-property>
    <managed-property>
    <property-name>inProgressRules</property-name>
    <property-class>java.lang.String</property-class>
    <value>cancel,sent</value>
    </managed-property>
    </managed-bean>
    Thank you all :-)

    ok i've found out what it was... i've made a mistake in the name of my bean !

  • SelectManyListbox Conversion error. Please Help

    In my application, I have a selecteManyListbox, but the selections are entirely optional.
    I have set required="false" in the component, still I see the message:
    Conversion Error setting value "" for '#{Page1.selections}'.
    The application works just fine if I select one or more options, so I do not think there is any problem in the code or the setup.
    How do I skip any conversion errors, so that I can proceed without any selections?

    Show your jsp page and source of the bean.

  • Numeric or value error: hex to raw conversion error , pls help

    I am having problem with a sproc which accepts a Raw parameter.
    I have a table called Profile:
    CREATE TABLE PROFILES
    PROFILEID INTEGER NOT NULL,
    USERID INTEGER NOT NULL,
    PROFILE RAW(255)
    and a sproc named addprofile
    CREATE OR REPLACE PROCEDURE addprofile
    profile IN RAW,
    userName IN VARCHAR2
    AS
    userId INT;
    BEGIN
    GetUserIdByName( userName, userId);
    INSERT INTO Profiles
    ( ProfileID,userId , profile )
    VALUES ( Profiles_ProfileID_SEQ.NEXTVAL,AddProfile.userId ,
    AddProfile.profile );
    END;
    I am calling the Ent Library's Insert profile method which is part of DbProfileProvider.cs (Security App block). It is trying to persist a serialized profile object into the database.
    private void InsertProfile(string userName, byte[] serializedProfile,
    Data.Database securityDb, IDbTransaction transaction)
    DBCommandWrapper cmd = securityDb.GetStoredProcCommandWrapper
    (SPAddProfile);
    cmd.AddInParameter("userName", DbType.String, userName);
    cmd.AddInParameter("profile", DbType.Binary, serializedProfile);
    securityDb.ExecuteNonQuery(cmd, transaction);
    I get the following error:
    Any suggestion on what needs to be changed to get this working? thanks!
    Exception Details: Oracle.DataAccess.Client.OracleException: ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error ORA-06512: at line 1
    Stack trace:
    [OracleException: ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error
    ORA-06512: at line 1]
    Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
    Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
    Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
    Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DBCommandWrapper command)
    Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DBCommandWrapper command, IDbTransaction transaction)
    Microsoft.Practices.EnterpriseLibrary.Security.Database.DbProfileProvider.InsertProfile(String userName, Byte[] serializedProfile, Database securityDb, IDbTransaction transaction)
    Microsoft.Practices.EnterpriseLibrary.Security.Database.DbProfileProvider.SetProfile(IIdentity identity, Object profile)
    [InvalidOperationException: Error saving the profile for the following user 'test'.]
    Microsoft.Practices.EnterpriseLibrary.Security.Database.DbProfileProvider.SetProfile(IIdentity identity, Object profile)
    EntLibSecuritySample.DFO.Security.SecurityHelper.SetUserProfile(IIdentity identity, Object Profile) in C:\DFO\Sample\Security\EntLibSecuritySample\SecurityHelper.vb:285
    [ApplicationException: An error has occurred saving profile object to Datastore. See stack trace for further information]
    EntLibSecuritySample.DFO.Security.SecurityHelper.SetUserProfile(IIdentity identity, Object Profile) in C:\DFO\Sample\Security\EntLibSecuritySample\SecurityHelper.vb:287
    EntLibSecuritySample.ProfilePage.cmdSaveProfile_Click(Object sender, EventArgs e) in C:\DFO\Sample\Security\EntLibSecuritySample\profile.aspx.vb:59
    System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    System.Web.UI.Page.ProcessRequestMain() +1292

    Harsh,
    I am not a user of the Enterprise Library so I can not speak to the specifics of that. However, here is a short sample that is based on the information you've provided. Perhaps it will be useful.
    Database:
    create table profiles
      profileid integer not null,
      userid    integer not null,
      profile   raw(255)
    create or replace procedure addprofile
      p_profileid in integer,
      p_userid    in integer,
      p_profile   in raw
    as
    begin
      insert into
        profiles (profileid, userid, profile)
        values (p_profileid, p_userid, p_profile);
    end;
    /C# code:
    using System;
    using System.Data;
    using System.Text;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    namespace HarshTest
      /// <summary>
      /// Summary description for Class1.
      /// </summary>
      class Class1
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
          // connect to local db using o/s authentication
          OracleConnection con = new OracleConnection("User ID=/; Pooling=False");
          con.Open();
          // create command object and set properties
          OracleCommand cmd = new OracleCommand();
          cmd.Connection = con;
          cmd.CommandText = "ADDPROFILE";
          cmd.CommandType = CommandType.StoredProcedure;
          // parameter object for profileid
          OracleParameter p_profileid = new OracleParameter();
          p_profileid.OracleDbType = OracleDbType.Int32;
          p_profileid.Value = 1;
          p_profileid.Direction = ParameterDirection.Input;
          // parameter object for userid
          OracleParameter p_userid = new OracleParameter();
          p_userid.OracleDbType = OracleDbType.Int32;
          p_userid.Value = 1;
          p_userid.Direction = ParameterDirection.Input;
          // create a byte array for the raw value
          ASCIIEncoding encoder = new ASCIIEncoding();
          byte[] byteArray = encoder.GetBytes("TestProfile");
          // parameter object for profile
          OracleParameter p_profile = new OracleParameter();
          p_profile.OracleDbType = OracleDbType.Raw;
          p_profile.Value = byteArray;
          p_profile.Direction = ParameterDirection.Input;
          // add parameters to collection
          cmd.Parameters.Add(p_profileid);
          cmd.Parameters.Add(p_userid);
          cmd.Parameters.Add(p_profile);
          // execute the stored procedure
          try
            cmd.ExecuteNonQuery();
          catch (OracleException ex)
            Console.WriteLine(ex.Message);
          // clean up objects
          p_profile.Dispose();
          p_userid.Dispose();
          p_profileid.Dispose();
          cmd.Dispose();
          con.Dispose();
    }Maybe the part about creating the byte array is what you are missing...
    - Mark

  • Re: Error, numeric or value error: character to number conversion error

    Can someone please please tell me why I'm getting this error and what I'm doing wrong? It looks like a simple error, "numeric or value error: character to number conversion error".
    My code is as follows:
    string connectionString = WebConfigurationManager.ConnectionStrings["DEMO_TEST"].ConnectionString;
    OracleConnection con = new OracleConnection(connectionString);
    OracleCommand cmd = new OracleCommand("DEMO.PKG_LOCATION_TYPE.INS", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add(new OracleParameter("@P_DESCRIPTION", OracleDbType.Varchar2, 60));
    cmd.Parameters["@P_DESCRIPTION"].Value = "Test_Description";
    cmd.Parameters.Add(new OracleParameter("@P_NAME", OracleDbType.Varchar2, 6));
    cmd.Parameters["@P_NAME"].Value = "Test_Name";
    cmd.Parameters.Add(new OracleParameter("@P_LOCATION_TYPE_CD", OracleDbType.Decimal, 4));
    cmd.Parameters["@P_LOCATION_TYPE_CD"].Direction = ParameterDirection.InputOutput;
    con.Open();
    try
    cmd.ExecuteNonQuery();
    catch
    //In case of an error
    finally
    con.Close();
    con.Dispose();
    And I recieve the following error block:
    Oracle.DataAccess.Client.OracleException was unhandled by user code
    Message="ORA-06502: PL/SQL: numeric or value error: character to number conversion error\nORA-06512: at line 1"
    Source="Oracle Data Provider for .NET"
    DataSource="demotest"
    Number=6502
    Procedure="DEMO.PKG_LOCATION_TYPE.INS"
    StackTrace:
    at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
    at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
    at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
    at System.Web.UI.WebControls.Wizard.OnFinishButtonClick(WizardNavigationEventArgs e)
    at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
    at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args)
    at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ********************************************************

    Are the parameters in your procedure in the same order as they are created in this code? Oracle command works by position unless you change it to be BindByName.
    Failing that you seem to have defined a parameter (P_NAME) to have a length of 6, and are then setting it's value to a string with a length of 9.
    Also the in/output parameter is defined as type decimal. Is this correct? It is defined as InputOutput but you don't assign it any value.
    If these suggestions don't help then perhaps if you post the stored procedure you might get some more ideas.
    HTH
    Lyndon

  • 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

  • JHS and JSF Validation Conversion Error Customizations

    Hello
    Have JHS done any work about JSF validation or conversion error customizations?
    I mean the error messages such as "lablename:"value mus be entered etc.
    What can i do if i want to globally customize and localize this error messages.
    I have copied the key such as "javax.faces.component.UIInput.REQUIRED" in my appdeff resource bundle but JHS (or maybe ADF) gives own message yet.
    I Apologize if my problem don't depend on JHS. I wonder that JHS overrided JSF default messages.
    Thank You

    JHeadstart does not use any JSF standard message.
    JHeadstart uses ADF Faces which comes with its own bundle of error messages.
    Please use the JDeveloper forum for instructions on modifying ADF Faces error messages.
    Steven Davelaar,
    JHeadstart Team.

  • How to custom a conversion error in JSF page in JDeveloper

    According to the book "Core JavaServer Faces" p213 (fifth edition), if I add the following line to messages.properties file, and specifiy it in the faces-config.xml and .jsp file, then the displayed conversion error message should be my tailored one instead of the default. However, I still get the default error message. Besides, I didn't find "CONVERSION" variable in UIInput class. Is the book wrong? And what's the correct way?
    javax.faces.component.UIInput.CONVERSION=Please correct your input

    I didn't choose any special in JDeveloper IDE. I just selected "new" to create a file called "message.properties" and put the line there. I didn't specify converters excepts declaring the type in the Jave Beans. I guess the converting is done by the JSF framework automatically. It must be a JSF converter since I created the page as a JSF page.

  • Error " conversion error between two character sets" in PI MONI

    Hi Experts
    I am doing file to Idoc scenario. I am getting the following error in PI MONI "conversion error between two character sets".
    please suggest me how to solve the issue.
    thanx in advance.

    Hi Mickael
    Below is the complete error message found in PI MONI.
    SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">SYSTEM_DUMP</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>PI Server : XBTO80__0000 : Conversion error between two character sets.</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

Maybe you are looking for

  • Restore contacts from AddressBook

    I don't know how I lost all my contacts in AddressBook in my MacBook as well as in my iPhone. The last thing I remembers was that I was downloading and installing iTune 9 and then sync my iPhone. I have not done any backup for my AddressBook. I disco

  • Sharing printer via Bluetooth

    Hi, Is't possible to share my network printers (or printers connected direct to my mac) to my mobile phone using bluetooth and Mac? Why? I want to print my text messages directly from the phone and it can only print to bluetooth printers.

  • I want to connect two pair for earphones to my IPAD at the same time is there a recommended splitter or amplifier I should use?

    I want to connect two pair for earphones to my IPAD at the same time is there a recommended splitter or amplifier I should use? 

  • Trying to Recover Data From Old Backup Exec Tapes

    I have been tasked with recovering data from an old Windows XP machine with an HP C1537A DDS3 tape drive.  The machine used Backup Exec to create the tapes.  In trying to recover the data I constantly get an error that says the data on the tape is in

  • Ambiguous Column ORA-00918

    Hi, Why does this work select dummy from dual d1 join dual d2 on (d1.dummy = d2.dummy) join dual d3 on (d1.dummy = d3.dummy) join dual d4 on (d1.dummy = d4.dummy) where dummy = 'X' and this doesn't select dummy from dual d1 join dual d2 on (d1.dummy