gpt4 book ai didi

java - 在 Karaf 中使用 ssl 连接到数据源,得到 java.lang.NoClassDefFoundError : javax/net/ssl/TrustManager

转载 作者:太空宇宙 更新时间:2023-11-03 14:34:26 24 4
gpt4 key购买 nike

我正在运行 Servicemix 6.1.3。我有一个使用 ssl 的数据源(.cfg 文件):

url=jdbc:mysql://mysqlcluster-test.dot.com:3306/mydb?useSSL=true
user=cs_dev
password=mypwd

当我部署我的包时,我收到此错误消息:

2018-03-20 14:02:51,054 | ERROR | mix-6.1.3/deploy | JdbcMessageIdRepository          | 251 - org.apache.camel.camel-sql - 2.16.4 | Can't create table for JdbcMessageIdRepository with query 'CREATE TABLE  MYTABLE(name VARCHAR(255), id VARCHAR(100), createdAt TIMESTAMP)' because of: Could not get JDBC Connection; nested exception is java.sql.SQLException: java.lang.NoClassDefFoundError: javax/net/ssl/TrustManager. This may be a permissions problem. Please create this table and try again.
2018-03-20 14:02:51,056 | ERROR | mix-6.1.3/deploy | BlueprintCamelContext | 156 - org.apache.camel.camel-blueprint - 2.16.4 | Error occurred during starting Camel: CamelContext(SystemIntegration.cu) due Could not get JDBC Connection; nested exception is java.sql.SQLException: java.lang.NoClassDefFoundError: javax/net/ssl/TrustManager
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: java.lang.NoClassDefFoundError: javax/net/ssl/TrustManager
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)[250:org.apache.servicemix.bundles.spring-jdbc:3.2.17.RELEASE_1]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:382)[250:org.apache.servicemix.bundles.spring-jdbc:3.2.17.RELEASE_1]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:428)[250:org.apache.servicemix.bundles.spring-jdbc:3.2.17.RELEASE_1]
at org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository$1.doInTransaction(JdbcMessageIdRepository.java:70)[251:org.apache.camel.camel-sql:2.16.4]
at org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository$1.doInTransaction(JdbcMessageIdRepository.java:60)[251:org.apache.camel.camel-sql:2.16.4]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)[144:org.apache.servicemix.bundles.spring-tx:3.2.17.RELEASE_1]
at org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository.doStart(JdbcMessageIdRepository.java:60)[251:org.apache.camel.camel-sql:2.16.4]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[151:org.apache.camel.camel-core:2.16.4]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:74)[151:org.apache.camel.camel-core:2.16.4]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:59)[151:org.apache.camel.camel-core:2.16.4]
at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:103)[151:org.apache.camel.camel-core:2.16.4]
...

要通过 ssl 使用数据源,我必须做什么?

最佳答案

我认为您可能希望将服务器的证书与您信任的证书一起添加到 KeyStore。

有很多方法可以实现,但一个简单的解决方案是编译并运行

this program

作为

java InstallCert hostname

请试一试,让我们知道它是否适合您。

关于java - 在 Karaf 中使用 ssl 连接到数据源,得到 java.lang.NoClassDefFoundError : javax/net/ssl/TrustManager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49385265/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com