【发布时间】:2014-11-28 14:44:51
【问题描述】:
我有一个调用 JAXWS 服务的 Junit 测试。这在使用 WAS 7 的 RAD 8 中运行良好。我们正在使用 WAS 8.5 转换为 RAD 9。我得到了例外。确切的例外情况因我尝试的每件新事物而异。旧服务只需要 junit 和 JAXWS 瘦客户端变量。当我这样做时,我得到一个异常,说明如下:
java.lang.NoClassDefFoundError: com.ibm.ejs.ras.hpel.HpelHelper
我最终在插件目录中找到了 hpel jar,但这只是导致了下面的异常。我添加了公共日志记录,但没有效果。无论有没有都会发生。我阅读了消息中 URL 末尾的帮助文档,但是 AFAIK,我没有使用 jcl 而不是 slf4j。我假设一些 IBM 支持层正在使用它。但这是 junit 测试中的 JAXWS 客户端。我不确定如何应用他们的建议。
我还添加了两个我在网上看到推荐的系统属性,它们并没有什么不同: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
目前的例外是:
Caused by: java.lang.UnsupportedOperationException: Operation [getContextClassLoader] is not supported in jcl-over-slf4j. See also http://www.slf4j.org/codes.html#unsupported_operation_in_jcl_over_slf4j
at org.apache.commons.logging.LogFactory.getContextClassLoader(LogFactory.java:366)
at org.apache.commons.logging.impl.LogFactoryImpl.access$000(LogFactoryImpl.java:113)
at org.apache.commons.logging.impl.LogFactoryImpl$1.run(LogFactoryImpl.java:457)
at java.security.AccessController.doPrivileged(AccessController.java:229)
at org.apache.commons.logging.impl.LogFactoryImpl.loadClass(LogFactoryImpl.java:454)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:406)
... 54 more
我的代码很简单:
MyDataService svc = new MyDataService();
MyDataDelegate port = svc.getMyDataPort();
BindingProvider bp = (BindingProvider)port;
Map<String, Object> context = bp.getRequestContext();
context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
port.myWebServiceEndpoint(listOfKeys);
以下内容出现在控制台中,并非源自我的程序,我在 RAD 8/WAS 7 中从未见过:
Oct 3, 2014 10:00:29 AM null null
INFO: ssl.disable.url.hostname.verification.CWPKI0027I
Oct 3, 2014 10:00:32 AM null null
SEVERE: security.JSAS1480I
Oct 3, 2014 10:00:32 AM null null
INFO: Client code attempting to load security configuration
Oct 3, 2014 10:00:32 AM null null
AUDIT: chain.started
【问题讨论】:
标签: apache websphere jax-ws ibm-rad