2012-01-10 238 views
2

我寫了一個似乎運行良好的Web服務 - 我可以使用Netbeans接口調用它。我還編寫了另一個可在Netbeans編譯器(6.7.1)內運行時調用它的應用程序。然而,當我將其部署在Tomcat下託管的服務器上 - 只要Web服務訪問以下錯誤頁面被拋出:調用Web服務

>Description: An unhandled exception occurred during the execution of the web application. >Please review the following stack trace for more information regarding the error. 
> 
>Exception Details: java.lang.NoClassDefFoundError 
> javax/xml/rpc/ServiceException 
> 
>Possible Source of Error: 
> Class Name: java.lang.Class 
> File Name: Class.java 
> Method Name: getDeclaredConstructors0 
> Line Number: -2 
> 
>Source not available. Information regarding the location of the exception can be  identified using the exception stack trace below. 
> 
>Stack Trace: 
> 
>java.lang.Class.getDeclaredConstructors0(Class.java:-2) 
>java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) 
>java.lang.Class.getConstructor0(Class.java:2699) 
>java.lang.Class.newInstance0(Class.java:326) 
>java.lang.Class.newInstance(Class.java:308) 
>java.beans.Beans.instantiate(Beans.java:204) 
>java.beans.Beans.instantiate(Beans.java:48) 
>com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:203) 
    >com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:274) 
>com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:78) 
    >com.sun.rave.web.ui.appbase.faces.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:96) 
>com.sun.rave.web.ui.appbase.FacesBean.getBean(FacesBean.java:231) 
+0

看起來像jar包含javax.xml.rpc.ServiceException類缺失。確保你已經在應用程序的lib文件夾中添加了所有需要的jar。 – 2012-01-10 11:47:36

+1

具體而言,您可能會遺漏正在使用的WS庫(可能是Axis或CXF)。 – Viruzzo 2012-01-10 12:00:53

回答

4

異常詳細信息:java.lang.NoClassDefFoundError 的javax/XML/RPC/ServiceException

這意味着您缺少提供javax.xml.rpc.ServiceException的jar。將其添加到您的項目並重新部署,它應該消失。