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" <claus.ib...@gmail.com> wrote:

>Hi
>
>Do you have a stacktarce of the NPE?
>
>On Fri, Mar 27, 2015 at 5:35 PM, Wilkerson, Daniel
><dwilker...@fullsail.com> 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
>>BindyCsvDataFormat("com.some.package.path.domain");
>>
>>             from
>>("sftp:user@somedomain:4444/?password=********&binary=false&download=true
>>&fileName=data.csv&consumer.delay=" + delay)
>>             .log("<<<<Before
>>Unmarshall>>>>").unmarshal(bindy).log(LoggingLevel.INFO, "BODY OUTPUT:
>>${body}")
>>             
>>.to("mybatis:insert?statementType=Insert&executorType=batch");
>>
>>
>> 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.
>Email: cib...@redhat.com
>Twitter: davsclaus
>Blog: http://davsclaus.com
>Author of Camel in Action: http://www.manning.com/ibsen
>hawtio: http://hawt.io/
>fabric8: http://fabric8.io/

Reply via email to