-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
-
---
-
---
The Jakarta Mail API cannot create various types when the security manager is enabled due to the usage of the ServiceLoader not having permission to the implementation JAR.
@RunWith(Arquillian.class) public class MultiPartMailTestCase { @Deployment public static WebArchive deployment() { return ShrinkWrap.create(WebArchive.class, MultiPartMailTestCase.class.getSimpleName() + ".war") .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } @Test public void createMultiPartMessage() throws Exception { final Multipart multipart = new MimeMultipart(); final MimeBodyPart part1 = new MimeBodyPart(); part1.setText("Test text 1"); multipart.addBodyPart(part1); } }
15:41:16,600 SEVERE [org.jboss.arquillian.protocol.jmx.JMXTestRunner] (pool-9-thread-1) Failed: org.jboss.as.test.integration.mail.multipart.MultiPartMailTestCase.createMultiPartMessage: java.lang.IllegalStateException: Cannot load interface jakarta.mail.util.StreamProvider as ServiceLoader at jakarta.mail.api@2.1.0//jakarta.mail.util.FactoryFinder.factoryFromServiceLoader(FactoryFinder.java:137) at jakarta.mail.api@2.1.0//jakarta.mail.util.FactoryFinder.find(FactoryFinder.java:52) at jakarta.mail.api@2.1.0//jakarta.mail.util.StreamProvider.provider(StreamProvider.java:177) at jakarta.mail.api@2.1.0//jakarta.mail.Multipart.<init>(Multipart.java:69) at jakarta.mail.api@2.1.0//jakarta.mail.internet.MimeMultipart.<init>(MimeMultipart.java:196) at jakarta.mail.api@2.1.0//jakarta.mail.internet.MimeMultipart.<init>(MimeMultipart.java:181) at deployment.MultiPartMailTestCase.war//org.jboss.as.test.integration.mail.multipart.MultiPartMailTestCase.createMultiPartMessage(MultiPartMailTestCase.java:50) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at deployment.arquillian-service//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at deployment.arquillian-service//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$8$1.invokeMethod(Arquillian.java:325) at deployment.arquillian-service//org.jboss.arquillian.junit.MethodInvoker$1.invoke(MethodInvoker.java:18) at deployment.arquillian-service//org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:57) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62) at deployment.arquillian-service//org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:36) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90) at deployment.arquillian-service//org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:116) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95) at deployment.arquillian-service//org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95) at deployment.arquillian-service//org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133) at deployment.arquillian-service//org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:139) at deployment.arquillian-service//org.jboss.arquillian.junit.MethodInvoker.invoke(MethodInvoker.java:15) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$8.evaluate(Arquillian.java:332) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:204) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:350) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:215) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$7$1.invoke(Arquillian.java:279) at deployment.arquillian-service//org.jboss.arquillian.container.test.impl.execution.BeforeLifecycleEventExecuter.on(BeforeLifecycleEventExecuter.java:34) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90) at deployment.arquillian-service//org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:116) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95) at deployment.arquillian-service//org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95) at deployment.arquillian-service//org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at deployment.arquillian-service//org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133) at deployment.arquillian-service//org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105) at deployment.arquillian-service//org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.fireCustomLifecycle(EventTestRunnerAdaptor.java:159) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$7.evaluate(Arquillian.java:273) at deployment.arquillian-service//org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at deployment.arquillian-service//org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at deployment.arquillian-service//org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at deployment.arquillian-service//org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at deployment.arquillian-service//org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at deployment.arquillian-service//org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at deployment.arquillian-service//org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at deployment.arquillian-service//org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at deployment.arquillian-service//org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:166) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:350) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:177) at deployment.arquillian-service//org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at deployment.arquillian-service//org.junit.runners.ParentRunner.run(ParentRunner.java:413) at deployment.arquillian-service//org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:115) at deployment.arquillian-service//org.junit.runner.JUnitCore.run(JUnitCore.java:137) at deployment.arquillian-service//org.junit.runner.JUnitCore.run(JUnitCore.java:115) at deployment.arquillian-service//org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:61) at deployment.arquillian-service//org.jboss.arquillian.protocol.jmx.JMXTestRunner.doRunTestMethod(JMXTestRunner.java:153) at deployment.arquillian-service//org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.doRunTestMethod(ArquillianService.java:202) at deployment.arquillian-service//org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:137) at deployment.arquillian-service//org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:119) at deployment.arquillian-service//org.jboss.as.arquillian.service.ArquillianService$ExtendedJMXTestRunner.runTestMethod(ArquillianService.java:178) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260) at java.management/com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) at java.management/com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) at java.management/com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) at java.management/com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) at java.management/com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.jboss.as.jmx@19.0.0.Beta18//org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:1493) at org.jboss.as.jmx@19.0.0.Beta18//org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:726) at org.jboss.as.jmx@19.0.0.Beta18//org.jboss.as.jmx.BlockingNotificationMBeanServer.invoke(BlockingNotificationMBeanServer.java:168) at org.jboss.as.jmx@19.0.0.Beta18//org.jboss.as.jmx.AuthorizingMBeanServer.invoke(AuthorizingMBeanServer.java:258) at org.jboss.remoting-jmx@3.0.4.Final//org.jboss.remotingjmx.protocol.v2.ServerProxy$InvokeHandler.handle(ServerProxy.java:950) at org.jboss.remoting-jmx@3.0.4.Final//org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1$1.run(ServerCommon.java:153) at org.jboss.as.jmx@19.0.0.Beta18//org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:71) at org.jboss.as.jmx@19.0.0.Beta18//org.jboss.as.jmx.ServerInterceptorFactory$Interceptor$1.run(ServerInterceptorFactory.java:66) at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:328) at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:285) at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254) at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225) at org.jboss.as.jmx@19.0.0.Beta18//org.jboss.as.jmx.ServerInterceptorFactory$Interceptor.handleEvent(ServerInterceptorFactory.java:66) at org.jboss.remoting-jmx@3.0.4.Final//org.jboss.remotingjmx.protocol.v2.ServerCommon$MessageReciever$1.run(ServerCommon.java:149) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.io.FilePermission" "/home/jperkins/.m2/repository/org/eclipse/angus/angus-mail/1.0.0/angus-mail-1.0.0.jar" "read")" in code source "(vfs:/content/MultiPartMailTestCase.war/WEB-INF/classes <no signer certificates>)" of "ModuleClassLoader for Module "deployment.MultiPartMailTestCase.war" from Service Module Loader") at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:309) at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:201) at java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:661) at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.manager.WildFlySecurityManager.checkRead(WildFlySecurityManager.java:374) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:237) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:177) at java.base/java.util.jar.JarFile.<init>(JarFile.java:350) at java.base/sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:103) at java.base/sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:72) at java.base/sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99) at java.base/sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:125) at java.base/sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:155) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.parse(ServiceLoader.java:1165) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1206) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1221) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator$1.run(ServiceLoader.java:1268) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator$1.run(ServiceLoader.java:1267) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1270) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1300) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1385) at jakarta.mail.api@2.1.0//jakarta.mail.util.FactoryFinder.factoryFromServiceLoader(FactoryFinder.java:130) ... 155 more
Also note this is not the only exception I've seen when attempting to use this with RESTEasy. The Jakarta Activation API has the same ServiceLoader issue with the angus-activation.jar. There was also an issue here with a requirement to add the {{ RuntimePermission("getClassLoader")}} permission.
- is blocked by
-
WFLY-17116 Upgrade Jakarta Activation to 2.1.1.jbossorg-1
- Closed
- is related to
-
WFLY-16687 Analyze Jakarta specification API dependencies that are no longer forked for SM issues
- Open
-
WFLY-17117 Upgrade Jakarta Mail to 2.1.1.jbossorg-1
- Closed