惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
腾讯CDC
D
Docker
G
Google Developers Blog
D
DataBreaches.Net
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
S
SegmentFault 最新的问题
The Cloudflare Blog
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Stack Overflow Blog
Stack Overflow Blog
大猫的无限游戏
大猫的无限游戏
量子位
美团技术团队
aimingoo的专栏
aimingoo的专栏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Engineering at Meta
Engineering at Meta
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 张皓

Stereoscopic Player 1.7.4 (SSP) 加载字幕 layout_weight体验(实现按比例显示) Linux5配置jboss环境 pager-taglib 分页扩展实例 DisplayTag1.2 扩展(自定义分页、排序、导出、页面导航) EJB3在JBoss5内集群探究 maven2 Jetty运行多模块的web application jboss启动常见的错误 ADO连接池 IDUdpServer研究心得 DLL内线程同步主线程研究(子线程代码放到主线程执行) DBGrid内使用CheckBox功能 子绑定控件获取父绑定项的值 - 张皓 - 博客园 IdTcpServer 用户掉线检测方法 . Net环境下消息队列(MSMQ)对象的应用[转] 消息队列(Message Queue)简介及其使用[转] 分布式事务TransactionScope小结[转] 分布式事务的点滴 调试SQL Server存储过程方法
JBoss5开发web service常见问题
张皓 · 2010-10-15 · via 博客园 - 张皓

最近在研究EJB3,在使用EJB3的Web service的时候遇到了不少棘手的问题,现在总结常见问题与大家分享,希望您能少浪费些时间去漫天地搜解决方案,具体见下:

1.
服务器端错误信息:
jboss5 java.lang.NoClassDefFoundError: org/apache/xerces/xs/XSModel

症状:
(JBoss5.1内有此现象)在控制台启动则可以正常部署,在eclipse内则报错。

解决方法:
很可能是在添加服务器的时候选择了eclipse的JBoss插件,位置:JBoss->JBoss V5.0,改为JBoss Tool插件内的JBossAS Tool插件,位置:JBoss Community->JBoss AS V5.1

2.
(JBoss5.1内有此现象)
客户端调用报错,
当使用JBossWS调用Webservice时报错如下两个异常交替出现:
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

当使用Axis是报错如下:
org.xml.sax.SAXParseException: Premature end of file.

原因及解决办法:
把JBoss4.2内的JBOSS_HOME/client目录下的一下文件复制到JBoss5.1内的JBOSS_HOME/lib/endorsed目录下,重启服务就可以了。
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