Help with CXF login client.

528 views
Skip to first unread message

Daniel Merino

unread,
Aug 31, 2015, 8:51:35 AM8/31/15
to saka...@apereo.org
Dear community,

migrating my webservice clients from Axis to CXF, in order to contribute a new webservice to trunk, is being very difficult. I receive errors at runtime and can't find any information about them in Google neither StackOverflow.

I have done a simple client to login into a trunk server with WS enabled (https://trunk-mysql.nightly.sakaiproject.org/sakai-ws/soap/login?wsdl) and when I launch it, I receive an exception. Catalina.out has no errors.

Below I paste my client and the exception stacktrace. If somebody can tell me what is happening or send me a different Java client that works, I would be very grateful.

Thanks in advance.
Best regards.


My client:

import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.endpoint.Client;

public class LoginCXF
{
    final String server = "https://trunk-mysql.nightly.sakaiproject.org/";
    final String urlLogin = "https://trunk-mysql.nightly.sakaiproject.org/sakai-ws/soap/login?wsdl";

    public static void main(String[] args)
    {
        try
        {
            LoginCXF myApp = new LoginCXF();
            try
            {
                JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
                Client client = dcf.createClient(myApp.urlLogin);
              
                Object[] res = client.invoke("login", "admin", "admin" );

                System.out.println("Session ID: "+(String)res[0]+"<br/>");
              
            }
            catch (Exception e )
            {
                System.out.println("Error!! "+e);
                e.printStackTrace();
            }
        }
        catch (Exception e)
        {
            System.err.println(e.toString());
        }
    }   
}

And the exception I receive:

Exception in thread "main" java.lang.NoSuchMethodError: javax.wsdl.xml.WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)Ljavax/wsdl/Definition;
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:74)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:296)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:241)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:234)
    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:189)
    at LoginCXF.main(LoginCXF.java:18)
--
Daniel Merino Echeverría
daniel...@unavarra.es
Gestor de E-learning - Centro Superior de Innovación Educativa.
Tfno: 948-168489 - Universidad Pública de Navarra.

Earle Nietzel

unread,
Aug 31, 2015, 9:27:33 AM8/31/15
to Daniel Merino, saka...@apereo.org
This may help:

Its an issue with the apps classpath that you need to resolve.

Suerte!

-earle

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To post to this group, send email to saka...@apereo.org.
Visit this group at http://groups.google.com/a/apereo.org/group/sakai-dev/.

Daniel Merino

unread,
Sep 1, 2015, 5:20:00 AM9/1/15
to saka...@apereo.org
Thanks a lot, Earle. It seems that Eclipse automatically added its own obsolete wsdl4j.jar (1.5.1) to the classpath. Removing it and adding manually the 1.6.3 jar has fixed it.

Best regards.

El 31/08/15 a las 15:27, Earle Nietzel escribió:
Reply all
Reply to author
Forward
0 new messages