[英]Unable to create JAXBContext after writing class with IOException
[英]Unable to create JAXBContext in Java Web service
我使用NetBeans創建Metro Web服務並部署在GlassFish上。 我嘗試構建時遇到錯誤,但僅當Web服務中的某個操作返回Object而不是基本類型或String時。
錯誤:
Deploying application in domain failed; Deployment Error -- Exception occured in the wsgen process javax.xml.ws.WebServiceException: Unable to create JAXBContext
build-impl.xml:569: The module has not been deployed.
BUILD FAILED (total time: 2 seconds)
包含的代碼:
<target if="netbeans.home" name="-run-deploy-nb">
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
</target>
任何幫助表示贊賞!
這個帖子也很好地說明了你的問題:
問題是自定義類具有屬性的公共訪問權限,並且還具有getter / setter方法。
我發現,因為你可以使用NetBeans生成WSDL
文件的Webservice
,以檢查它們。 這樣做會返回詳細錯誤。
如果要使用它,請編寫Web服務,然后轉到“Web Services
”節點,選擇Web服務,右鍵單擊它並選擇“生成並復制WSDL
”。
您可以在此處找到有關對象定義的實用建議。
當然,您仍然可以使用Java Web Service Tutorial來公開JAX-WS端點的要求 。
我找到了解決方案..
我返回的類也有一個公共值,設置並得到刪除它們並且工作正常
以上步驟對我不起作用。 是什么做了一個空構造函數添加到返回的對象的MyClass,一個ArrayList <MyClass>。
(NB6.9.1,GF2.X,Windows XP x64)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.