本文介绍了无法设置java环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,两天后尝试设置文件以编译https://github.com/bing-ads-sdk/BingAds-Java-SDK



编译部分运行良好,但是当我尝试运行时,例如CreateKeywordsAds .class(更改为我的凭据后),我得到以下内容:


PS C:\bingads> java -classpath"。; C:\bingads\cxf-api-2.7.17.jar; C:\bingads\cxf-bundle-jaxrs-2.7.17.jar; C:\bingads \ cxf-rt

-core-2.7.17.jar; C:\bingads\cxf-rt-frontend-jaxws-3.0.2.jar; C:\bingads\cxf- rt-frontend-jaxws-3.1.3.jar; C:\bingads\cxf-rt

-frontend-simple-3.1.3.jar; C:\bingads\cxf- rt-transports-http-3.0.2.jar; C:\bingads\cxf-rt-transports-http-3.1.3.jar; C:\ bi

ngads\easymock -3.2.jar; C:\bingads\easymock-3.4.jar; C:\bingads\FastInfoset-1.2.13.jar; C:\bingads\httpclient-4.0.1.jar; C: \
$
bingads\httpclient-4.5.1.jar; C:\bingads\httpmime-4.0.1.jar; C:\bingads\httpmime-4.5.1.jar ; C:\bingads\jackson-databind-2.1

.3.jar; C:\bingads\jackson-databind-2.6.2.jar; C:\bingads \ jaxb-impl-2.2.11.jar; C:\bingads\jcsv-1.4.0.jar; C:\bingads\junit-

4.11.jar; C:\ bingads \org.apache.aries.blueprint.core-1.4.4.jar; C:\bingads\org.osgi.compendium-5.0.0.jar; C:\bingads\org.os

gi.core-6.0.0.jar; C:\bingads\spring-beans-4.2.1.RELEASE.jar; C:\bingads\spring-context-4.2.1.RELEASE .jar; C:\bingads\sprin

g-core-4.2.1.RELEASE.jar; C:\bingads\xml-resolver-1.2.jar; C:\ bingads\xmlschema核-2.2.1.jar" CreateKeywordsAds

线程"main"中的例外情况java.lang.NoClassDefFoundError:org / apache / cxf / wsdl / service / factory / ReflectionServiceFactoryB

ean

        at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:99)

       在javax.xml.ws.Service。< init>(Service.java:77)

        at javax.xml.ws.Service.create(Service.java:741)

       在com.microsoft.bingads.internal.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:87)
$
       在com.microsoft.bingads.ServiceClient。< init>(ServiceClient.java:99)

       在com.microsoft.bingads.ServiceClient。< init>(ServiceClient.java:76)

        at CreateKeywordsAds.main(CreateKeywordsAds.java:28)
$
引起:java.lang.ClassNotFoundException:org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean

  ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

        at sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:331)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

        ... 7更多


为什么会出现此错误?我使用正确的JARS吗?有没有办法一次下载所有这些?


非常感谢提前


解决方案


Hello, after two days trying to setup the files to compile the examples provided from https://github.com/bing-ads-sdk/BingAds-Java-SDK

I declare myself unable to have it working. I just want to be able to compile and run some of those examples on my account with the java command line.

The compiling part goes well, but when I try to run, for example CreateKeywordsAds.class (after changing to my credentials), I get the following:

PS C:\bingads> java -classpath ".;C:\bingads\cxf-api-2.7.17.jar;C:\bingads\cxf-bundle-jaxrs-2.7.17.jar;C:\bingads\cxf-rt
-core-2.7.17.jar;C:\bingads\cxf-rt-frontend-jaxws-3.0.2.jar;C:\bingads\cxf-rt-frontend-jaxws-3.1.3.jar;C:\bingads\cxf-rt
-frontend-simple-3.1.3.jar;C:\bingads\cxf-rt-transports-http-3.0.2.jar;C:\bingads\cxf-rt-transports-http-3.1.3.jar;C:\bi
ngads\easymock-3.2.jar;C:\bingads\easymock-3.4.jar;C:\bingads\FastInfoset-1.2.13.jar;C:\bingads\httpclient-4.0.1.jar;C:\
bingads\httpclient-4.5.1.jar;C:\bingads\httpmime-4.0.1.jar;C:\bingads\httpmime-4.5.1.jar;C:\bingads\jackson-databind-2.1
.3.jar;C:\bingads\jackson-databind-2.6.2.jar;C:\bingads\jaxb-impl-2.2.11.jar;C:\bingads\jcsv-1.4.0.jar;C:\bingads\junit-
4.11.jar;C:\bingads\org.apache.aries.blueprint.core-1.4.4.jar;C:\bingads\org.osgi.compendium-5.0.0.jar;C:\bingads\org.os
gi.core-6.0.0.jar;C:\bingads\spring-beans-4.2.1.RELEASE.jar;C:\bingads\spring-context-4.2.1.RELEASE.jar;C:\bingads\sprin
g-core-4.2.1.RELEASE.jar;C:\bingads\xml-resolver-1.2.jar;C:\bingads\xmlschema-core-2.2.1.jar" CreateKeywordsAds
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/cxf/wsdl/service/factory/ReflectionServiceFactoryB
ean
        at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:99)
        at javax.xml.ws.Service.<init>(Service.java:77)
        at javax.xml.ws.Service.create(Service.java:741)
        at com.microsoft.bingads.internal.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:87)
        at com.microsoft.bingads.ServiceClient.<init>(ServiceClient.java:99)
        at com.microsoft.bingads.ServiceClient.<init>(ServiceClient.java:76)
        at CreateKeywordsAds.main(CreateKeywordsAds.java:28)
Caused by: java.lang.ClassNotFoundException: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

Why is this error? Am I using the right JARS? Is there a way to download all of them at once?

Many thanks in advance

解决方案


这篇关于无法设置java环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-19 04:36