javax.ejb.EJBException: ejbCreate: ORA-01401

Discussions

EJB programming & troubleshooting: javax.ejb.EJBException: ejbCreate: ORA-01401

  1. javax.ejb.EJBException: ejbCreate: ORA-01401 (1 messages)

    Hi, everybody!
    Anyone experienced this error?

    javax.ejb.EJBException: ejbCreate: ORA-01401: inserted value too large for column
     at examples.account.AccountEJB.ejbCreate(AccountEJB.java:68)
     at examples.account.AccountEJBEOImpl.create(AccountEJBEOImpl.java:55)
     ...
     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)


    [Part of source code(AccountEJB.java)]
       public String ejbCreate(String id, String firstName,
          String lastName, double balance)
          throws CreateException {

          if (balance < 0.00) {
             throw new CreateException
                ("A negative initial balance is not allowed.");
          }

          try {
             insertRow(id, firstName, lastName, balance);
          } catch (Exception ex) {
              throw new EJBException("ejbCreate: " + ex.getMessage()); // This causes problem...
          }

          this.id = id;
          this.firstName = firstName;
          this.lastName = lastName;
          this.balance = balance;

          return id;
       }

    Thanks in advance!
  2. hi
    this is an Oracle error.
    This happens when you are trying to insert a value in database , i.e larger than the size specified in database.
    for example ....
    in your database table is like this

    name varchar2(10)

    but you are trying to insert "Ashim Chakraborty" in that field.

    Hopefully it will solve your problem.


    Ashim