3

I have been running a simple Junit testclass with a single test method. I am stuck with the below error.

The stackTrace is as follows

java.lang.ExceptionInInitializerError
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:263)
    at com.ibm.ws.webservices.engine.soap.SAAJMetaFactoryImpl.newMessageFactory(SAAJMetaFactoryImpl.java:56)
    at javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:159)
    at com.sun.xml.internal.ws.api.SOAPVersion.<init>(SOAPVersion.java:179)
    at com.sun.xml.internal.ws.api.SOAPVersion.<clinit>(SOAPVersion.java:84)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:241)
    at com.sun.xml.internal.ws.api.BindingID.<clinit>(BindingID.java:336)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:241)
    at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseBinding(RuntimeWSDLParser.java:425)
    at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parseWSDL(RuntimeWSDLParser.java:322)
    at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:147)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:267)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:230)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:178)
    at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)
    at javax.xml.ws.Service.<init>(Service.java:57)

Can anyone help me what could be the reason behind it

Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: 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 (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) (Caused by org.apache.commons.logging.LogConfigurationException: 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 (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.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
    at com.ibm.ws.webservices.engine.components.logger.LogFactory$1.run(LogFactory.java:119)
    at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
    at com.ibm.ws.webservices.engine.components.logger.LogFactory.getLog(LogFactory.java:111)
    at com.ibm.ws.webservices.engine.soap.MessageFactoryImpl.<clinit>(MessageFactoryImpl.java:103)
    at java.lang.J9VMInternals.initializeImpl(Native Method)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:241)
    ... 41 more
Caused by: org.apache.commons.logging.LogConfigurationException: 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 (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.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:416)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
    ... 48 more
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)
    ... 49 more
6
  • Is that your entire Stacktrace? I would expect to see a "Caused by:" block after this. You might want to show some code too Commented Apr 30, 2015 at 12:58
  • Hi @MrWiggles, I am trying to call a webservice method. and checking whether the response is not null. I am trying to instantiate the webservice by using new, where its throwing this ExceptionInInitializationError. The statement i am using is as follows XXXXProxy proxy = new XXXXXProxy(); Commented May 5, 2015 at 10:55
  • But is this your entire Stracktrace? An ExceptionInInitializerException is usually accompanied by a root cause Commented May 5, 2015 at 14:31
  • The rest of the stacktrace is appended to the main stacktrace Commented May 6, 2015 at 10:37
  • The Stacktrace is telling you exactly what is wrong. It even gives you a link to follow to read to resolve it - slf4j.org/codes.html#unsupported_operation_in_jcl_over_slf4j Commented May 6, 2015 at 10:46

1 Answer 1

2

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

is this mandatory in running the webservices through JUNit?

Sign up to request clarification or add additional context in comments.

1 Comment

It doesn't run before and I don't know why. Now I set the property as mentioned and it works and I don't know why! +1 even though!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.