Entropy
Entropy

Reputation: 1281

RAD 9 JAXWS client throwing UnsupportedOperationException

I have a Junit test that calls a JAXWS service. This worked fine in RAD 8 using WAS 7. We are converting to RAD 9 using WAS 8.5. And I am getting exceptions. The exact exception varies with each new thing I try. The old service needed nothing more than junit and the JAXWS thinclient variable. When I do that, I get an exception saying the following:

java.lang.NoClassDefFoundError: com.ibm.ejs.ras.hpel.HpelHelper

I eventually found the hpel jar in the plugins directory, but then that just led to the exception below. I've added commons logging, but to no effect. It happens with or without. I read the help document at the end of the URL in the message, but AFAIK, I am not using jcl over slf4j. I assume some IBM support layer is using it. But this is a JAXWS client in a junit test. I'm not sure how to apply their advice.

And I also added two system properties which I saw recommended online and they didn't makie a difference: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl

The current exception is:

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

My code is pretty simple:

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);

The following comes out in the console and did not originate from my program and which I never saw in 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

Upvotes: 2

Views: 4745

Answers (2)

Thejasvi Voniadka
Thejasvi Voniadka

Reputation: 63

I did face the "java.lang.UnsupportedOperationException" originating from LogFactory. I did not have to add any jar files to the CLASSPATH though. I solved it by adding the following system property:

-Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.SLF4JLogFactory

Upvotes: 4

Entropy
Entropy

Reputation: 1281

What I have is more workaround than solution. I don't feel like what I got was "right". I had to add jcl-over-slf4j.jar and slf4j-api.jar (both 1.7.5) to the bootstrap classpath. That doesn't seem like it should eb the right solution here. But it worked.

Upvotes: 1

Related Questions