如何解决WSO2中Thrift Authentication Exception (wrong userName or password)

How to Solve Thrift Authentication Exception (wrong userName or password) in WSO2

在我的本地环境中,我将 Wso2 分析与 Wso2 连接起来。一切正常。当我在 MessageFlowConfigurationPublisher.xml 和 MessageFlowStatisticsPublisher.xml 中更改密码 属性 时:

<property encrypted="false" name="password">my password</property>

WSO2 将其转换为加密版本并且有效,但是当我在我的开发环境中执行相同操作时。它将 属性 变成如下所示:

<property encrypted="false" name="password"/>

它删除了我的密码。你知道为什么会这样吗? 我看了这里,但它并没有解决我的问题。

错误:

TID: [-1] [] [2018-06-01 09:52:10,445]  WARN {org.wso2.carbon.databridge.agent.endpoint.DataEndpointGroup} -  No receiver is reachable at reconnection, will try to reconnect every 30 sec {org.wso2.carbon.databridge.agent.endpoint.DataEndpointGroup}
TID: [-1] [] [2018-06-01 09:52:10,529] ERROR {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker} -  Thrift Authentication Exception {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker}
org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException: Thrift Authentication Exception
    at org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint.login(ThriftDataEndpoint.java:47)
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:93)
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.run(DataEndpointConnectionWorker.java:42)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    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:745)
Caused by: ThriftAuthenticationException(message:wrong userName or password)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$connect_result$connect_resultStandardScheme.read(ThriftSecureEventTransmissionService.java:2020)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$connect_result$connect_resultStandardScheme.read(ThriftSecureEventTransmissionService.java:1998)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$connect_result.read(ThriftSecureEventTransmissionService.java:1940)
    at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.recv_connect(ThriftSecureEventTransmissionService.java:110)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.connect(ThriftSecureEventTransmissionService.java:96)
    at org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint.login(ThriftDataEndpoint.java:45)
    ... 7 more
TID: [-1] [] [2018-06-01 09:52:10,533] ERROR {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker} -  Error while trying to connect to the endpoint. Cannot borrow client for ssl://localhost:7712 {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker}
org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException: Cannot borrow client for ssl://localhost:7712
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:99)
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.run(DataEndpointConnectionWorker.java:42)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    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:745)
Caused by: org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException: Thrift Authentication Exception
    at org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint.login(ThriftDataEndpoint.java:47)
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:93)
    ... 6 more
Caused by: ThriftAuthenticationException(message:wrong userName or password)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$connect_result$connect_resultStandardScheme.read(ThriftSecureEventTransmissionService.java:2020)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$connect_result$connect_resultStandardScheme.read(ThriftSecureEventTransmissionService.java:1998)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$connect_result.read(ThriftSecureEventTransmissionService.java:1940)
    at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.recv_connect(ThriftSecureEventTransmissionService.java:110)
    at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.connect(ThriftSecureEventTransmissionService.java:96)
    at org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint.login(ThriftDataEndpoint.java:45)
    ... 7 more

在我的开发环境中,当我在 MessageFlowConfigurationPublisher.xml 和 MessageFlowStatisticsPublisher.xml 中更改密码 属性 时,我也会收到此错误日志:

ERROR {org.wso2.carbon.event.publisher.core.internal.util.EventPublisherConfigurationBuilder} -  Unable to decrypt the encrypted field: password in adaptor: MessageFlowConfigurationPublisher {org.wso2.carbon.event.publisher.core.internal.util.EventPublisherConfigurationBuilder}


wso2ei-6.1.1\conf\carbon.xml

在此文件中,我们的自定义密钥库配置错误。我改变这个:

<KeyAlias>my Alias</KeyAlias> 

然后,成功了