Software Development Kit (SDK) and API Discussions

JaxpContext Error when executing API request

Nexica
5,034 Views

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
4,667 Views

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
4,725 Views

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
4,668 Views

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.
Public