CQ5中的Web服务问题 - java.lang.NoClassDefFoundError:无法初始化类com.aem.ws.Weather

时间:2014-04-22 11:24:42

标签: java web-services cq5

我正在研究SOAP CXF Web服务。我通过以下链接" http://helpx.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html"。我创建了CXF osgi包,它在felix控制台中处于ACTIVE状态。当我试图通过JSP调用webservice时,它会给出错误" java.lang.NoClassDefFoundError:无法初始化类com.aem.ws.Weather"。

http://helpx.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html

谢谢,

Kiran Parab

2 个答案:

答案 0 :(得分:0)

查看此链接并查看是否有帮助 - 这听起来像是一个类似的问题:http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.9.html/forum__zydx-dear_expertsim.html

要检查的另一件事是您的捆绑包导出唯一的包名称。我发现如果我有两个捆绑导出同一个包--com.aem.ws在这种情况下 - 然后CQ将选择一个在运行时使用,如果该捆绑包不包含我得到的类即使某些其他包确实包含该类,也会出现这种错误。因此,请仔细检查bundle导出的内容,以确保没有两个bundle定义相同的包命名空间。

答案 1 :(得分:0)

由于博客中提到的命令,问题是渲染。我使用的是“apache-cxf-3.0.0-milestone2”版本。当我在博客中使用提到的命令时,在天气生成的类文件中,我得到以下错误: -

//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.**
public Weather(WebServiceFeature ... features) {
    super(WSDL_LOCATION, SERVICE);
}

//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public Weather(URL wsdlLocation, WebServiceFeature ... features) {
    super(wsdlLocation, SERVICE);
}

//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public Weather(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
    super(wsdlLocation, serviceName);
}   

要从存根中删除错误,请找到下面提到的新命令: -

*新命令: -

wsdl2java -frontend jaxws21 -p com.aem.ws -d c:\ proxy http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL

相关问题