我有一个调用JAXWS服务的Junit测试。这在RAD 8使用WAS7中很好,我们正在转换为RAD 9使用WAS8.5。而且我也有例外。具体的例外情况随我尝试的每一件新事物而变化。旧服务只需要junit和JAXWS瘦客户机变量。当我这样做的时候,我得到了一个例外,它说:
java.lang.NoClassDefFoundError: com.ibm.ejs.ras.hpel.HpelHelper
我最终在插件目录中找到了hpel jar,但这导致了下面的例外情况。我增加了通用日志,但没有效果。不管有没有。我在消息的URL末尾阅读了帮助文档,但是AFAIK,我没有通过slf4j使用jcl。我想某些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发布于 2014-10-06 11:15:32
我所拥有的是更多的变通而不是解决方案。我不觉得我得到的是“对的”。我必须将jcl-overslf4j.jar和slf4j-api.jar (都是1.7.5)添加到引导类路径中。这似乎不应该在这里执行正确的解决方案。但成功了。
发布于 2014-12-26 21:53:18
我确实面对了源自LogFactory的“LogFactory”。不过,我不必向CLASSPATH添加任何jar文件。我通过添加以下系统属性来解决这个问题:
-Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.SLF4JLogFactory
https://stackoverflow.com/questions/26180683
复制相似问题