setProperty 必须被 SOAPMessage 的所有子类覆盖 [英] setProperty must be overridden by all subclasses of SOAPMessage

查看:22
本文介绍了setProperty 必须被 SOAPMessage 的所有子类覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 JBoss 5.1.0 上的 WAR 应用程序中部署一些 Web 服务.

I'm trying to deploy some web services in a WAR application on JBoss 5.1.0.

我已经使用 JAX-WS 工具 wsgen 从现有的 wsdl 创建了源文件.这创建了 Service 文件和 @XmlType 注释的类,它们将充当请求和响应包装器.

I have created the source files from an existing wsdl using JAX-WS tool wsgen. This created the Service files and @XmlType annotated clases that would act as request and response wrappers.

这些类在 JBoss 4.2.3 上运行良好,但在转移到 JBoss 5.1.0 时,我遇到了这个异常.

This classes worked well on JBoss 4.2.3, but when moving to JBoss 5.1.0, I get this exception.

java.lang.UnsupportedOperationException: setProperty 必须被 SOAPMessage 的所有子类覆盖

java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage

我的配置:

  • Windows XP SP3(但在 Vista 和 Linux 上都一样)
  • Sun JDK 1.6.0_17
  • 用于 jdk6 的 JBoss 5.1.0 GA

提前致谢!

推荐答案

有些事情可能会出错,所以我会告诉你什么对我的情况有帮助(类似于你的,我使用的是 JDK 1.6.0_13).

There are a few thing that might go wrong, so I will tell you what helped in my case (analogous to yours, I was using JDK 1.6.0_13).

问题在于 JAR 不匹配.首先确保 JBoss 使用的是 JDK 1.6 检查您的 JAVA_HOME 环境.多变的.其次确保您的类是使用 JDK 1.6 编译的.如果您从 Eclipse 运行您的项目,请确保 Eclipse 使用正确的 JDK,如果您从 Eclipse 运行 JBoss,则同样如此.

The problem lies in JARs mismatch. First of all make sure JBoss is using JDK 1.6 check your JAVA_HOME env. variable. Secondly make sure your classes are compiled using JDK 1.6. If you run your project from Eclipse make sure Eclipse is using right JDK, the same if you run JBoss from Eclipse.

我猜你猜对了,所以有一些魔法.运行客户端不要使用$JBOSS_HOME/client 中的库,而只使用$JBOSS_HOME/lib/endorsed 中提供的库.显然,如果您使用任何其他与 JAX-WS 无关的 API,例如 JPA 或 EJB 或 Servlet,您可以将它们添加到类路径中,但仅使用 lib/endorsed JAX-WS JAR.

I guess your have it right, so there comes some magic. Running client do not use libraries from $JBOSS_HOME/client, but use only the ones provided in $JBOSS_HOME/lib/endorsed. Obviously if you are using any other JAX-WS-unrelated API like JPA or EJB or Servlets you can add them to the classpath, but use only lib/endorsed JAX-WS JARs.

在 JBoss 5.1 的情况下,它对我的​​特殊情况有所帮助,在 JBoss 的早期版本中,还有一些其他技巧有效,例如尝试添加 java 选项启动客户端和 JBoss 时 -Dsun.lang.ClassLoader.allowArraySyntax=true 或/和 -Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed.

It helped in my particular situation in case of JBoss 5.1, in earlier versions of JBoss a few other tricks worked, for instance try to add java option -Dsun.lang.ClassLoader.allowArraySyntax=true or/and -Djava.endorsed.dirs=$JBOSS_HOME/lib/endorsed when starting your client and JBoss.

这篇关于setProperty 必须被 SOAPMessage 的所有子类覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆