• manim
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 17
    Replies

Hi all,

 

I am trying to run a query over SOAP using Java.  I am using the Javaforce tool which bascially packages up the partner WSDL into an axis wrapper for you.  So far so good.

 

I put it all together in Eclipse, run a test class.  All looks good.  Deploy to tomcat and that's where the fun begins.

 

(1) When I start tomcat, the call errors every time I navigate to the page (detail below)

(2) If I rebuild the WAR and restart tomcat it works perfectly every time (so far)

(3) If I do the same but also clean out the tomcat work directory, it fails every time again.

 

The error occurs on the login call.  The error string is java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty.  From what I can see, this occurs when tomcat can't find a valid cacerts file.  I would believe that is the problem except that it works sometimes.  Unfortunately, building and starting twice is not a valid workaround for reasons too boring to detail here.

 

This occurs on both Tomcat 5.5 and 7.0, Java 6.  I hope someone has seen this!

 

From com.sforce.soap.partner.SoapBindingStub

==============

        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("urn:partner.soap.sforce.com", "login"));

        setRequestHeaders(_call);
        setAttachments(_call);
  try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {username, password});
/////////// error occurs on the above line

 

Here's more of the response from Salesforce

============================


<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode>

<faultstring>javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty</faultstring>

<detail><ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1649)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1612)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1595)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1172)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149)
    at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
    at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.partner.SoapBindingStub.login(SoapBindingStub.java:2257)
[snip]
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
    at java.security.cert.PKIXParameters.&lt;init&gt;(PKIXParameters.java:103)
    at java.security.cert.PKIXBuilderParameters.&lt;init&gt;(PKIXBuilderParameters.java:87)
    at sun.security.validator.PKIXValidator.&lt;init&gt;(PKIXValidator.java:55)
    ... 134 more
</ns1:stackTrace>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">sveltedaddy.local</ns2:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>


We have a requirement where we want to access chatter status data for users in my group on regular basis to be shown in other application.

We are using web server flow and got access token and refresh token.I save it to properties file which can only be accessed by deployer of the application.

 

Currenlty I am using my salesforce account for this.

For making this automated ,we are thinking of having a separate saleforce accout dedicated for this functionality which will follow every user in my group to have updates from them?

 

Is this the correct way to go for it?

 

 

 

  • July 20, 2011
  • Like
  • 0

I have a java web application using chatter REST API to get access to chatter data. I am not able to fetch data from "na10.salesforce.com" due to error "API_DISABLED_FOR_ORG".

 

I have written to Customer support and they are investigating on this. In the meantime, I am using developer instance at "ap1.salesforce.com" and working with XML response returned.

 

I wanted to know whether this is the right way?Will the structure of response XML returned from actual instance will be same as the one returned by developer instance? Thanks for taking time on this. 

  • July 18, 2011
  • Like
  • 0

Is there any chatter REST API to get updates for everything I am following ? Thanks.

  • July 12, 2011
  • Like
  • 0

Is there any chatter REST API to get updates for everything I am following ?

Thanks.

  • July 12, 2011
  • Like
  • 0

Hi,

I want to test refresh token flow using outh framework.

I want to do it something like below:

 

if(response.toString().contains("access token expired")){

//SEND REQUETS FOR REFRESH TOKEN

}

How do I test this? Is there any way to manually deactivate the access token?

Thanks.



  • July 11, 2011
  • Like
  • 0

Hi,

I want to test refresh token flow using outh framework.

I want to do it something like below

 

if(response.toString().contains("access token expired")){

//SEND REQUETS FOR REFRESH TOKEN

}

How do I test this? Is there any way to manually deactivate the access token?

Thanks.

  • July 11, 2011
  • Like
  • 0

Following PDF explains about accessing Chatter data using Web Service Connector (WSC) :

http://www.salesforce.com/us/developer/docs/workbook_chatter/chatter.pdf

 

What is the difference between chatter REST API and WSC?

Thanks.

  • July 04, 2011
  • Like
  • 0

Is there an API to get most popular posts depending on the likes received?

  • July 04, 2011
  • Like
  • 0

Is there an API to get most popular posts depending on the likes received?

  • July 04, 2011
  • Like
  • 0

Hi,

 

I have a java web application deployed in tomcat,which needs to access chatter data on regular basis.

 

As per the documentation,I need to use chatter REST API to get an access to data.

We need to login first by registering our web application and get an access token ,which is then passed to every GET request to the chatter.

 

I have some doubts regarding this:

 

1.What is the validity of this access token?If I want to fetch data on daily basis do i need to generate it on daily basis?

 

2. Why can't we use existing saleforce login account for accessing chatter REST API?

 

Thanks.

 

 

  • June 30, 2011
  • Like
  • 0

I have a java web application using chatter REST API to get access to chatter data. I am not able to fetch data from "na10.salesforce.com" due to error "API_DISABLED_FOR_ORG".

 

I have written to Customer support and they are investigating on this. In the meantime, I am using developer instance at "ap1.salesforce.com" and working with XML response returned.

 

I wanted to know whether this is the right way?Will the structure of response XML returned from actual instance will be same as the one returned by developer instance? Thanks for taking time on this. 

  • July 18, 2011
  • Like
  • 0

Is there any chatter REST API to get updates for everything I am following ? Thanks.

  • July 12, 2011
  • Like
  • 0

Is there any chatter REST API to get updates for everything I am following ?

Thanks.

  • July 12, 2011
  • Like
  • 0

Hi all,

 

I am trying to run a query over SOAP using Java.  I am using the Javaforce tool which bascially packages up the partner WSDL into an axis wrapper for you.  So far so good.

 

I put it all together in Eclipse, run a test class.  All looks good.  Deploy to tomcat and that's where the fun begins.

 

(1) When I start tomcat, the call errors every time I navigate to the page (detail below)

(2) If I rebuild the WAR and restart tomcat it works perfectly every time (so far)

(3) If I do the same but also clean out the tomcat work directory, it fails every time again.

 

The error occurs on the login call.  The error string is java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty.  From what I can see, this occurs when tomcat can't find a valid cacerts file.  I would believe that is the problem except that it works sometimes.  Unfortunately, building and starting twice is not a valid workaround for reasons too boring to detail here.

 

This occurs on both Tomcat 5.5 and 7.0, Java 6.  I hope someone has seen this!

 

From com.sforce.soap.partner.SoapBindingStub

==============

        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("urn:partner.soap.sforce.com", "login"));

        setRequestHeaders(_call);
        setAttachments(_call);
  try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {username, password});
/////////// error occurs on the above line

 

Here's more of the response from Salesforce

============================


<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode>

<faultstring>javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty</faultstring>

<detail><ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1649)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1612)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1595)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1172)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1149)
    at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
    at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.partner.SoapBindingStub.login(SoapBindingStub.java:2257)
[snip]
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
    at java.security.cert.PKIXParameters.&lt;init&gt;(PKIXParameters.java:103)
    at java.security.cert.PKIXBuilderParameters.&lt;init&gt;(PKIXBuilderParameters.java:87)
    at sun.security.validator.PKIXValidator.&lt;init&gt;(PKIXValidator.java:55)
    ... 134 more
</ns1:stackTrace>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">sveltedaddy.local</ns2:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>


Is there an API to get most popular posts depending on the likes received?

  • July 04, 2011
  • Like
  • 0

Is there an API to get most popular posts depending on the likes received?

  • July 04, 2011
  • Like
  • 0

Hi,

 

I have a java web application deployed in tomcat,which needs to access chatter data on regular basis.

 

As per the documentation,I need to use chatter REST API to get an access to data.

We need to login first by registering our web application and get an access token ,which is then passed to every GET request to the chatter.

 

I have some doubts regarding this:

 

1.What is the validity of this access token?If I want to fetch data on daily basis do i need to generate it on daily basis?

 

2. Why can't we use existing saleforce login account for accessing chatter REST API?

 

Thanks.

 

 

  • June 30, 2011
  • Like
  • 0