eclipse 在 WSDL 的代码生成期间发生异常:java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/utils/NamespacePrefixList

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35797731/
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-09 05:37:41  来源:igfitidea点击:

Exception occurred during code generation for the WSDL : java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/utils/NamespacePrefixList

eclipseweb-servicessoapwsdlaxis2

提问by Vinoth

I am using Tomcat 7 server and Axis 2 1.7 runtime in eclipse.

我在 Eclipse 中使用 Tomcat 7 服务器和 Axis 2 1.7 运行时。

I have a WSDL file which is generated in Axis 2.

我有一个在 Axis 2 中生成的 WSDL 文件。

so go for Topdown approach to generate a webservice class (skeleton). I selected my configuration as Axis in server run time. when tried to click finish it is showing following error: "Exception occurred during code generation for the WSDL : java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/utils/NamespacePrefixList"

所以采用自顶向下的方法来生成一个 web 服务类(骨架)。我在服务器运行时选择了我的配置作为 Axis。当尝试单击完成时,它显示以下错误:“ WSDL 代码生成期间发生异常:java.lang.NoClassDefFoundError:org/apache/ws/commons/schema/utils/NamespacePrefixList

I thought it is a jar miss so i first included XmlSchema-1.4.2.jar the error hasn't resolved. so i deleted that jar and tried with latest jar downloaded from java2s (xmlschema-core-2.0.1.jar). Still i have the same problem.

我认为这是一个 jar 未命中,所以我首先包含 XmlSchema-1.4.2.jar 错误尚未解决。所以我删除了那个 jar 并尝试使用从 java2s (xmlschema-core-2.0.1.jar) 下载的最新 jar。我仍然有同样的问题。

Please help me to solve this issue.

请帮我解决这个问题。

This same issue also persist when trying to create a client from WSDl in eclipse.

尝试在 Eclipse 中从 WSDl 创建客户端时,同样的问题也仍然存在。

Kindly help me to solve this with steps. Thanks

请帮助我通过步骤解决这个问题。谢谢

回答by johnny_kb

Solved this issue: in webContent/WEB-INF/libadd xmlschema-core-2.2.1.jar; then, ensure it is added in Web App Libraries on your build path; finally close and reopen eclipse before generating web service client. This worked for me.

解决了这个问题: in webContent/WEB-INF/libadd xmlschema-core-2.2.1.jar; 然后,确保将其添加到构建路径的 Web App 库中;最后在生成 Web 服务客户端之前关闭并重新打开 eclipse。这对我有用。

回答by David Hackro

In my case this error is occasioned for using axis2-1.7.3, my solution was change and use axis2-1.6.4

在我的情况下,此错误是使用 axis2-1.7.3 引起的,我的解决方案是更改并使用axis2-1.6.4