BingAds / BingAds-Java-SDK

Other
42 stars 48 forks source link

v11 Reporting service : ServiceConstructionException #76

Closed TompiT closed 6 years ago

TompiT commented 6 years ago

Hi there, We've noticed that the following exception is raised when we deploy on our servers:

39652 [main] INFO org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - Creating Service {https://bingads.microsoft.com/Reporting/v11}ReportingService from class com.microsoft.bingads.v11.reporting.IReportingService
[16/11/2017 14:28:19] [DBID: 1] [AdsEngine FATAL] javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not resolve a binding for null 

This exception is not raised and everything is ok on local. (Same account, credentials, ApiEnvironment.PRODUCTION). Any suggestions?

qitia commented 6 years ago

Hey TompiT, may I know how are you "deploying" your services? this seems to me some dependencies(cxf lib) was missed when doing the deployment.

TompiT commented 6 years ago

Hi @qitia we use Gradle to deploy our project and Apache CXF dependencies exists: Output of gradle depencies:

+--- com.microsoft.bingads:microsoft.bingads:11.5.5
|    +--- com.fasterxml.jackson.core:jackson-databind:2.1.3 -> 2.1.4 (*)
|    +--- com.googlecode.jcsv:jcsv:1.4.0
|    +--- org.apache.cxf:cxf-rt-frontend-jaxws:3.0.2
|    |    +--- xml-resolver:xml-resolver:1.2
|    |    +--- asm:asm:3.3.1
|    |    +--- org.apache.cxf:cxf-core:3.0.2
|    |    |    +--- org.codehaus.woodstox:woodstox-core-asl:4.4.1
|    |    |    |    \--- org.codehaus.woodstox:stax2-api:3.1.4
|    |    |    \--- org.apache.ws.xmlschema:xmlschema-core:2.1.0
|    |    +--- org.apache.cxf:cxf-rt-bindings-soap:3.0.2
|    |    |    +--- org.apache.cxf:cxf-core:3.0.2 (*)
|    |    |    +--- org.apache.cxf:cxf-rt-wsdl:3.0.2
|    |    |    |    +--- org.apache.cxf:cxf-core:3.0.2 (*)
|    |    |    |    +--- wsdl4j:wsdl4j:1.6.3
|    |    |    |    \--- asm:asm:3.3.1
|    |    |    \--- org.apache.cxf:cxf-rt-databinding-jaxb:3.0.2
|    |    |         +--- org.apache.cxf:cxf-core:3.0.2 (*)
|    |    |         +--- org.apache.cxf:cxf-rt-wsdl:3.0.2 (*)
|    |    |         +--- com.sun.xml.bind:jaxb-impl:2.1.14
|    |    |         |    +--- com.sun.xml.bind:jaxb-core:2.1.14
|    |    |         |    |    \--- javax.xml.bind:jaxb-api:2.1
|    |    |         |    |         +--- javax.xml.stream:stax-api:1.0-2
|    |    |         |    |         \--- javax.activation:activation:1.1 -> 1.1.1
|    |    |         |    \--- com.sun.xml.fastinfoset:FastInfoset:1.2.12
|    |    |         \--- com.sun.xml.bind:jaxb-core:2.1.14 (*)
|    |    +--- org.apache.cxf:cxf-rt-bindings-xml:3.0.2
|    |    |    \--- org.apache.cxf:cxf-core:3.0.2 (*)
|    |    +--- org.apache.cxf:cxf-rt-frontend-simple:3.0.2
|    |    |    +--- org.apache.cxf:cxf-core:3.0.2 (*)
|    |    |    +--- org.apache.cxf:cxf-rt-bindings-soap:3.0.2 (*)
|    |    |    \--- org.apache.cxf:cxf-rt-wsdl:3.0.2 (*)
|    |    \--- org.apache.cxf:cxf-rt-ws-addr:3.0.2
|    |         +--- org.apache.cxf:cxf-core:3.0.2 (*)
|    |         +--- org.apache.cxf:cxf-rt-bindings-soap:3.0.2 (*)
|    |         \--- org.apache.cxf:cxf-rt-ws-policy:3.0.2
|    |              +--- wsdl4j:wsdl4j:1.6.3
|    |              +--- org.apache.cxf:cxf-core:3.0.2 (*)
|    |              \--- org.apache.neethi:neethi:3.0.3
|    +--- org.apache.cxf:cxf-rt-transports-http:3.0.2
|    |    \--- org.apache.cxf:cxf-core:3.0.2 (*)
|    +--- org.apache.httpcomponents:httpmime:4.0.1
|    |    +--- org.apache.httpcomponents:httpcore:4.0.1 -> 4.4.4
|    |    +--- org.apache.httpcomponents:httpclient:4.0.1 -> 4.5.2 (*)
|    |    +--- org.apache.james:apache-mime4j:0.6
|    |    |    \--- commons-logging:commons-logging:1.1.1 -> 1.2
|    |    \--- commons-logging:commons-logging:1.1.1 -> 1.2
|    \--- org.apache.httpcomponents:httpclient:4.0.1 -> 4.5.2 (*)

After further investigation we have noticed that Apache CXF dependencies were not properly packaged on Jar by using Shadow. We found the following recommendation to handle Apache CXF with Gradle and it seems to work now.

qingjuntian commented 6 years ago

Glad to hear it works for you now.