camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sasha <saleem2m...@gmail.com>
Subject Error opening session. Cause: java.lang.NullPointerException
Date Mon, 16 Jan 2017 11:24:09 GMT
Hi all..

I'm getting the following exception while starting my bundle, while using
the below code.

<bean id="ds" class="com.mchange.v2.c3p0.ComboPooledDataSource">
		 <property name="driverClass"  value="oracle.jdbc.driver.OracleDriver"/> 
		 <property name="jdbcUrl" value="XXXXXXXXX"/> 
		 <property name="user" value="XXXX"/> 
		 <property name="password" value="XXXXX" /> 
	</bean> 

	<bean id="dataSource"
class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
       <argument ref="ds" />
    </bean>
    
    <bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
	
	<bean id="mybatisConfig"
class="org.springframework.core.io.ClassPathResource"> 
 		<argument value="SqlMapConfig.xml" /> 
 	</bean>

	<bean id="sqlSessionFactoryBean"
class="org.mybatis.spring.SqlSessionFactoryBean"> 
		<property name="dataSource" ref="dataSource"/> 
	    <property name="configLocation" ref="mybatisConfig"/>  
	    <property name="mapperLocations">
	    	<array value-type="org.springframework.core.io.Resource">
		         <bean class="org.springframework.core.io.ClassPathResource">  
					<argument value="mappings/PromisMessaging.xml" />  
				 </bean> 
				 
	        </array>
	    </property> 
    </bean> 
	
	<bean id="sqlSessionFactory"
class="org.apache.ibatis.session.SqlSessionFactory"
factory-ref="sqlSessionFactoryBean" 
		factory-method="getObject" />

	<bean id="myBatis"
class="org.apache.camel.component.mybatis.MyBatisComponent">
    	<property name="sqlSessionFactory" ref="sqlSessionFactory" />
	</bean> 

	 
	
	<bean id="PROPAGATION_REQUIRED"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
        <property name="transactionManager" ref="txManager"/>
        <property name="propagationBehaviorName"
value="PROPAGATION_REQUIRED"/>
    </bean>

-----------------
Error:
-----------------
org.apache.ibatis.exceptions.PersistenceException:
### Error opening session.  Cause: java.lang.NullPointerException
### Cause: java.lang.NullPointerException
        at
org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)[280:org.mybatis.mybatis:3.2.5]
        at
org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:88)[280:org.mybatis.mybatis:3.2.5]
        at
org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:43)[280:org.mybatis.mybatis:3.2.5]
        at
org.apache.camel.component.mybatis.MyBatisProducer.process(MyBatisProducer.java:51)[282:org.apache.camel.camel-mybatis:2.12.0.redhat-611412]
        at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.loadbalancer.QueueLoadBalancer.process(QueueLoadBalancer.java:43)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.processor.loadbalancer.LoadBalancerSupport.process(LoadBalancerSupport.java:87)[144:org.apache.camel.camel-core:2.12.0.redhat-611412]
        at
org.apache.camel.component.quartz2.CamelJob.execute(CamelJob.java:52)[1549:org.apache.camel.camel-quartz2:2.12.0.redhat-610379]
        at
org.quartz.core.JobRunShell.run(JobRunShell.java:202)[1545:org.quartz-scheduler.quartz:2.2.1]
        at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[1545:org.quartz-scheduler.quartz:2.2.1]
Caused by: java.lang.NullPointerException
        at
org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:83)[280:org.mybatis.mybatis:3.2.5]



--
View this message in context: http://camel.465427.n5.nabble.com/Error-opening-session-Cause-java-lang-NullPointerException-tp5792565.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message