CxfClientGrailsPlugin - 在设置clientInterface = [:]和serviceEndpointAddress之前,无法创建Web服务客户端abcClient

时间:2015-10-27 08:09:17

标签: grails soap wsdl cxf-client

我正在为SOAP请求使用cxf-client grails插件: 我已将这些客户端配置添加到Config中:

cxf {
  client {
    paymentRequestClient {
        wsdl = "https://sandbox.demo.com/payments.wsdl"
        namespace = "com.demo.soap"
        clientInterface = com.demo.soap.PaymentPortType
        serviceEndpointAddress = "https://sandbox.demo.com/payments.php"
    }

  }
}

运行grails wsdl2java grails后,针对提供的WSDL生成了所需的Java类,但PaymentPortType类除外。

在运行应用程序时,我收到此错误:

Web service client paymentRequestClient cannot be created before setting the clientInterface=[:] and serviceEndpointAddress=https://sandbox.demo.com/payments.php properties
[ERROR] 2015-10-27 12:00:11,899 CxfClientGrailsPlugin - Web service client paymentRequestClient cannot be created before setting the clientInterface=[:] and serviceEndpointAddress=https://sandbox.demo.com/payments.php properties
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Configuring Spring Security REST ...
... finished configuring Spring Security REST
[ERROR] 2015-10-27 12:00:39,401      
org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener -             Error initializing the application: Error creating bean with name 'paymentRequestClient': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'clientInterface'; nested exception is java.lang.IllegalArgumentException: Could not load class []!

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'paymentRequestClient': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'clientInterface'; nested exception is java.lang.IllegalArgumentException: Could not load class []!
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'clientInterface'; nested exception is java.lang.IllegalArgumentException: Could not load class []!
... 4 more

Caused by: java.lang.IllegalArgumentException: Could not load class []!
... 4 more

可能出现什么问题?

1 个答案:

答案 0 :(得分:-1)

您遇到此问题,因为Spring无法找到课程com.demo.soap.PaymentPortType in the classpath