camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilkerson, Daniel" <>
Subject Re: MyBatis Camel Route Config - ### Error opening session. Cause: java.lang.NullPointerException
Date Mon, 30 Mar 2015 14:36:30 GMT
Hi Everyone. I solved the issue. It was a case of tired eyes: naming issue
in SqlMapConfig <environment> tag. Thank you for taking a look Claus. I
appreciate it.

On 3/27/15 1:08 PM, "Claus Ibsen" <> wrote:

>Do you have a stacktarce of the NPE?
>On Fri, Mar 27, 2015 at 5:35 PM, Wilkerson, Daniel
><> wrote:
>> Hi everyone. I'm working on a small prototype using Camel, Bindy, and
>>MyBatis. I'm currently doing this as a standalone Camel app. I'm not
>>currently using Spring or Blueprint, just Java DSL. I'm trying to keep
>>this a simple as possible for the time being. We are looking at this
>>strategy to port an existing MyBatis based integration solution to Camel
>>and MyBatis.
>> My code and Camel are able to bring in CSV files via the sFTP endpoint,
>>process (bind) the files to a list of Bean, and I'm trying to route it
>>directly to a camel-mybatis endpoint. Everything seems to be working
>>fine until it tries to create the SqlSession. I get the error: ### Error
>>opening session.  Cause: java.lang.NullPointerException
>> I have distilled our previous mybatis-config.xml down to one single
>><environment></environment> for testing. I've read the MyBatis component
>>page on the Camel site and see that for a Spring based config, the
>>session has to be externalized outside of the SqlMapConfig.xml.  I'm
>>doing my development in Eclipse using a Maven project. The Maven runtime
>>I'm using inside of Eclipse is 3.0.4
>> Is this the same for a DSL implementation not using Spring? How do I
>>get Camel to crank up a SqlSession? Also, once I get it to connect, how
>>do I switch between different connections configured in between
>><environment></environment> tags?
>> My DSL route that's inside my RouteBuilder subclass is:
>>   DataFormat bindy = new
>>             from
>>&fileName=data.csv&consumer.delay=" + delay)
>>             .log("<<<<Before
>>Unmarshall>>>>").unmarshal(bindy).log(LoggingLevel.INFO, "BODY OUTPUT:
>> I think once I get the SqlSession to work the above route will work
>>great. Thanks in advance for any help!
>> Daniel
>Claus Ibsen
>Red Hat, Inc.
>Twitter: davsclaus
>Author of Camel in Action:

View raw message