You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gerald Kallas <ca...@mailbox.org> on 2020/04/20 23:30:57 UTC

camel-salesforce

Dear community,

while connecting to a salesforce instance I'm getting an error

java.lang.RuntimeException: org.apache.camel.component.salesforce.api.SalesforceException: Unexpected login error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I'm assuming that I need to add the cert from the salesforce instance somewhere in the config ("keystore"?) but I'm missing the configuration and blueprint syntax details.

Any help is highly appreciated.

The route looks like

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <bean id="salesforce" class="org.apache.camel.component.salesforce.SalesforceComponent">
        <property name="loginConfig">
            <bean class="org.apache.camel.component.salesforce.SalesforceLoginConfig">
                <property name="loginUrl" value="https://test.salesforce.com/"/>
                <property name="clientId" value="xxx"/>
                <property name="clientSecret" value="xxx"/>
                <property name="userName" value="xxx"/>
                <property name="password" value="xxx"/>
                <property name="lazyLogin" value="true"/>
            </bean>
        </property>
    </bean>

    <camelContext id="salesforceTest" xmlns="http://camel.apache.org/schema/blueprint" streamCache="true">
        <route>
            <from uri="timer:test?repeatCount=1"/>
            <to uri="direct:salesforceTest"/>
        </route>
        <route>
            <from uri="direct:salesforceTest"/>
            <to uri="salesforce:limits"/>
            <log message="${body}"/>
        </route>
    </camelContext>

</blueprint>

Tx in advance
- Gerald

Re: camel-salesforce

Posted by Gerald Kallas <ca...@mailbox.org>.
Works like a charm, thanks!

It was needed to add 3 different certs to the truststore and finally I got a valid response.

I wonder if there's another way to specify the the truststore reference?

Best
- Gerald

> Reji Mathews <co...@gmail.com> hat am 21. April 2020 02:55 geschrieben:
> 
>  
> Create a java keystore file, import the certificate into it and pass the
> file along as jvm option. Refer
> https://stackoverflow.com/questions/8980364/how-do-i-find-out-what-keystore-my-jvm-is-using
> where
> author shows how to pass a keystore as jvm option.
> 
> By default, it tries to pick up the cacerts file in your jre folder.
> 
> Cheers
> Reji
> 
> On Mon, Apr 20, 2020 at 7:38 PM Gerald Kallas <ca...@mailbox.org> wrote:
> 
> > Dear community,
> >
> > while connecting to a salesforce instance I'm getting an error
> >
> > java.lang.RuntimeException:
> > org.apache.camel.component.salesforce.api.SalesforceException: Unexpected
> > login error: PKIX path building failed:
> > sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> > valid certification path to requested target
> >
> > I'm assuming that I need to add the cert from the salesforce instance
> > somewhere in the config ("keystore"?) but I'm missing the configuration and
> > blueprint syntax details.
> >
> > Any help is highly appreciated.
> >
> > The route looks like
> >
> > <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
> >            xmlns:ext="
> > http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
> >            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >            xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
> > https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
> >
> >     <bean id="salesforce"
> > class="org.apache.camel.component.salesforce.SalesforceComponent">
> >         <property name="loginConfig">
> >             <bean
> > class="org.apache.camel.component.salesforce.SalesforceLoginConfig">
> >                 <property name="loginUrl" value="
> > https://test.salesforce.com/"/>
> >                 <property name="clientId" value="xxx"/>
> >                 <property name="clientSecret" value="xxx"/>
> >                 <property name="userName" value="xxx"/>
> >                 <property name="password" value="xxx"/>
> >                 <property name="lazyLogin" value="true"/>
> >             </bean>
> >         </property>
> >     </bean>
> >
> >     <camelContext id="salesforceTest" xmlns="
> > http://camel.apache.org/schema/blueprint" streamCache="true">
> >         <route>
> >             <from uri="timer:test?repeatCount=1"/>
> >             <to uri="direct:salesforceTest"/>
> >         </route>
> >         <route>
> >             <from uri="direct:salesforceTest"/>
> >             <to uri="salesforce:limits"/>
> >             <log message="${body}"/>
> >         </route>
> >     </camelContext>
> >
> > </blueprint>
> >
> > Tx in advance
> > - Gerald
> >

Re: camel-salesforce

Posted by Reji Mathews <co...@gmail.com>.
Create a java keystore file, import the certificate into it and pass the
file along as jvm option. Refer
https://stackoverflow.com/questions/8980364/how-do-i-find-out-what-keystore-my-jvm-is-using
where
author shows how to pass a keystore as jvm option.

By default, it tries to pick up the cacerts file in your jre folder.

Cheers
Reji

On Mon, Apr 20, 2020 at 7:38 PM Gerald Kallas <ca...@mailbox.org> wrote:

> Dear community,
>
> while connecting to a salesforce instance I'm getting an error
>
> java.lang.RuntimeException:
> org.apache.camel.component.salesforce.api.SalesforceException: Unexpected
> login error: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find
> valid certification path to requested target
>
> I'm assuming that I need to add the cert from the salesforce instance
> somewhere in the config ("keystore"?) but I'm missing the configuration and
> blueprint syntax details.
>
> Any help is highly appreciated.
>
> The route looks like
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>            xmlns:ext="
> http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
>            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>            xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
> https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>
>     <bean id="salesforce"
> class="org.apache.camel.component.salesforce.SalesforceComponent">
>         <property name="loginConfig">
>             <bean
> class="org.apache.camel.component.salesforce.SalesforceLoginConfig">
>                 <property name="loginUrl" value="
> https://test.salesforce.com/"/>
>                 <property name="clientId" value="xxx"/>
>                 <property name="clientSecret" value="xxx"/>
>                 <property name="userName" value="xxx"/>
>                 <property name="password" value="xxx"/>
>                 <property name="lazyLogin" value="true"/>
>             </bean>
>         </property>
>     </bean>
>
>     <camelContext id="salesforceTest" xmlns="
> http://camel.apache.org/schema/blueprint" streamCache="true">
>         <route>
>             <from uri="timer:test?repeatCount=1"/>
>             <to uri="direct:salesforceTest"/>
>         </route>
>         <route>
>             <from uri="direct:salesforceTest"/>
>             <to uri="salesforce:limits"/>
>             <log message="${body}"/>
>         </route>
>     </camelContext>
>
> </blueprint>
>
> Tx in advance
> - Gerald
>