SAML Custom Execution Issue

1
Hello,   We have an application that originally was set up for anonymous users. We added a new workflow that was only for authenticated users, that would work alongside the original anonymous workflows. We added in the SAML module from Mendix so that we could use our own federation for user log in. The problem is that when after we configure the SP and IdP, it works the first time, but when you stop the application and restart it, we get the following error:   Error in execution of monitored action '{"name":"SAML20.Startup","type":"Microflow"}' (execution id: 3102ed3b-a602-4a51-942e-fa52fa124601, execution type: CUSTOM) Stack trace: java.lang.NoSuchMethodError: org.apache.commons.codec.digest.DigestUtils.sha1Hex([B)Ljava/lang/String; at saml20.implementation.security.SecurityHelper.addAllToKeyStore(SecurityHelper.java:289) at saml20.implementation.security.SecurityHelper.appendToIdPKeyStore(SecurityHelper.java:271) at saml20.implementation.security.CredentialRepository.setupTrustStore(CredentialRepository.java:193) at saml20.implementation.security.CredentialRepository.updateConfiguration(CredentialRepository.java:105) at saml20.implementation.SAMLRequestHandler.initServlet(SAMLRequestHandler.java:103) at saml20.implementation.SAMLRequestHandler.<init>(SAMLRequestHandler.java:67) at saml20.implementation.SAMLRequestHandler.getInstance(SAMLRequestHandler.java:59) at saml20.implementation.SSOServerConfiguration.start(SSOServerConfiguration.java:18) at saml20.actions.StartSSO.executeAction(StartSSO.java:27) at saml20.actions.StartSSO.executeAction(StartSSO.java:16) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:73) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:170) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:174) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:445) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:52) 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:73) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.DefaultActionMonitor$$anonfun$run$1.apply(CustomMonitoredAction.scala:18) 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.basis.actionmanagement.CustomMonitoredAction.monitor(CustomMonitoredAction.scala:22) at com.mendix.basis.actionmanagement.DefaultActionMonitor$.run(CustomMonitoredAction.scala:18) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:62) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:51) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:170) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:174) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:414) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:429) at com.mendix.basis.impl.MxRuntimeImpl.doFire(MxRuntimeImpl.java:603) at com.mendix.basis.impl.MxRuntimeImpl.fireZeeMissile(MxRuntimeImpl.java:543) at com.mendix.basis.impl.MxRuntimeImpl.start(MxRuntimeImpl.java:334) at com.mendix.basis.impl.MxRuntimeImpl.start(MxRuntimeImpl.java:269) at com.mendix.m2ee.appcontainer.actions.StartAction.startRuntime(StartAction.java:50) at com.mendix.m2ee.appcontainer.actions.StartAction.execute(StartAction.java:31) at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandler.handle(HttpAdminHandler.java:122) 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.headerComplete(AbstractHttpConnection.java:942) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 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:745)   I get the same error if I try to use a custom startup microflow that calls the Startup for Deep Links and SAML and returns a boolean that represents that both started successfully. When this happens, I have to delete the SAML module, reinstall, and reconfigure. If it's on Mendix Cloud, I have to clear the environment and reconfigure. I also get the following when trying to use SSO: Unable to initialize the Servlet configuration -------- saml20.implementation.SAMLFeedbackException: Unable to initialize the SSO configuration since the SP Metadata cannot be found at saml20.implementation.common.SAMLUtil.getMetadataConfig(SAMLUtil.java:349) at saml20.implementation.SAMLRequestHandler.initServlet(SAMLRequestHandler.java:80) at saml20.implementation.SAMLRequestHandler.<init>(SAMLRequestHandler.java:67) at saml20.implementation.SAMLRequestHandler.getInstance(SAMLRequestHandler.java:59) at saml20.implementation.SSOServerConfiguration.start(SSOServerConfiguration.java:18) at saml20.actions.StartSSO.executeAction(StartSSO.java:27) at saml20.actions.StartSSO.executeAction(StartSSO.java:16) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:73) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:170) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:174) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:445) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:52) 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:73) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.DefaultActionMonitor$$anonfun$run$1.apply(CustomMonitoredAction.scala:18) 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.basis.actionmanagement.CustomMonitoredAction.monitor(CustomMonitoredAction.scala:22) at com.mendix.basis.actionmanagement.DefaultActionMonitor$.run(CustomMonitoredAction.scala:18) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:62) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:51) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:170) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:174) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:414) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:429) at com.mendix.basis.impl.MxRuntimeImpl.doFire(MxRuntimeImpl.java:603) at com.mendix.basis.impl.MxRuntimeImpl.fireZeeMissile(MxRuntimeImpl.java:543) at com.mendix.basis.impl.MxRuntimeImpl.start(MxRuntimeImpl.java:334) at com.mendix.basis.impl.MxRuntimeImpl.start(MxRuntimeImpl.java:269) at com.mendix.m2ee.appcontainer.actions.StartAction.startRuntime(StartAction.java:50) at com.mendix.m2ee.appcontainer.actions.StartAction.execute(StartAction.java:31) at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandler.handle(HttpAdminHandler.java:122) 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.headerComplete(AbstractHttpConnection.java:942) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 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:745) And Also: Error in execution of monitored action 'executeaction' (execution id: 21854ea27194bc0, execution type: CLIENT) -------- java.lang.NoSuchMethodError: org.apache.commons.codec.digest.DigestUtils.sha1Hex([B)Ljava/lang/String; at saml20.implementation.security.SecurityHelper.addAllToKeyStore(SecurityHelper.java:289) at saml20.implementation.security.SecurityHelper.appendToIdPKeyStore(SecurityHelper.java:271) at saml20.implementation.security.CredentialRepository.setupTrustStore(CredentialRepository.java:193) at saml20.implementation.security.CredentialRepository.updateConfiguration(CredentialRepository.java:105) at saml20.implementation.SAMLRequestHandler.initServlet(SAMLRequestHandler.java:103) at saml20.actions.ReloadConfiguration.executeAction(ReloadConfiguration.java:30) at saml20.actions.ReloadConfiguration.executeAction(ReloadConfiguration.java:17) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:50) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:73) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:170) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:174) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:445) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:52) 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:73) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:53) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:51) at com.mendix.basis.actionmanagement.ActionManager$1.execute(ActionManager.java:170) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:33) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.java:174) at com.mendix.basis.component.InternalCore.execute(InternalCore.java:445) at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:143) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:321) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:307) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:307) 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:419) at com.mendix.webui.requesthandling.ClientRequestHandler.handleRequest(ClientRequestHandler.scala:307) at com.mendix.webui.requesthandling.ClientRequestHandler.handleActionWithSessionRequired(ClientRequestHandler.scala:238) at com.mendix.webui.requesthandling.ClientRequestHandler.handleAction(ClientRequestHandler.scala:202) at com.mendix.webui.requesthandling.ClientRequestHandler.liftedTree1$1(ClientRequestHandler.scala:99) at com.mendix.webui.requesthandling.ClientRequestHandler.processRequest(ClientRequestHandler.scala:91) 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:875) 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:745)   Does anyone know why Mendix throws this exception? I can't seem to find the information I need online.
asked
1 answers
3

When you try to start the application, the StartSSO java action is failing and so the request handler is never registered.  That is why you get the error when you try to use the SSO.  The StartSSO action is failing with a methodnotfound error, which tells me that there may be an issue with the class loading.  The

.DigestUtils.sha1Hex

method is included in the appache commons.codec jar so obviously it should be there.  My guess is there are some duplicate JAR files in your userlib, some of which may be older versions that don't contain everything needed.  Check that folder for duplicate JARs and delete the older versions.  For example, check and see if you have a

commons-codec-1.10.jar

and a

commons-codec-1.8.jar

and delete the older one.  Then try redeploying your app.  I would also just make sure that you have the latest version of the SAML module from the app store.  I don't have a good reason to give you why it is happening only upon restarts.

answered