Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I just started with Mule, after working with OSB for months. I'm trying to use a database connector to select data from my postgres DB. The test connection says it's successful.

XML:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
    <db:generic-config name="PostgreSQL_mule" url="jdbc:postgresl://localhost:5432/mule?user=mule&amp;password=mule" driverClassName="org.postgresql.Driver" doc:name="Generic Database Configuration"/>
    <flow name="CheckOnline" doc:name="CheckOnline">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8085" path="CheckOnline" doc:name="HTTP"/>
        <set-payload value="Winkel is online" doc:name="Set Payload"/>
    </flow>
    <flow name="BestelItems" doc:name="BestelItems">
        <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8085" path="BestelItems" doc:name="HTTP"/>
        <db:select config-ref="PostgreSQL_mule" doc:name="Database">
            <db:parameterized-query><![CDATA[SELECT *
FROM OnlineWinkel.Items;]]></db:parameterized-query>
        </db:select>
        <set-payload value="blabla" doc:name="Set Payload"/>
    </flow>
</mule>

DB:

DB table Item

Problem: When I run this, I get an error with the DB connector:

ERROR 2014-07-31 15:32:13,984 [[test].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy: 
********************************************************************************
Message               : null (java.lang.NullPointerException). Message payload is of type: String
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. null (java.lang.NullPointerException)
  org.mule.module.db.internal.domain.connection.DefaultDbConnection:99 (null)
2. null (java.lang.NullPointerException). Message payload is of type: String (org.mule.api.MessagingException)
  org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.NullPointerException
    at org.mule.module.db.internal.domain.connection.DefaultDbConnection.isClosed(DefaultDbConnection.java:99)
    at org.mule.module.db.internal.domain.connection.TransactionalDbConnectionFactory.releaseConnection(TransactionalDbConnectionFactory.java:150)
    at org.mule.module.db.internal.processor.AbstractDbMessageProcessor.process(AbstractDbMessageProcessor.java:87)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

I have no idea what's going wrong. I don't use any variable in the DB connector or in my query, so their can't be anything that is 'null'.

Anyone has an idea what is going wrong or how I can debug this better? The error message isn't helping at all nor is the stacktrace.

share|improve this question
    
Did you tested your query SELECT * FROM OnlineWinkel.Items;from Database ?? Are the value showing when you run this query in DB sql query editor ? –  Anirban Sen Chowdhary Jul 31 at 14:29

1 Answer 1

I had a typo in my JDBC string.

Although Mule said that the test connection was successful, the string was missing a 'q'.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.