JBoss5开发web service常见问题
最近在研究EJB3,在使用EJB3的Web service的時候遇到了不少棘手的問題,現(xiàn)在總結(jié)常見問題與大家分享,希望您能少浪費些時間去漫天地搜解決方案,具體見下:
1.
服務(wù)器端錯誤信息:
jboss5 java.lang.NoClassDefFoundError: org/apache/xerces/xs/XSModel
癥狀:
(JBoss5.1內(nèi)有此現(xiàn)象)在控制臺啟動則可以正常部署,在eclipse內(nèi)則報錯。
解決方法:
很可能是在添加服務(wù)器的時候選擇了eclipse的JBoss插件,位置:JBoss->JBoss V5.0,改為JBoss Tool插件內(nèi)的JBossAS Tool插件,位置:JBoss Community->JBoss AS V5.1
2.
(JBoss5.1內(nèi)有此現(xiàn)象)
客戶端調(diào)用報錯,
當(dāng)使用JBossWS調(diào)用Webservice時報錯如下兩個異常交替出現(xiàn):
javax.xml.ws.WebServiceException: No Content-type in the header
和
javax.xml.ws.WebServiceException: java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
當(dāng)使用Axis是報錯如下:
org.xml.sax.SAXParseException: Premature end of file.
原因及解決辦法:
把JBoss4.2內(nèi)的JBOSS_HOME/client目錄下的一下文件復(fù)制到JBoss5.1內(nèi)的JBOSS_HOME/lib/endorsed目錄下,重啟服務(wù)就可以了。
jboss-jaxrpc.jar
jboss-jaxws.jar
jboss-jaxws-ext.jar
jboss-saaj.jar
另一種做法是下載JBoss5.1的jdk1.6版本。
參考如下:
I read the release notes for Jboss as 4.2.3.GA and it describes what to do if running webservies using jdk1.6. Here is what helped me: (taken from the release notes and followed exactly as printed)
* JBossAS 4.2.3.GA can be compiled with both Java5 & Java6. The Java5 compiled binary is our primary/recommended
binary distribution. It has undergone rigorous testing and can run under both a Java 5 and a Java 6 runtime. When
running under Java 6 you need to manually copy the following libraries from the JBOSS_HOME/client directory to
the JBOSS_HOME/lib/endorsed directory, so that the JAX-WS 2.0 apis supported by JBossWS are used:
????????? o jboss-jaxrpc.jar
????????? o jboss-jaxws.jar
????????? o jboss-jaxws-ext.jar
????????? o jboss-saaj.jar
?
轉(zhuǎn)載于:https://www.cnblogs.com/zhmore/archive/2010/10/15/1852434.html
總結(jié)
以上是生活随笔為你收集整理的JBoss5开发web service常见问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 选出你最喜欢的Linux操作系统吧
- 下一篇: 十二之续、快速排序算法的深入分析