activeMQ持久化,启动activeMQ报错,
INFO | Using Persistence Adapter: JDBCPersistenceAdapter(org.apache.commons.dbcp2.BasicDataSource@5148e82a) jvm 1 | WARN | Could not get JDBC connection: Cannot create PoolableConnectionFactory (Communications link failure jvm 1 | jvm 1 | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
问题出在SSL上面
在active.xml中
<bean id="mysql-ds" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/activemq?relaxAutoCommit=true&useSSL=false"/>
<property name="username" value="yourusername"/>
<property name="password" value="yourpassword"/>
<property name="poolPreparedStatements" value="true"/>
</bean>
其中useSSL=false一定要加上,
我本地用的是mysql8.0以上,记得要在lib目录中加入响应的jar包
mysql-connector-j-8.x.xx.jar