Skip to Content
avatar image
Former Member

Cannot assign a blank-padded string to host variable 4

I was running this Rental Car Application.

I was unable to save a row into DB.

I saw trace statements in <b>default.trace.</b> log file under

C:\usr\sap\J2E\JC00\j2ee\cluster\server0\log.

I made sure none of them is null by printing them in Session EJB before calling the entity bean.

Does anyone has an insight on this?

Pleaseeeeeeee help me in this matter.

And also is that how we see the log/System.out.print statements or is there an easy way to check the log/System.out.print statments?

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 02, 2005 at 09:08 AM

    Hi Mark

    Before you call the "create" Method of your QuickBookingBean do the following:

    bookingId = bookingId.trim();

    vehicleTypeId = vehicleTypeId.trim();

    pickupLocation = pickupLocation.trim();

    dropoffLocation = dropoffLocation.trim();

    I also did the same in the Servlet Method:

    formatBooking(QuickBookingModel[] bookings)

    booking[0] = bookings<i>.getBookingId().trim()

    booking[1] = bookings<i>.getVehicleType().trim();

    booking[2] = bookings<i>.getPickupLocation().trim();

    booking[3] = bookings<i>.getDropoffLocation().trim();

    booking[4] = bookings<i>.getDateFrom().trim();

    booking[5] = bookings<i>.getDateTo().trim();

    booking[6] = bookings<i>.getPrice().trim();

    It solved my problem.

    Regards Paul

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Guys,

      I am getting a similar problem, can you please help out? cmp field is not blank string yet I am getting the error.

      _33##0#0#Info##Plain###Remote Exception in Create: CreateA2iLogin: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method a2i.beans.login.LoginHomeImpl0.create(java.lang.String).

      at a2i.beans.login.LoginHomeImpl0.create(LoginHomeImpl0.java:408)

      at a2i.beans.login.LoginHome_Stub.create(LoginHome_Stub.java:56)

      at com.nibco.a2i.beans.A2iLogin.createA2iLogin(A2iLogin.java:118)

      at com.nibco.a2i.beans.A2iLogin.<init>(A2iLogin.java:38)

      at com.nibco.training.servlet.SayHelloServlet.doPost(SayHelloServlet.java:121)

      at com.nibco.training.servlet.SayHelloServlet.doGet(SayHelloServlet.java:32)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

      at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:391)

      at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:265)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)

      at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

      at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

      at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

      at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

      at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

      at java.security.AccessController.doPrivileged(Native Method)

      at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

      at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

      Caused by: com.sap.engine.services.ejb.entity.ContainerException: Exception in method ejbStore().

      at com.sap.engine.services.ejb.entity.ContextFP.store(ContextFP.java:118)

      at com.sap.engine.services.ejb.entity.ContextFP.store0(ContextFP.java:103)

      at com.sap.engine.services.ejb.entity.Context.passivate(Context.java:235)

      at a2i.beans.login.LoginHomeImpl0.create(LoginHomeImpl0.java:401)

      ... 21 more

      Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed. The persistent object is a2i.beans.login.LoginBean0Persistent.

      at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:101)

      at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)

      at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)

      at com.sap.engine.services.ejb.entity.pm.TransactionContext.finishWork(TransactionContext.java:454)

      at a2i.beans.login.LoginBean0PM.ejbStore(LoginBean0PM.java:184)

      at com.sap.engine.services.ejb.entity.ContextFP.store(ContextFP.java:115)

      ... 24 more

      Caused by: com.sap.sql.log.OpenSQLException: Cannot assign an empty string to host variable 1.

      at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)

      at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)

      at com.sap.sql.jdbc.common.CommonPreparedStatement.setString(CommonPreparedStatement.java:584)

      at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setString(PreparedStatementWrapper.java:341)

      at a2i.beans.login.LoginBean0Persistent.ejb_iInsert(LoginBean0Persistent.java:335)

      at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)

      ... 29 more

      ; nested exception is:

      com.sap.engine.services.ejb.entity.ContainerException: Exception in method ejbStore().#

      #1.5#001143A7AF4000680000005900000F4C00040C3E95D97A60#1139362848402#System.out#sap.com/A2IEARCURR#System.out#Guest#0####edec5450984311da917b001143a7af40#SAPEngine_Application_Thread[impl:3]_33##0#0#Info##Plain###Success 2#

  • Jun 24, 2005 at 08:15 AM

    Hi Mark,

    This issues is described herehttp://help.sap.com/saphelp_nw04/helpdata/en/13/dbb2b66146934a9662918755038ea1/frameset.htm">here>:

    <i>cmp-fields with java.lang.String or byte[] Java types at runtime must not have an empty value. This may lead to unpredictable database behavior.</i>

    Regarding your second question about System.out.print statements, of course you can look for them in the defaultTrace.trc files, but you could also use the LogViewer to display them. Check the following link:

    http://help.sap.com/saphelp_nw04/helpdata/en/57/5f1140d72dc442e10000000a1550b0/frameset.htm

    Hope that helps!

    Vladimir

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Vladimir Pavlov

      Vladmir,

      The values are not empty too.Iam sure about that.

      Iam really sorry for not mentioning it in the previous messages.

  • avatar image
    Former Member
    Aug 02, 2005 at 08:23 AM

    Hi Mark

    I have the same problem. The values are neither NULL nor

    "".

    Did you find a solution?

    Thanx Paul

    Add comment
    10|10000 characters needed characters exceeded