1 Reply Latest reply on May 8, 2017 11:24 PM by Girish Pathak

    MultiPartReaderServerSide, could not be instantiated java.lang.SecurityException: Unable to create temporary file

    Girish Pathak Newbie

      Can anyone help me please what permission I am missing here ,I have enabled java security manager in wildly 10 and given the required permission in security manager subsystems as below:

       

      <subsystem xmlns="urn:jboss:domain:security-manager:1.0">
        <deployment-permissions>
        <minimum-set>
        <permission class="java.lang.RuntimePermission" name="getClassLoader" actions="read,write"/>
        <permission class="java.lang.reflect.ReflectPermission" name="suppressAccessChecks" actions="read,write"/>
        <permission class="java.util.PropertyPermission" name="*" actions="read"/>
        <permission class="java.lang.RuntimePermission" name="accessClassInPackage.sun.reflect" actions="read,write"/>
        <permission class="java.lang.RuntimePermission" name="accessDeclaredMembers" actions="read,write"/>
        <permission class="javax.management.MBeanPermission" name="*" actions="queryNames"/>
        <permission class="javax.management.MBeanServerPermission" name="*"/>
        <permission class="javax.management.MBeanPermission" name="*" actions="registerMBean"/>
        <permission class="javax.management.MBeanTrustPermission" name="*"/>
        <permission class="java.io.FilePermission" name="*" actions="read,write"/>
        </minimum-set>
        </deployment-permissions>
      </subsystem>

       

      but getting following exception while starting wildfly application server :

       

      08:35:00,105 INFO [com.sun.jersey.server.impl.application.WebApplicationImpl] (ServerService Thread Pool -- 61) Initiating Jersey application, version 'Jersey: 1.1
      9.1 03/11/2016 02:08 PM'
      08:35:00,511 SEVERE [com.sun.jersey.core.spi.component.ProviderFactory] (ServerService Thread Pool -- 61) The provider class, class com.sun.jersey.multipart.impl.MultiPartReaderServerSide, could not be instantiated. Processing will continue but the class will not be utilized: java.lang.SecurityException: Unable to create temporary file
        at java.io.File.createTempFile(File.java:2018)
        at java.io.File.createTempFile(File.java:2070)
        at com.sun.jersey.multipart.impl.MultiPartReaderClientSide.createMimeConfig(MultiPartReaderClientSide.java:121)
        at com.sun.jersey.multipart.impl.MultiPartReaderClientSide.<init>(MultiPartReaderClientSide.java:109)
        at com.sun.jersey.multipart.impl.MultiPartReaderServerSide.<init>(MultiPartReaderServerSide.java:71)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at com.sun.jersey.core.spi.component.ComponentConstructor._getInstance(ComponentConstructor.java:210)
        at com.sun.jersey.core.spi.component.ComponentConstructor.getInstance(ComponentConstructor.java:180)
        at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:166)
        at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
        at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:283)
        at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:163)
        at com.sun.jersey.core.spi.factory.MessageBodyFactory.initReaders(MessageBodyFactory.java:176)
        at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:162)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1338)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180)
        at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799)
        at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795)
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790)
        at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509)
        at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339)
        at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
        at javax.servlet.GenericServlet.init(GenericServlet.java:244)
        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
        at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
        at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231)
        at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
        at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      08:35:00,838 SEVERE [com.sun.jersey.server.impl.application.RootResourceUriRules] (ServerService Thread Pool -- 61) The ResourceConfig instance does not contain any
      root resource classes.
      08:35:00,838 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 61) MSC000001: Failed to start service jboss.undertow.deployment.default-server.defaul
      t-host./cwlc: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./cwlc: com.sun.jersey.api.container.ContainerExc
      eption: The ResourceConfig instance does not contain any root resource classes.
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
        at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180)
        at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799)
        at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795)
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790)
        at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509)
        at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339)
        at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
        at javax.servlet.GenericServlet.init(GenericServlet.java:244)
        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
        at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
        at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231)
        at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
        at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
        ... 6 more