My requirement is to connect the Kafka consumer through the SSL with Spring boot and Camel, for that, I have written the below code but I'm facing an error like Caused by sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target this, anyone please help me how to resolve this error.
public class Testing {
@Bean
SSLContextParameters sslContextParameters(){
KeyStoreParameters store = new KeyStoreParameters();
store.setResource("kafka.client.truststore.jks");
store.setPassword("123456");
TrustManagersParameters trust = new TrustManagersParameters();
trust.setKeyStore(store);
SSLContextParameters parameters = new SSLContextParameters();
parameters.setTrustManagers(trust);
return parameters;
}
}
In another file, I'm calling router with sslContextParameters parameter
@Autowired
SSLContextParameters params;
@Override
public void configure() throws Exception {
from("{{timerOnce}}").process(consumerCreate).to(
"{{conumserRoute}}{{groupName}}?sslContextParameters=params");
}
I am running in issues with absolute and relative path when trying to pick file from remote location. Can someone please help with this issue? I am using Camel v3.0.1. I have a SFTP location sftp://my.sftpserver.com:22. My default home directory is as below:
sftp> pwd
Remote working directory: /Distribution/dor/Rec_Sales/Comp
I want to change directory to /Distribution/dor/modlpool_daily_L5
to pick files.
However I am getting error when trying absolute path: //Distribution/dor/modlpool_daily_L5
28 Oct 2020 12:18:10,432 ERROR [Camel (camelContext) thread #853 - sftp://my.sftpserver.com:22//Distribution/dor/modlpool_daily_L5/] StopRouteExternalExceptionProcessor:34 - ERROR MESSEGE: Cannot list directory: Distribution/dor/modlpool_dail
y_L5
Also when trying relative path: ../../modlpool_daily_L5/
28 Oct 2020 13:14:10,812 ERROR [Camel (camelContext) thread #1148 - sftp://my.sftpserver.com:22/../../modlpool_daily_L5/] StopRouteExternalExceptionProcessor:34 - ERROR MESSEGE: Cannot retrieve file: ../../modlpool_daily_L5/test.txt
org.apache.camel.component.salesforce.api.SalesforceException: {errors:[{"errorCode":"invalid_grant","message":"Login error code:[invalid_grant] description:[audience is invalid]","fields":null}],statusCode:400}
after the component sits for a while, using JWT Bearer Token flow with a Connected App with pre-authorized users by profile. Can't find a way to make sure the token is refreshed or how to bust the cache and reauthenticate.