Software Development Kit (SDK) and API Discussions

JaxpContext Error when executing API request

Nexica

Hello,

 

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(JaxpContext.java:161)
	at com.netapp.nmsdk.common.xml.JaxpContext$Stax.<init>(JaxpContext.java:70)
	at com.netapp.nmsdk.common.xml.JaxpContext$Stax.<init>(JaxpContext.java:44)
	at com.netapp.nmsdk.common.xml.JaxpContext.<clinit>(JaxpContext.java:35)

 

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(XmlApiInvocation.java:81)
	at com.netapp.nmsdk.client.ApiInvocation.invoke(ApiInvocation.java:109)
	at com.netapp.nmsdk.client.XmlApiInvocation.invoke(XmlApiInvocation.java:42)
	at com.netapp.nmsdk.client.ApiRunner.run(ApiRunner.java:135)
	at com.netapp.nmsdk.client.ApiRunner.run(ApiRunner.java:105)
	at com.netapp.nmsdk.client.ApiIteratorSupport$GetIterStyleIterator.retrieveNextBatch(ApiIteratorSupport.java:182)
	at com.netapp.nmsdk.client.ApiIteratorSupport$ApiIterator.retrieveNextBatchIfNecessary(ApiIteratorSupport.java:125)
	at com.netapp.nmsdk.client.ApiIteratorSupport$ApiIterator.hasNext(ApiIteratorSupport.java:102)

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!

1 ACCEPTED SOLUTION

asulliva

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.

 

Andrew

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

View solution in original post

2 REPLIES 2

Nexica

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 {
            WOODSTOX{

                @Override
                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 {
			WOODSTOX {

				@Override
				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; } }

 

reference: https://github.com/jamesagnew/hapi-fhir/issues/551

 

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

 

Thank you

asulliva

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.

 

Andrew

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

View solution in original post

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public