0

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The connection property 'autoReconnect' only accepts values of the form: 'true', 'false', 'yes' or 'no'. The value 'true;connectTimeout=360000;socketTimeout=360000' is not in this set.)

1 Answers1

1

& is a special character in XML and needs to be escaped as &. Try the following configuration:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost/db?autoReconnect=true&amp;connectTimeout=360000&amp;socketTimeout=360000" />
    <property name="username" value="root" />
    <property name="password" value="mysql" />
    <property name="initialSize" value="5" />
    <property name="maxActive" value="10" />
</bean>

See How do I include &, <, > etc in XML attribute values.

Christophe L
  • 13,725
  • 6
  • 33
  • 33