Use importStream after conversion

1
After converting an App from Mx5.21 to 6.5.1 the importXmlStream needed to be replaced by importStream because of deprecation. The importXmlStream function mapped an XML without problems to the domain. However, the importXmlStream function returns the following error: java.lang.ClassCastException: org.apache.xerces.dom.DOMXSImplementationSourceImpl cannot be cast to org.w3c.dom.DOMImplementationSource at org.w3c.dom.bootstrap.DOMImplementationRegistry.newInstance(DOMImplementationRegistry.java:187) at com.mendix.integration.xml.SchemaLocationResolver.<init>(SchemaLocationResolver.scala:16) at com.mendix.integration.importer.xml.XmlImporter.com$mendix$integration$importer$xml$XmlImporter$ A search on the internet does not provide useful information, so maybe someone here has an idea. Do I need to add something to the WSDL or is there maybe an incompatible java libary? Solution in this case: reimport the CommunityCommons module from the Appstore.
asked
3 answers
1

That is odd because importXmlStream is basically calling the new importStream. Here is the code:

  @deprecated 
  override def importXmlStream(context: IContext, xmlStream: InputStream, importMappingName: String, mappingParameter: IMendixObject,
                           storeResultInVariable: Boolean, limit: Int, hasListReturnValue: Boolean, shouldValidate: Boolean): Object = {

  val results = importStream(context, xmlStream, importMappingName, mappingParameter, limit, shouldValidate)

  (storeResultInVariable, hasListReturnValue) match {
     case (true, true) => results
     case (true, _) => if (results.size > 0) results.get(0) else null
     case _ => null
   }
}

Could it be that you have conflicting library in your user libs?

answered
0

At the risk of telling you something you already know: It looks as if an attempt is made to cast to a an ImplementationSource class. An instance of 'org.w3c.dom.DOMImplementationSource' is expected, but instead, an instance of 'org.apache.xerces.dom.DOMXSImplementationSourceImpl' is provided.

It is possible that either a library has changed, but the code has not, or the code has changed but an old library is still in place.

I'd recommend taking a look at the Call Hierarchy of the 'newInstance' method of org.w3c.dom.bootstrap.DOMImplementationRegistry. See where the method is called, and if at any point it receives wrong input parameter.

answered
0

Excuses for hijacking this thread, but I hav ethe same error.

In our app (developed at 6.10.3)  we want to use the iDeal module from the App Store.

I have downloaded it and after correcting the layouts in 5.x I import it in a testapp  with Deeplink  included. THe only error then is the Homepage and easily solved.

Going through the first steps of config I want to see what the result so far is. I got the java error on ImportXmlStream.

Applied the solutions suplied here (adding CommunityCommons), but still get this error.

Tried to do the same in 6.10.2 and start in 6.10.3 hoping the conversion would take care of the problem, but no success either.

How do I get the iDeal app from the app store working in 6.10.3? 

I am not an expert in java and do not like the status of anything "depricated"; that is a red flag for bad design.

 

answered