Access denied to user added libraries

0
Hi, In my Mendix project, I created a custom Java Action and added some code in it by deploying the project for Eclipse. The code I am trying to add uses a few libraries (jar files). I added those jars in the userlib folder. When I run the application, it gives me error as "access denied". Here's the stack trace... *An error has occurred while handling the request. [User 'Anonymous_b4b08679-ce55-48ec-8661-679fa7727bcf' with session id '7eaeac70-3206-41b1-b69b-a76d17845524' and roles 'Admin'] *com.mendix.modules.microflowengine.MicroflowException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "axis.EngineConfigFactory" "read") at RestModule.GetAccount2 (JavaAction : 'GetAccountJAVA') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:143) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "axis.EngineConfigFactory" "read") at com.mendix.core.component.InternalCore.execute(InternalCore.java:386) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "axis.EngineConfigFactory" "read") at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:189) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "axis.EngineConfigFactory" "read") at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "axis.EngineConfigFactory" "read") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.security.AccessController.checkPermission(AccessController.java:884) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1294) at java.lang.System.getProperty(System.java:717) at org.apache.commons.discovery.tools.ManagedProperties.getProperty(ManagedProperties.java:157) at org.apache.commons.discovery.tools.ManagedProperties.getProperty(ManagedProperties.java:134) at org.apache.commons.discovery.resource.names.DiscoverNamesInAlternateManagedProperties$1.<init>(DiscoverNamesInAlternateManagedProperties.java:118) at org.apache.commons.discovery.resource.names.DiscoverNamesInAlternateManagedProperties.findResourceNames(DiscoverNamesInAlternateManagedProperties.java:117) at org.apache.commons.discovery.resource.names.NameDiscoverers$1.getNextIterator(NameDiscoverers.java:140) at org.apache.commons.discovery.resource.names.NameDiscoverers$1.hasNext(NameDiscoverers.java:126) at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(ResourceClassDiscoverImpl.java:159) at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClassDiscoverImpl.java:147) at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:120) at java.security.AccessController.doPrivileged(Native Method) at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113) at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160) at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813) at org.apache.axis.client.Service.getAxisClient(Service.java:104) at org.apache.axis.client.Service.<init>(Service.java:113) at org.tempuri.ContactsLocator.<init>(ContactsLocator.java:12) at restmodule.actions.GetAccountJAVA.executeAction(GetAccountJAVA.java:38) at restmodule.actions.GetAccountJAVA.executeAction(GetAccountJAVA.java:1) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:179) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:185) at com.mendix.core.component.InternalCore.execute(InternalCore.java:378) 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:192) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:149) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:49) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:260) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:248) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:179) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:185) at com.mendix.core.component.InternalCore.execute(InternalCore.java:378) 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:322) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:315) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:315) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:145) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:147) at scala.util.Try$.apply(Try.scala:191) at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:141) at akka.actor.Actor$class.aroundReceive(Actor.scala:465) at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:137) 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) I assume I need to make changes to the security.policy or .policy file. How do I give read permissions to these libraries?
asked
2 answers
2

This does not have to do with the filesystem.

One of the libraries you use (Axis) tries to read a property but this is not allowed by the security manager. You might be able to circumvent this by using another way to deliver properties to Axis then having it try to find them by itself. Or by changing the security settings, which is something you cannot do when running in the Mendix cloud.

answered
0

Looks like the library attempts to read from the file system. When you place those files (not the JARs!) in the resources folder of your project it should work. Of course you need an option to tell that library where to look for its stuff. I hope it supports that. Note that writing to the file system is not allowed.

answered