• gc77
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
Hello!
I'm developing a web application in Java 1.5, using Studio Creator as an IDE. I use the enterprise WSDL and generated the Java classes with the Axis 1.3 wsdl2java tool. Before SF moved our organization's account, I tried nothing more than logging in to SF through the API (version 7) and succeeded. Now I can't even do that!
In the email Sforce sent me I read that if I followed the best practices to login, nothing would change. I don't know what these practices are, but I followed the guidelines of the sample application:

SforceServiceLocator sloc=new SforceServiceLocator();
binding=(SoapBindingStub) sloc.getSoap();
...
LoginResult lr=binding.login(un, pw);
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,  lr.getServerUrl());
SessionHeader sh = new SessionHeader();
sh.setSessionId(lr.getSessionId());
String sforceURI = new  SforceServiceLocator().getServiceName().getNamespaceURI();
binding.setHeader(sforceURI, "SessionHeader", sh);
...

I get an exception when trying to execute the second line, when calling getSoap():

(java.lang.NoSuchMethodError)java.lang.NoSuchMethodError: org.apache.axis.description.ParameterDesc.setOmittable(Z)V

I tried to use versions 1.2.1, 1.3 and 1.4 of axis, nothing changed!

The same code used to work until some days ago! Could someone please help me in some way? Am I not following the best practices or simply doing something wrong?

Thanks in advance!
  • June 22, 2006
  • Like
  • 0
Hello! I am starting a web project and need to use the web services API provided by Salesforce. I downloaded and tested Quickstart7 (Java) and everything works fine. I tried the same approach from a JSF page (I just try to login, but can't even reach the SoapBindingStub binding = null declaration!!!), I always get a java.lang.NoClassDefFoundError exception:

org.apache.axis.client.Service.getAxisClient(Service.java:143)
org.apache.axis.client.Service.(Service.java:152)
com.sforce.soap.enterprise.SforceServiceLocator.(SforceServiceLocator.java:16)
...

I use Java Studio Creator 2 and deploy to Sun Application Server 8 on a Windows XP. I put all the com.sforce... classes into a jar which is then put inside the WEB-INF/lib folder, together with all the jars in the lib folder I found in quickstart.jar. I tried to use the jars inside the JSP samples and the result is the same.
I then looked for the axis code (from Apache) and found:

org.apache.axis.client.Service.java
    
    ...
    protected AxisClient getAxisClient() {
        return new AxisClient(getEngineConfiguration());
    }
    ...

org.apache.axis.client.AxisClient.java    (extends AxisEngine)

    ...
    public AxisClient(EngineConfiguration config) {
        super(config);
    }
    
    public AxisClient() {
        this(EngineConfigurationFactoryFinder.newFactory().getClientEngineConfig());
    }
    ...

The code in org.apache.axis.configuration.EngineConfigurationFactoryFinder is longer but mainly deals with Configurationand initialization issues, so it seems I haven't configured something ... or misconfigured it!
Can anybody help me? I searched the blog, the forums, the documentation and the Internet, I found people who have similar problems with Axis, but never the solution!
Thank you!
  • April 27, 2006
  • Like
  • 0
Hello!
I'm developing a web application in Java 1.5, using Studio Creator as an IDE. I use the enterprise WSDL and generated the Java classes with the Axis 1.3 wsdl2java tool. Before SF moved our organization's account, I tried nothing more than logging in to SF through the API (version 7) and succeeded. Now I can't even do that!
In the email Sforce sent me I read that if I followed the best practices to login, nothing would change. I don't know what these practices are, but I followed the guidelines of the sample application:

SforceServiceLocator sloc=new SforceServiceLocator();
binding=(SoapBindingStub) sloc.getSoap();
...
LoginResult lr=binding.login(un, pw);
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,  lr.getServerUrl());
SessionHeader sh = new SessionHeader();
sh.setSessionId(lr.getSessionId());
String sforceURI = new  SforceServiceLocator().getServiceName().getNamespaceURI();
binding.setHeader(sforceURI, "SessionHeader", sh);
...

I get an exception when trying to execute the second line, when calling getSoap():

(java.lang.NoSuchMethodError)java.lang.NoSuchMethodError: org.apache.axis.description.ParameterDesc.setOmittable(Z)V

I tried to use versions 1.2.1, 1.3 and 1.4 of axis, nothing changed!

The same code used to work until some days ago! Could someone please help me in some way? Am I not following the best practices or simply doing something wrong?

Thanks in advance!
  • June 22, 2006
  • Like
  • 0
Hi,
I'm relatively new to SalesForce so bear with me if this seems very stupid.:mansad:

I am trying to run the Sample java code with SalesForce web service. I get a NullPointerException when i try to log in. I have a developers account whose login/password combination i am using.

The following statement executes fine.
Code:
binding = (SoapBindingStub)new SforceServiceLocator().getSoap();

However when i try to login using this binding i get the exception at this line
Code:
binding.login(userName, password);
Here userName and password are my developer account's user name and password in String.
The stack trace hints that the initial error is occuring at com.sforce.soap.enterprise.SoapBindingStub.login(SoapBindingStub.java:1781)

Any idea what should I do to resolve this?


  • June 07, 2006
  • Like
  • 0
Hello! I am starting a web project and need to use the web services API provided by Salesforce. I downloaded and tested Quickstart7 (Java) and everything works fine. I tried the same approach from a JSF page (I just try to login, but can't even reach the SoapBindingStub binding = null declaration!!!), I always get a java.lang.NoClassDefFoundError exception:

org.apache.axis.client.Service.getAxisClient(Service.java:143)
org.apache.axis.client.Service.(Service.java:152)
com.sforce.soap.enterprise.SforceServiceLocator.(SforceServiceLocator.java:16)
...

I use Java Studio Creator 2 and deploy to Sun Application Server 8 on a Windows XP. I put all the com.sforce... classes into a jar which is then put inside the WEB-INF/lib folder, together with all the jars in the lib folder I found in quickstart.jar. I tried to use the jars inside the JSP samples and the result is the same.
I then looked for the axis code (from Apache) and found:

org.apache.axis.client.Service.java
    
    ...
    protected AxisClient getAxisClient() {
        return new AxisClient(getEngineConfiguration());
    }
    ...

org.apache.axis.client.AxisClient.java    (extends AxisEngine)

    ...
    public AxisClient(EngineConfiguration config) {
        super(config);
    }
    
    public AxisClient() {
        this(EngineConfigurationFactoryFinder.newFactory().getClientEngineConfig());
    }
    ...

The code in org.apache.axis.configuration.EngineConfigurationFactoryFinder is longer but mainly deals with Configurationand initialization issues, so it seems I haven't configured something ... or misconfigured it!
Can anybody help me? I searched the blog, the forums, the documentation and the Internet, I found people who have similar problems with Axis, but never the solution!
Thank you!
  • April 27, 2006
  • Like
  • 0