XMLInputFactory New Instance - Custom Java

1
Good afternoon, I am trying to retrieve a response code when sending an SMS via the message bird API to check if the SMS was sent correctly. I am using the following code: // Get the response BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); try { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLEventReader reader = inputFactory.createXMLEventReader(rd); while (reader.hasNext()) { XMLEvent event = reader.nextEvent(); if (event.isStartElement()) { StartElement element = (StartElement) event; if (element.getName().toString().equals("responseCode")) { event = reader.nextEvent(); this.responseCode = event.asCharacters().getData(); continue; } else if (element.getName().toString().equals("responseMessage")) { event = reader.nextEvent(); this.responseMessage = event.asCharacters().getData(); continue; } } } } catch (Exception e) {} wr.close(); rd.close(); } catch (Exception e) {} } I having an issue with the first line XMLInputFactory inputFactory = XMLInputFactory.newInstance();. It produces a 'Boxed Error', does anyone have any idea what this could be? I have seen on the Mendix troubleshooting website that the jar file 'jaxp-api-1.4.5.jar' might not be compatible with Mendix version 5.8.1. Has anyone had any similar experiences? Regards, Matt Smith
asked
2 answers
0

Good morning,

Here is the stack trace for the error above:

java.util.concurrent.ExecutionException: Boxed Error at scala.concurrent.impl.Promise$.resolver(Promise.scala:55) at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:47) at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:244) at akka.pattern.PromiseActorRef.$bang(AskSupport.scala:267) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(SourceFile:160) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(SourceFile:146) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Caused by: javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72) at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176) at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92) at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136) at sms.actions.MessageBirdApi.send(MessageBirdApi.java:110) at sms.actions.JASendSMSAlert.executeAction(JASendSMSAlert.java:48) at sms.actions.JASendSMSAlert.executeAction(JASendSMSAlert.java:1) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.execute(SourceFile:262) at com.mendix.hx.execute(SourceFile:42) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.executeSync(SourceFile:235) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SourceFile:33) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.executeSync(SourceFile:235) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction$b.a(SourceFile:66) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction$b.apply(SourceFile:56) at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:778) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:777) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction.a(SourceFile:56) at com.mendix.modules.microflowengine.actions.other.NestedLoopedMicroflowAction.execute(SourceFile:37) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.executeSync(SourceFile:235) at com.mendix.modules.microflowengine.actions.SubMicroflowAction.execute(SourceFile:33) at com.mendix.ig.a(SourceFile:47) at com.mendix.if.a(SourceFile:193) at com.mendix.if.executeAction(SourceFile:148) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:53) at com.mendix.core.actionmanagement.CoreAction.doCall(SourceFile:291) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:276) at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:205) at com.mendix.core.component.InternalCore.execute(SourceFile:262) at com.mendix.iS.a(SourceFile:135) at com.mendix.pf$g.apply$mcV$sp(SourceFile:292) at com.mendix.pf$g.apply(SourceFile:283) at com.mendix.pf$g.apply(SourceFile:283) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(SourceFile:155) at scala.util.Try$.apply(Try.scala:191) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(SourceFile:153) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(SourceFile:146) at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) at akka.actor.ActorCell.invoke(ActorCell.scala:487) at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) at akka.dispatch.Mailbox.run(Mailbox.scala:220) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

answered
0

It seems to be related to this issue at Oracle technology network. In short, a missing jsr173 jar file on the classpath.

Does that help?

answered