Integrating OSworkflow with Spring and Hibernate - spring

How can I integrate OSworkflow with spring and hibernate.What are the configuration i need to specify in xml files and which jar files are requires for it.
Update
I have defined the applicationContext.xml as follows
<bean id="workflowStore" class="com.opensymphony.workflow.spi.hibernate.SpringHibernateWorkflowStore" autowire="byName"> <property name="resource" value="workflow-defs.xml"/>
<property name="reload" value="true"/> </bean>
<bean id="workflowFactory" class="com.opensymphony.workflow.loader.XMLWorkflowFactory" init-method="initDone"/>
<bean id="workflowConfiguration" class="com.opensymphony.workflow.config.SpringConfiguration">
<property name="store"><ref local="workflowStore"/></property>
<property name="factory"><ref local="workflowFactory"/></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="namingStrategy">
<bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache/ehcache-hibernate-local.xml</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="packagesToScan" value="net.top.*.entity.*" />
<property name="mappingResources">
<list>
<value>com/opensymphony/workflow/spi/hibernate/WorkflowDescriptor.hbm.xml</value>
<value>com/opensymphony/workflow/spi/hibernate/HibernateCurrentStep.hbm.xml</value>
<value>com/opensymphony/workflow/spi/hibernate/HibernateHistoryStep.hbm.xml</value>
<value>com/opensymphony/workflow/spi/hibernate/HibernateWorkflowEntry.hbm.xml</value>
<value>com/opensymphony/module/propertyset/hibernate/PropertySetItemImpl.hbm.xml</value>
</list>
</property>
</bean>
It shows an error as
Could not determine type for: com.opensymphony.workflow.loader.NotNullStringType, for columns: [org.hibernate.mapping.Column(value)]
Did i miss anything?.

Related

FATAL: database "dbName/" does not exist

I am using Spring 4.3.9, Hibernate 5.4.1 with PostgresQL 9.3.
When I start tomcat container using ./catalina.sh run. I get below error in the log file.
org.postgresql.util.PSQLException: FATAL: database "emgda/" does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2559)
at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:133)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:250)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:454)
at org.postgresql.Driver.connect(Driver.java:256)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:135)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Though the database along with data exists. Below are the configurations.
<beans xmlns="http://www.springframework.org/schema/beans"
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-3.0.xsd">
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="org.postgresql.Driver"/>
<property name="jdbcUrl" value="jdbc:postgresql://192.168.1.230:5432/emgda/"/>
<property name="user" value="user"/>
<property name="password" value="some_password"/>
<property name="minPoolSize" value="20"/>
<property name="maxPoolSize" value="50"/>
<property name="breakAfterAcquireFailure" value="false"/>
<property name="acquireRetryAttempts" value="3"/>
<property name="idleConnectionTestPeriod" value="300"/>
<property name="testConnectionOnCheckout" value="true"/>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.cache.use_second_level_cache">false</prop>
<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</prop>
<prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory</prop>
<prop key="hibernate.generate_statistics">false</prop>
<prop key="hibernate.cache.use_structured_entries">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<value>com.emg.server.db.Apps</value>
</list>
</property>
</bean>
<bean id="emgDaoSupport" class="com.emg.server.db.EMGDaoSupport">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</beans>
Remove last "/" on jdbc:postgresql://192.168.1.230:5432/emgda/,

java.naming.provider.url in <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> using YAML

jms.java.naming.provider.url is NOT getting value from application.yaml
<bean id="yamlProperties" class="org.springframework.beans.factory.config.YamlPropertiesFactoryBean">
<property name="resources" value="classpath:application.yaml"/>
</bean>
<context:property-placeholder properties-ref="yamlProperties"/>
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">string-works</prop>
<prop key="java.naming.provider.url">${jms.java.naming.provider.url}</prop>
</props>
</property>
</bean>

com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory cannot be cast to org.hibernate.resource.transaction.TransactionCoordinatorBuilder

Trying to connect two different datasources with the Atomikos transaction manager getting the below error
Caused by: java.lang.ClassCastException: com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory cannot be cast to org.hibernate.resource.transaction.TransactionCoordinatorBuilder
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:Application.properties" />
</bean>
<bean id="oracleSessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="oraclesDataSource" />
<property name="mappingResources">
<list>
<value>persons.hbm.xml </value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<!-- <prop key="hibernate.autocommit">true</prop>
<prop key="hibernate.connection.isolation">3</prop> -->
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.transaction.factory_class">
com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory
</prop>
<prop key="hibernate.transaction.manager_lookup_class">
com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup
</prop>
<!-- <prop key="hibernate.current_session_context_class">thread</prop> -->
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.max_size">10</prop>
<prop key="hibernate.c3p0.timeout">300</prop>
</props>
</property>
</bean>
<bean id="mysqlSessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="mysqlDataSource" />
<property name="mappingResources">
<list>
<value>persons.hbm.xml </value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<!-- <prop key="hibernate.autocommit">ture</prop>
<prop key="hibernate.connection.isolation">3</prop> -->
<prop key="hibernate.current_session_context_class">jta</prop>
<prop key="hibernate.transaction.factory_class">
com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory
</prop>
<prop key="hibernate.transaction.manager_lookup_class">
com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup
</prop>
<!-- <prop key="hibernate.current_session_context_class">thread</prop> -->
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.max_size">10</prop>
<prop key="hibernate.c3p0.timeout">300</prop>
</props>
</property>
</bean>
<tx:annotation-driven proxy-target-class="true" />
<tx:jta-transaction-manager
transaction-manager="atomikosTransactionManager" />
<tx:annotation-driven transaction-manager="atomikosTransactionManager"
proxy-target-class="true" />
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
init-method="init" destroy-method="close">
<property name="forceShutdown" value="false" />
</bean>
<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.J2eeUserTransaction">
<property name="transactionTimeout" value="300" />
</bean>
<tx:annotation-driven />
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager"
depends-on="atomikosTransactionManager,atomikosUserTransaction">
<property name="transactionManager" ref="atomikosTransactionManager" />
<property name="userTransaction" ref="atomikosUserTransaction" />
<!-- <property name="allowCustomIsolationLevels" value="true" /> -->
</bean>
<bean id="mysqlDataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean"
init-method="init" destroy-method="close">
<property name="uniqueResourceName">
<value>mySqlDataSource</value>
</property>
<property name="xaDataSourceClassName">
<value>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</value>
</property>
<property name="xaProperties">
<props>
<prop key="databaseName">sys</prop>
<prop key="serverName">localhost</prop>
<prop key="port">3306</prop>
<prop key="user">root</prop>
<prop key="password">magesh123</prop>
<prop key="url">jdbc:mysql://localhost:3306/sys</prop>
</props>
</property>
<property name="minPoolSize">
<value>1</value>
</property>
</bean>
<bean id="oraclesDataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean"
init-method="init" destroy-method="close">
<property name="uniqueResourceName">
<value>OracleDataSource</value>
</property>
<property name="xaDataSourceClassName">
<value>oracle.jdbc.xa.client.OracleXADataSource</value>
</property>
<property name="xaProperties">
<props>
<prop key="databaseName">XE</prop>
<prop key="serverName">localhost</prop>
<!-- <prop key="port">1521</prop> -->
<prop key="user">system</prop>
<prop key="password">magesh123</prop>
<prop key="URL">jdbc:oracle:thin:#localhost:1521:XE</prop>
</props>
</property>
<property name="minPoolSize">
<value>1</value>
</property>
</bean>
<bean id="persons" class="com.bnym.aal.poc.spring_jta.Persons">
</bean>
<bean id="App" class="com.bnym.aal.poc.spring_jta.App">
<property name="springJtaDaoClass" ref="springJtaDaoClass" />
</bean>
<bean id="springJtaDaoClass" class="com.bnym.aal.poc.spring_jta.springJtaDaoClass">
<property name="oracleSessionFactory" ref="oracleSessionFactory" />
<property name="mysqlSessionFactory" ref="mysqlSessionFactory" />
<property name="atomikosTransactionManager" ref="transactionManager" />
<property name="persons" ref="persons" />
</bean>
Changed my hibernate transaction manager to below one and the Transaction manager worked
<prop key="hibernate.transaction.factory_class">
org.hibernate.transaction.CMTTransactionFactory
</prop>
Please refer to the below Git url for the POC on the Atomikos transaction manager for the out of box integration of the Spring - JTA
https://github.com/mageshsrinivasulu/spring-jta.git

Spring same dataSource for different JdbcTemplates

I have different DAO's that have the same class that require different jdbcTemplates who all use the same type of dataSources. Is there a way to consolidate my code, so I don't need to use so much copy and paste.
An example of what I have in xml is:
<bean id="jdbcTemplate1" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="jdbcDataSource1" />
</bean>
<bean id="jdbcDataSource1" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="shutdown">
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariConfig">
<constructor-arg>
<props>
<prop key="dataSource.url">dataSourceUrl
</prop>
<prop key="dataSource.user">user</prop>
<prop key="dataSource.password">password</prop>
</props>
</constructor-arg>
<property name="dataSourceClassName"
value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" />
</bean>
</constructor-arg>
</bean>
<bean id="jdbcTemplate2" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="jdbcDataSource2" />
</bean>
<bean id="jdbcDataSource2" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="shutdown">
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariConfig">
<constructor-arg>
<props>
<prop key="dataSource.url">dataSourceUrl
</prop>
<prop key="dataSource.user">user</prop>
<prop key="dataSource.password">password</prop>
</props>
</constructor-arg>
<property name="dataSourceClassName"
value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" />
</bean>
</constructor-arg>
</bean>
As seen by the code, jdbcDataSource1 and jdbcDataSource2 are the same. So is there a way to consolidate the two?
This would be the way to pass the same datasource to the two JDBC templates:
<bean id="jdbcTemplate1" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="jdbcDataSource" />
</bean>
<bean id="jdbcTemplate2" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="jdbcDataSource" />
</bean>
<bean id="jdbcDataSource" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="shutdown">
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariConfig">
<constructor-arg>
<props>
<prop key="dataSource.url">dataSourceUrl
</prop>
<prop key="dataSource.user">user</prop>
<prop key="dataSource.password">password</prop>
</props>
</constructor-arg>
<property name="dataSourceClassName"
value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" />
</bean>
</constructor-arg>
</bean>
You can keep one template and one datasource in bean definitions. If your dao's template are already predefined and you don't want to change it, you can still use only one jdbc template as follows:
<bean id="yourDao1" class="package.YourDao1">
<property name="jdbcTemplate1" ref="jdbcTemplate" />
</bean>
<bean id="yourDao2" class="package.YourDao2">
<property name="jdbcTemplate2" ref="jdbcTemplate" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="jdbcDataSource" />
</bean>
<bean id="jdbcDataSource" class="com.zaxxer.hikari.HikariDataSource"
destroy-method="shutdown">
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariConfig">
<constructor-arg>
<props>
<prop key="dataSource.url">dataSourceUrl
</prop>
<prop key="dataSource.user">user</prop>
<prop key="dataSource.password">password</prop>
</props>
</constructor-arg>
<property name="dataSourceClassName"
value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" />
</bean>
</constructor-arg>
</bean>

Not seeing BoneCP shutdown() with Hibernate, Spring, Bonecp

I am implementing an application with Spring, Hibernate and BoneCP. When I invoke the shutdown script of Tomcat I see errors like this
The web application [/REST] appears to have started a thread named [BoneCP-release-thread-helper-thread] but has failed to stop it. This is very likely to create a memory leak.
When i see my logs, I am not seeing "Shutting down connection pool...", so I am assuming I am missing something over here.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oxm="http://www.springframework.org/schema/oxm"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-1.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"
xmlns:context="http://www.springframework.org/schema/context">
<bean id="LookupService" class="com.appserver.rest.LookupService">
<property name="userManager" ref="UserManager"></property>
<property name="groupManager" ref="GroupManager"></property>
<property name="messageManager" ref="MessageManager"></property>
<property name="tokenManager" ref="TokenManager"></property>
<property name="accessManager" ref="AccessManager"></property>
<property name="rosterManager" ref="RosterManager"></property>
</bean>
<bean id="LookupServiceV2" class="com.appserver.rest.LookupServiceV2"
parent="LookupService">
</bean>
<bean id="UserManager" class="com.appserver.rest.UserManager">
<constructor-arg index="0">
<ref bean="authManager" />
</constructor-arg>
</bean>
<bean id="GroupManager" class="com.appserver.rest.GroupManager">
<constructor-arg index="0">
<ref bean="authManager" />
</constructor-arg>
</bean>
<bean id="MessageManager" class="com.appserver.rest.MessageManager">
</bean>
<bean id="TokenManager" class="com.appserver.rest.TokenManager">
<constructor-arg index="0">
<ref bean="secureRandom" />
</constructor-arg>
</bean>
<bean id="authManager" class="com.appserver.rest.AuthenticationManager">
<constructor-arg index="0">
<ref bean="secureRandom" />
</constructor-arg>
</bean>
<bean id="AccessManager" class="com.appserver.rest.AccessManager">
</bean>
<bean id="RosterManager" class="com.appserver.rest.RosterManager">
</bean>
<bean id="secureRandom" class="java.security.SecureRandom">
</bean>
<bean id="messageDeleteScheduler" class="com.appserver.schema.MessageDeleteScheduler" />
<bean id="messageDeleteJob"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="messageDeleteScheduler" />
<property name="targetMethod" value="scheduleMessageDeletion" />
</bean>
<bean id="messageDeleteTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="messageDeleteJob" />
<property name="repeatInterval" value="3600000" />
<property name="startDelay" value="1000" />
</bean>
<bean id="quartz" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" destroy-method="destroy" >
<property name="jobDetails">
<list>
<ref bean="messageDeleteJob" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="messageDeleteTrigger" />
</list>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
autowire="autodetect">
<property name="dataSource" ref="dataSource" />
<property name="annotatedClasses">
<list>
<value>com.appserver.schema.GroupDB</value>
<value>com.appserver.schema.UserDB</value>
<value>com.appserver.schema.MessageDB</value>
<value>com.appserver.schema.UserBlockDB</value>
<value>com.appserver.schema.GroupUserMapperDB</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<!-- <prop key="hibernate.connection.provider_class">com.jolbox.bonecp.provider.BoneCPConnectionProvider</prop> -->
<!-- <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
<prop key="hibernate.connection.url">jdbc:mysql://localhost/testdb</prop>
<prop key="hibernate.connection.username">alpha1</prop>
<prop key="hibernate.connection.password">r0cktheworld</prop>
<prop key="hibernate.connection.pool_size">50</prop>
-->
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
<prop key="hibernate.globally_quoted_identifiers">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EHCacheProvider</prop>
<!-- <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop> -->
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_structured_entries">true</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<!-- this is connection provider -->
<!-- and this is how you configure it -->
<prop key="jadira.usertype.autoRegisterUserTypes">true</prop>
<prop key="jadira.usertype.databaseZone">jvm</prop>
<prop key="jadira.usertype.javaZone">jvm</prop>
</props>
</property>
</bean>
<!-- Spring bean configuration. Tell Spring to bounce off BoneCP -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<property name="targetDataSource">
<ref local="mainDataSource" />
</property>
</bean>
<bean id="mainDataSource" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="jdbcUrl" value="jdbc:mysql://localhost/dbrocker" />
<property name="username" value="root"/>
<property name="password" value="root123"/>
<property name="idleConnectionTestPeriod" value="60"/>
<property name="idleMaxAge" value="240"/>
<property name="maxConnectionsPerPartition" value="60"/>
<property name="minConnectionsPerPartition" value="20"/>
<property name="partitionCount" value="3"/>
<property name="acquireIncrement" value="10"/>
<property name="statementsCacheSize" value="50"/>
<property name="releaseHelperThreads" value="3"/>
</bean>
<context:annotation-config/>
Thanks
This is a known issue. See https://code.google.com/p/guava-libraries/issues/detail?id=92.
Try using the snapshot version of bonecp-0.8.0-rc2 which contains 14.0.1 version of guava that has fixes for guava Finalizer thread not closed.
You can grab the snapshot from here -> https://oss.sonatype.org/content/repositories/snapshots/com/jolbox/bonecp/0.8.0-rc2-SNAPSHOT/

Resources