« Return to Thread: Is there a way to specify map-payload:column as nullable?

Is there a way to specify map-payload:column as nullable?

by karunasri kapu :: Rate this Message:

Reply to Author | View in Thread

Hello,

   This is my first post and I hope I am posting this to the right forum.

I have a simple program created which takes data from a source table (5 columns, all nullable except ID) and inserts into a copy target table. When I have values in all 5 columns in source table, the copy works fine. But when I have a null value for one of the columns in the target table, I get this error.

Is there a way for me to tell that the #[map-payload:COLUMN3] can be null? Or is using a POJO transformer my best option to resolve this?

I don’t have any transformers created or in place yet. This is a very straight forward select from and insert into type of an operation. I looked through the user guide to resolve this but just wasn’t able to find anything helpful.

Thanks,

-- Ankur

**********************************************************************
INFO  2009-07-02 08:50:44,230 [AppUsageModelIn.2] org.mule.component.simple.LogComponent:
********************************************************************************
* Message received in service: AppUsageModelIn. Content is: '{id=50,           *
* username=testuser1, login_ts=oracle.sql.TIMESTAMP@135133,            *
* column3=null, column4...[100 of 107]'                                   *
********************************************************************************
INFO  2009-07-02 08:50:44,246 [jdbcConnector.dispatcher.1] com.mulesource.mule.transport.jdbc.EEJdbcMessageDispatcher: Connected: endpoint.outbound.jdbc://outboundInsertStatement
ERROR 2009-07-02 08:50:44,246 [jdbcConnector.dispatcher.1] org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy: Expression Evaluator "map-payload" with expression "COLUMN3" returned null but a value was required.
org.mule.api.expression.RequiredValueException: Expression Evaluator "map-payload" with expression "COLUMN3" returned null but a value was required.
        at org.mule.expression.MapPayloadExpressionEvaluator.getValue(MapPayloadExpressionEvaluator.java:84)
        at org.mule.expression.MapPayloadExpressionEvaluator.evaluate(MapPayloadExpressionEvaluator.java:61)
        at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:170)
        at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:147)
        at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:109)
        at org.mule.transport.jdbc.JdbcConnector.getParams(JdbcConnector.java:314)
        at org.mule.transport.jdbc.sqlstrategy.SimpleUpdateSqlStatementStrategy.executeStatement(SimpleUpdateSqlStatementStrategy.java:53)
        at org.mule.transport.jdbc.JdbcMessageDispatcher.doSend(JdbcMessageDispatcher.java:67)
        at org.mule.transport.jdbc.JdbcMessageDispatcher.doDispatch(JdbcMessageDispatcher.java:54)
        at org.mule.transport.AbstractMessageDispatcher$Worker.run(AbstractMessageDispatcher.java:262)
        at org.mule.work.WorkerContext.run(WorkerContext.java:310)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
        at java.lang.Thread.run(Thread.java:619)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Is there a way to specify map-payload:column as nullable?