Hi all,
I have a custom java action that was working fine in Mendix 6.10.3.
The use of java action is just to replace an bad response xml element with another one in order to being able to map it properly do domain model.
"IWebserviceResponse resp = Core.callWebservice(locatie, "", soapMessage);
String response = IOUtils.toString(resp.getStream(), StandardCharsets.UTF_8);
response = response.replace("badXmlElementToReplace", "rightXmlElement");
List<IMendixObject> mxObjList = Core.importStream(this.getContext(), IOUtils.toInputStream(response, StandardCharsets.UTF_8), "Some.mapping", null, false);'
Now, after converting a project into Mendix 7.7.1 the project won't compile because of the deprecated function "callWebService" and we had to change java code .
The new java code was changed to:
"HttpHeader[] headers = {new HttpHeader("Content-Type", "text/xml;charset=utf-8")};
IHttpResponse resp = Core.integration().executeHttpRequest(new URI(locatie), HttpMethod.POST, headers, IOUtils.toInputStream(soapMessage));
String response = IOUtils.toString(resp.getContent(), StandardCharsets.UTF_8);
response = response.replace("badXmlElementToReplace", "rightXmlElement");
List<IMendixObject> mxObjList = Core.integration().importStream(this.getContext(), IOUtils.toInputStream(response, StandardCharsets.UTF_8), "Some.mapping", null, false);"
After this change, we got exception.
Error type:
java.lang.ClassCastException
Error message:
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
Stacktrace:
com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at com.mendix.basis.component.InternalCore.execute(InternalCore.java:577)
Caused by:
com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:195)
Caused by:
java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37)
Caused by:
org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source)
at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source)
at com.mendix.integration.importer.xml.XmlImporter.com$mendix$integration$importer$xml$XmlImporter$$createReader(XmlImporter.scala:101)
at com.mendix.integration.importer.xml.XmlImporter$$anonfun$2.apply(XmlImporter.scala:44)
at com.mendix.integration.importer.xml.XmlImporter$$anonfun$2.apply(XmlImporter.scala:44)
at scala.Option.fold(Option.scala:158)
at com.mendix.integration.importer.xml.XmlImporter.importStream(XmlImporter.scala:44)
at com.mendix.integration.importer.xml.XmlImporter.importStream(XmlImporter.scala:32)
at com.mendix.integration.internal.InternalIntegration$class.doImportStream(InternalIntegration.scala:143)
at com.mendix.integration.internal.InternalIntegrationImpl.doImportStream(InternalIntegrationImpl.scala:31)
at com.mendix.integration.internal.InternalIntegrationImpl.importStream(InternalIntegrationImpl.scala:118)
at com.mendix.integration.Integration.importStream(Integration.java:26)
at viewpointservices.actions.GetOrderJavaWorkaround.executeAction(GetOrderJavaWorkaround.java:64)
at viewpointservices.actions.GetOrderJavaWorkaround.executeAction(GetOrderJavaWorkaround.java:24)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:76)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:55)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51)
at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:186)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33)
at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:191)
at com.mendix.basis.component.InternalCore.execute(InternalCore.java:573)
at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:60)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:200)
at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:157)
at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:76)
at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:55)
at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51)
at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:186)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33)
at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:191)
at com.mendix.basis.component.InternalCore.execute(InternalCore.java:573)
at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:135)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:328)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:313)
at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:313)
at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33)
at com.mendix.basis.actionmanagement.IMonitoredAction$class.monitor(IMonitoredAction.scala:49)
at com.mendix.webui.requesthandling.ClientRequestHandler$ClientMonitoredAction.monitor(ClientRequestHandler.scala:431)
at com.mendix.webui.requesthandling.ClientRequestHandler.handleRequest(ClientRequestHandler.scala:313)
at com.mendix.webui.requesthandling.ClientRequestHandler.handleActionWithSessionRequired(ClientRequestHandler.scala:251)
at com.mendix.webui.requesthandling.ClientRequestHandler.handleAction(ClientRequestHandler.scala:218)
at com.mendix.webui.requesthandling.ClientRequestHandler.liftedTree1$1(ClientRequestHandler.scala:104)
at com.mendix.webui.requesthandling.ClientRequestHandler.processRequest(ClientRequestHandler.scala:96)
at com.mendix.externalinterface.connector.RequestHandler.doProcessRequest(RequestHandler.java:40)
at com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:70)
at com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:67)
at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33)
at com.mendix.external.connector.MxRuntimeConnector.processRequest(MxRuntimeConnector.java:73)
at com.mendix.basis.impl.MxRuntimeImpl.processRequest(MxRuntimeImpl.java:858)
at com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.handle(RuntimeHandler.java:41)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:368)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:748)
Anyone knows maybe what can be the cause of this?