Software Development Kit (SDK) and API Discussions

JaxpContext Error when executing API request




Could you help on this error plz?


when trying to send a request i get this:



Caused by: java.lang.IllegalStateException: Unable to determine StAX implementation: class __redirected.__XMLInputFactory
	at com.netapp.nmsdk.common.xml.JaxpContext$Stax.detectStaxImplementation(
	at com.netapp.nmsdk.common.xml.JaxpContext$Stax.<init>(
	at com.netapp.nmsdk.common.xml.JaxpContext$Stax.<init>(
	at com.netapp.nmsdk.common.xml.JaxpContext.<clinit>(


After trying again, the error changes and i get this:


Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.netapp.nmsdk.common.xml.JaxpContext
	at com.netapp.nmsdk.client.XmlApiInvocation.writeRequest(
	at com.netapp.nmsdk.client.ApiInvocation.invoke(
	at com.netapp.nmsdk.client.XmlApiInvocation.invoke(
	at com.netapp.nmsdk.client.ApiIteratorSupport$GetIterStyleIterator.retrieveNextBatch(
	at com.netapp.nmsdk.client.ApiIteratorSupport$ApiIterator.retrieveNextBatchIfNecessary(
	at com.netapp.nmsdk.client.ApiIteratorSupport$ApiIterator.hasNext(

the JaxpContext is there (in com.netapp.nmsdk.client) but i dont have the source code to check what it needs.


Can you list the necessary dependencies to other libraries? I am curretnly using the following.

nmsdk-runtime 5.6

ontap-api 8.3.1

commons-lang 2.6

commons-io 2.4

commons-codec 1.8


Thank you!


Re: JaxpContext Error when executing API request


We investigated and found the problem:


This is happening when using WildFly 10.1.0 Final, which uses a Proxy Implementation of WOODSTOX and cannot be detected as a valid implementation of  StaxImplementation in JaxpContext. The problem lies on these lines:


public static enum StaxImplementation {

                boolean isInstance(XMLInputFactory xmlInputFactory) {
                    try {
                        return Class.forName("com.ctc.wstx.stax.WstxInputFactory", true, Thread.currentThread().getContextClassLoader()).isInstance(xmlInputFactory);
                    catch (ClassNotFoundException e) {
                        return false;


 And the solution we tried is this one:


public static enum StaxImplementation {

				boolean isInstance(XMLInputFactory xmlInputFactory) {
					try {

						try {
							if ((xmlInputFactory.getProperty("org.codehaus.stax2.implVersion") == null)) {
								return Class.forName("com.ctc.wstx.stax.WstxInputFactory",true,
Thread.currentThread().getContextClassLoader()) .isInstance(xmlInputFactory); } } catch (IllegalArgumentException e) { return Class.forName("com.ctc.wstx.stax.WstxInputFactory", true, Thread.currentThread().getContextClassLoader()).isInstance(xmlInputFactory); } return true; } catch (ClassNotFoundException e) { return false; } }




We would appreciate if you could solve this issue in the next release.


Thank you

Re: JaxpContext Error when executing API request


I have responded to @Nexica privately, but for the community's knowledge, this has been created as a bug.  Please let me know if you have any questions.



If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums