Expand my Community achievements bar.

SOLVED

Migrating from 6.2 to 6.5 finding an issue with at org.xmlpull.v1.XmlPullParserFactory in 6.5

Avatar

Level 4

So we are finally migrating from 6.2 to 6.5 and there is an issue I'm running into with the at org.xmlpull.v1.XmlPullParserFactory class. I am seeing the following error in 6.5 but it works fine in 6.2.

Caused by: org.xmlpull.v1.XmlPullParserException: caused by: org.xmlpull.v1.XmlPullParserException: resource not found: /META-INF/services/org.xmlpull.v1.XmlPullParserFactory make sure that parser implementing XmlPull API is available
at org.xmlpull.v1.XmlPullParserFactory.newInstance(XmlPullParserFactory.java:294)
at org.xmlpull.v1.XmlPullParserFactory.newInstance(XmlPullParserFactory.java:259)
at com.thoughtworks.xstream.io.xml.XppDriver.createDefaultParser(XppDriver.java:62) [my.library:3.0.0.SNAPSHOT]
at com.thoughtworks.xstream.io.xml.XppDriver.createParser(XppDriver.java:68) [my.library::3.0.0.SNAPSHOT]
at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:54) [my.library::3.0.0.SNAPSHOT]
... 196 common frames omitted

 

This is leading me to think there is some bundle that is either different or in 6.2 that is not in 6.5 that implements the XmlPullParserException. It must be there because there are trace lines from that class in the logs. 

 

This is the contents of the bundle that is installed in AEM

 

jar tvf com.springsource.org.xmlpull-1.1.4.c.jar
0 Fri Nov 10 20:40:36 MST 2006 META-INF/
407 Thu Nov 19 09:18:28 MST 2009 META-INF/MANIFEST.MF
0 Fri Nov 10 20:40:36 MST 2006 META-INF/services/
67 Thu Nov 19 09:18:28 MST 2009 META-INF/services/org.xmlpull.v1.XmlPullParserFactory
0 Thu Nov 19 09:18:28 MST 2009 XPP3_1.1.4c_MIN_VERSION
0 Fri Nov 10 20:40:34 MST 2006 org/
0 Fri Nov 10 20:40:36 MST 2006 org/xmlpull/
0 Fri Nov 10 20:40:36 MST 2006 org/xmlpull/mxp1/
43114 Thu Nov 19 09:18:28 MST 2009 org/xmlpull/mxp1/MXParser.class
0 Fri Nov 10 20:40:34 MST 2006 org/xmlpull/v1/
2831 Thu Nov 19 09:18:28 MST 2009 org/xmlpull/v1/XmlPullParser.class
1900 Thu Nov 19 09:18:28 MST 2009 org/xmlpull/v1/XmlPullParserException.class

 

I see the XmlPullParserFactory in the location that the exception is calling out.

Has anyone run into this before? 

1 Accepted Solution

Avatar

Correct answer by
Level 4

That did not resolve the issue. Looking at the versions of bundles, I can't explain how it works in the 6.2 environment because of class inheritance. Changing versions only changed where the class cast or class not found exceptions were encountered. It was easier to refactor the code so that it worked. I am very familiar with the dependency tool but it was not the answer to this problem.

View solution in original post

4 Replies

Avatar

Community Advisor

@RobertHarperFS 

 

Step-1: Please assure you are using the uber jar corresponding to the version of 6.5+Service Pack

Step-2: If that doesn't resolve, please check the dependency version for API in target AEM instance using http://localhost:4502/system/console/depfinder

 

 

aanchalsikka_1-1713333293594.png

 

Add the API to the Packages/Classes textbox & click find

It would list the version in the Maven Dependency column. Please use the same in code (pom.xml

 

 


Aanchal Sikka

Avatar

Correct answer by
Level 4

That did not resolve the issue. Looking at the versions of bundles, I can't explain how it works in the 6.2 environment because of class inheritance. Changing versions only changed where the class cast or class not found exceptions were encountered. It was easier to refactor the code so that it worked. I am very familiar with the dependency tool but it was not the answer to this problem.

Avatar

Community Advisor

Hi Robert,

 

You may want to hint during your build to the location of the resource to make sure it's definitely present by using:

 

Include-Resource command of the maven-bundle-plugin and then verifying that the code has run successfully.

 

Regards,

Peter

Avatar

Level 4

I gave up on trying to figure out why it was working in 6.2 but not 6.5 and just refactored the code so that it works. I find it interesting that in the 1.3.1 version of com.thoughtworks.xstream bundle, the EncodedByteArrayConverter does not extend the SingleValueConverter but 1.4.9 does. In 6.2 the class cast is working but in 6.5 it doesn't. I gave up on trying to figure this out and just refactored the code.