AnsweredAssumed Answered

Seeting up Hikari Connection pool with Actitviti DB

Question asked by mann.frnd@gmail.com on Nov 18, 2014
Latest reply on Nov 20, 2014 by jbarrez
HI

I want to use HIkari as a connection pool and jtds as a driver. Following is my configuration.

<bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
    <property name="dataSourceClassName" value="net.sourceforge.jtds.jdbcx.JtdsDataSource" />
    <property name="dataSourceProperties">
        <props>
            <prop key="url">jdbc:jtds:sqlserver://localhost:1433/Galileo_DB</prop>
            <prop key="user">galileo_user</prop>
            <prop key="password">Galileo@2014</prop>
        </props>
    </property>
</bean>
  
<!– HikariCP configuration –>
<bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
    <constructor-arg ref="hikariConfig" />
</bean>

  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
  </bean>
 
  <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="databaseSchemaUpdate" value="true" />
    <property name="jobExecutorActivate" value="false" />
    <property name="databaseSchema" value="activiti" />
    <property name="databaseTablePrefix" value="activiti." />  
    <property name="deploymentResources" value="classpath*:*.bpmn" />
  </bean>
 
  <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
                <property name="processEngineConfiguration" ref="processEngineConfiguration" />
  </bean>


And I’m getting the following error.
Nov 18, 2014 4:44:09 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.zaxxer.hikari.HikariDataSource]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.beans.IntrospectionException: Method not found: setUrl
       at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:278)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1114)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1017)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
       at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
       at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
       at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
       at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
       at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221)
       at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
       at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
       at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.zaxxer.hikari.HikariDataSource]: Constructor threw exception; nested exception is java.lang.RuntimeException: java.beans.IntrospectionException: Method not found: setUrl
       at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:164)
       at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:125)
       at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:270)
       … 23 more
Caused by: java.lang.RuntimeException: java.beans.IntrospectionException: Method not found: setUrl
       at com.zaxxer.hikari.util.PropertyBeanSetter.setProperty(PropertyBeanSetter.java:129)
       at com.zaxxer.hikari.util.PropertyBeanSetter.setTargetFromProperties(PropertyBeanSetter.java:58)
       at com.zaxxer.hikari.pool.HikariPool.initializeDataSource(HikariPool.java:532)
       at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:138)
       at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:104)
       at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
       at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
       … 25 more
Caused by: java.beans.IntrospectionException: Method not found: setUrl
       at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:110)
       at com.zaxxer.hikari.util.PropertyBeanSetter.setProperty(PropertyBeanSetter.java:120)
       … 35 more


Please let me know where I’m doing wrong in my configurations.

Thanks!

Outcomes