trying to connect to open an hhtps connection but its failing...tried this in my java action URL myurl = new URL(httpsURL); HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();

1
tried com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: java.lang.ClassCastException: sun.net.www.protocol.https.HttpsURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection at com.mendix.core.component.InternalCore.execute(SourceFile:274) Caused by: com.mendix.core.CoreRuntimeException: java.lang.ClassCastException: sun.net.www.protocol.https.HttpsURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection at com.mendix.core.actionmanagement.ActionManager.executeSync(SourceFile:216) Caused by: java.lang.ClassCastException: sun.net.www.protocol.https.HttpsURLConnectionImpl cannot be cast to javax.net.ssl.HttpsURLConnection at payxml.actions.NewSendPaygateXML.executeAction(NewSendPaygateXML.java:47) at payxml.actions.NewSendPaygateXML.executeAction(NewSendPaygateXML.java:26) 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.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)
asked
3 answers
2

Maybe this link helps.

answered
0

This problem is most probably caused due to the classloaders in mx5. Probably one class is loaded by the runtime and the other by your userlib, causing the incompatibility. The cause of this is having either to many or to few jar files in your userlib. Best is to figure out in which jars these two classes are defined and then either remove or add them to your userlib. (yes, I am aware this is a bit vague, it is trial and error)

Note btw that you don't have to write your own http connection code, a lot of utility methods for making HTTP calls are available in the RestServices module.

answered
0

Thanks solved it

answered