0

I'm trying to read a Table data in MYSQL DB using Mulesoft SELECT connector, but it's failing with the following error below

java.lang.RuntimeException: Attempted to send invalid data through http response.

Here is my Simple SQL Query to read table dataSELECT * FROM mydata;

My SQL connector configuration has JDBC Driver installed, the connection also has necessary configs added like db endpoint, username and password along with port, database name

what could be the issue? because the same query is working from my local terminal.

aled's user avatar
aled
26.4k4 gold badges36 silver badges52 bronze badges
askedMay 29 at 16:22
3
  • How are you transforming the data after select connector?CommentedMay 29 at 16:24
  • I'm not transforming the data after select connector, I'm just returning it as it isCommentedMay 29 at 16:27
  • When you ask a question it would be helpful to understand the issue to provide aminimal reproducible example.CommentedMay 29 at 18:30

1 Answer1

1

It may be due to incorrect transformation of result that comes from select connector. Add a transform message logic after select connector.

Here is an example:

%dw 2.0output application/json---payload
answeredMay 29 at 16:26
Karamchand's user avatar
Sign up to request clarification or add additional context in comments.

3 Comments

To add more context. The Database select operator returns a Java object, which cannot be sent as a HTTP Response. This transformer converts it to JSON that the HTTP Listener knows how to send as a response
Why the output as JSON?
@aled Based on the error it looks like OP wants to send the result as HTTP Response.

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.