oracle javax.xml.ws.WebServiceException:未找到提供程序 com.sun.xml.internal.ws.spi.ProviderImpl

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15184454/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 01:29:04  来源:igfitidea点击:

javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found

oraclejava

提问by user2079954

I'm trying to run a webservice client on jdk1.5 and gives me the following error:

我正在尝试在 jdk1.5 上运行 webservice 客户端,并给我以下错误:

javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found

Any suggestion will be appreciated.

任何建议将不胜感激。

回答by Olimpiu POP

Make sure that on your path you can find also the jar containing the class com.sun.xml.internal.ws.spi.ProviderImpl. I checked what jar might be needed and hereyou can see the jars containing the given class. Any of them might help you.

确保在您的路径上还可以找到包含 class 的 jar com.sun.xml.internal.ws.spi.ProviderImpl。我检查了可能需要什么 jar,在这里您可以看到包含给定类的 jar。他们中的任何一个都可能对你有帮助。

回答by devegied

I don't know exact reason why it can not find the right class but I think it is some problem with (or feature of) Java class loader in Oracle databasewhen it looks for resources.

我不知道为什么它找不到正确的类的确切原因,但我认为它在查找资源时Oracle 数据库中的Java 类加载器(或特性)存在一些问题。

I loaded JAX-WS reference implementation from java.net with all its dependencies with the SYS user (with the public access permissions and public synonyms). But the classes generated from service WSDL I loaded to user SCOTT schema. And for some reason when SCOTT runs procedures that uses service, javax.xml.ws.spi.FactoryFinderdoes look up for implementation name in META-INF/services/javax.xml.ws.spi.Providerresource (which have correct value com.sun.xml.ws.spi.ProviderImpl) but can not find this resource so tries to load provider from hard-coded class name (com.sun.xml.internal.ws.spi.ProviderImpl) and fails.

我从 java.net 加载了 JAX-WS 参考实现及其对 SYS 用户的所有依赖项(具有公共访问权限和公共同义词)。但是从我加载到用户 SCOTT 模式的服务 WSDL 生成的类。并且出于某种原因,当 SCOTT 运行使用服务的过程时,javax.xml.ws.spi.FactoryFinder确实会在META-INF/services/javax.xml.ws.spi.Provider资源中查找实现名称(具有正确的值com.sun.xml.ws.spi.ProviderImpl),但找不到此资源,因此尝试从硬编码的类名 ( com.sun.xml.internal.ws.spi.ProviderImpl)加载提供程序并失败。

Solution for me was to load all META-INF/services/*files from all the JAX-WS RI and dependencies jar's to SCOTT schema. Alternative way could be to load all JAX-WS RI, dependencies andfinal program to the same schema.

我的解决方案是将所有META-INF/services/*JAX-WS RI 和依赖项 jar 中的所有文件加载到 SCOTT 模式。替代方法可能是将所有 JAX-WS RI、依赖项最终程序加载到相同的模式。