Last active
December 12, 2015 10:48
-
-
Save ricston-git/4761352 to your computer and use it in GitHub Desktop.
groovy expression does not return null
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="myFlow"> | |
... | |
<jdbc:outbound-endpoint queryKey="insertElement" connector-ref="jdbcConnector" /> | |
... | |
</flow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<jdbc:connector name="jdbcConnector" dataSource-ref="jdbcDataSource"> | |
<jdbc:query key="insertElement" value="INSERT INTO MyTable (id, date) VALUES (#[function:uuid], #[groovy:result = (payload.date == null ? null : com.ricston.XmlUtils.toSqlDate(payload.date))])"/> | |
</jdbc:connector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<jdbc:connector name="jdbcConnector" dataSource-ref="jdbcDataSource"> | |
<jdbc:query key="insertElement" value="INSERT INTO MyTable (id, date) VALUES (#[function:uuid], #[groovy:payload.date == null ? null : com.ricston.XmlUtils.toSqlDate(payload.date)])"/> | |
</jdbc:connector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exception stack is: | |
1. Unable to convert between org.mule.transport.NullPayload and JAVA_OBJECT.(SQL Code: 0, SQL State: + 22005) (java.sql.SQLException) | |
net.sourceforge.jtds.jdbc.Support:533 (null) | |
2. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=jdbc://insertElement, connector=EEJdbcConnector | |
... | |
******************************************************************************** | |
Root Exception stack trace: | |
java.sql.SQLException: Unable to convert between org.mule.transport.NullPayload and JAVA_OBJECT. | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment