Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2464

ProtectionDomainCache throws NPE if ProtectionDomain.getPermissions() returns null

    XMLWordPrintable

    Details

    • Steps to Reproduce:
      Hide

      Run the openliberty com.ibm.ws.cdi.visibility_fat test project. SharedLibraryTest.testSharedLibraryWithCDI will fail, with the ultimate cause being this error seen in the server log:

      Stack Dump = org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Managed Bean [class com.ibm.ws.cdi12.test.shared.InjectedHello] with qualifiers [@Any @Default] with class class com.ibm.ws.cdi12.test.shared.InjectedHello using classloader com.ibm.ws.classloading.internal.AppClassLoader@b0ac22ea
      at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:388)
      at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:350)
      at java.security.AccessController.doPrivileged(AccessController.java:638)
      at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:342)
      at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:83)
      at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:206)
      at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:196)
      at org.jboss.weld.bean.proxy.ClientProxyProvider.access$100(ClientProxyProvider.java:44)
      at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:52)
      at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:48)
      at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache$1.apply(ReentrantMapBackedComputingCache.java:55)
      at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache$1.apply(ReentrantMapBackedComputingCache.java:51)
      at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:64)
      at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:80)
      at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:230)
      at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:779)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:885)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:898)
      at com.ibm.ws.cdi.impl.inject.InjectInjectionObjectFactory$2.run(InjectInjectionObjectFactory.java:165)
      at java.security.AccessController.doPrivileged(AccessController.java:638)
      at com.ibm.ws.cdi.impl.inject.InjectInjectionObjectFactory.getObjectInstance(InjectInjectionObjectFactory.java:158)
      at com.ibm.ws.cdi.impl.inject.InjectInjectionBinding.getInjectionObjectInstance(InjectInjectionBinding.java:97)
      at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1428)
      at com.ibm.ws.cdi.impl.inject.InjectInjectionBinding.getInjectionObject(InjectInjectionBinding.java:129)
      at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectableObject(InjectionBinding.java:1368)
      at com.ibm.wsspi.injectionengine.InjectionTarget.inject(InjectionTarget.java:104)
      at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectTargets(WebApp.java:1353)
      at com.ibm.ws.webcontainer.osgi.webapp.WebApp.inject(WebApp.java:1279)
      at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectAndPostConstruct(WebApp.java:1436)
      at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectAndPostConstruct(WebApp.java:1424)
      at com.ibm.ws.webcontainer.osgi.servlet.ServletWrapper.createTarget(ServletWrapper.java:63)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1535)
      at java.security.AccessController.doPrivileged(AccessController.java:694)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1503)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:587)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1154)
      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4962)
      at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:995)
      at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
      at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1009)
      at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:412)
      at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:371)
      at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:530)
      at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:464)
      at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:329)
      at com.ibm.ws.http.channel.internal.inbound.HttpICLReadCallback.complete(HttpICLReadCallback.java:70)
      at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501)
      at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571)
      at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926)
      at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
      at java.lang.Thread.run(Thread.java:811)
      Caused by: java.lang.NullPointerException
      at org.jboss.weld.bean.proxy.ProtectionDomainCache.create(ProtectionDomainCache.java:76)
      at org.jboss.weld.bean.proxy.ProtectionDomainCache.getProtectionDomainForProxy(ProtectionDomainCache.java:63)
      at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:497)
      at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:380)
      ... 54 more

      Show
      Run the openliberty com.ibm.ws.cdi.visibility_fat test project. SharedLibraryTest.testSharedLibraryWithCDI will fail, with the ultimate cause being this error seen in the server log: Stack Dump = org.jboss.weld.exceptions.WeldException: WELD-001524 : Unable to load proxy class for bean Managed Bean [class com.ibm.ws.cdi12.test.shared.InjectedHello] with qualifiers [@Any @Default] with class class com.ibm.ws.cdi12.test.shared.InjectedHello using classloader com.ibm.ws.classloading.internal.AppClassLoader@b0ac22ea at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:388) at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:350) at java.security.AccessController.doPrivileged(AccessController.java:638) at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:342) at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:83) at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:206) at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:196) at org.jboss.weld.bean.proxy.ClientProxyProvider.access$100(ClientProxyProvider.java:44) at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:52) at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:48) at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache$1.apply(ReentrantMapBackedComputingCache.java:55) at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache$1.apply(ReentrantMapBackedComputingCache.java:51) at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:64) at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:80) at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:230) at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:779) at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:885) at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:898) at com.ibm.ws.cdi.impl.inject.InjectInjectionObjectFactory$2.run(InjectInjectionObjectFactory.java:165) at java.security.AccessController.doPrivileged(AccessController.java:638) at com.ibm.ws.cdi.impl.inject.InjectInjectionObjectFactory.getObjectInstance(InjectInjectionObjectFactory.java:158) at com.ibm.ws.cdi.impl.inject.InjectInjectionBinding.getInjectionObjectInstance(InjectInjectionBinding.java:97) at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObject(InjectionBinding.java:1428) at com.ibm.ws.cdi.impl.inject.InjectInjectionBinding.getInjectionObject(InjectInjectionBinding.java:129) at com.ibm.wsspi.injectionengine.InjectionBinding.getInjectableObject(InjectionBinding.java:1368) at com.ibm.wsspi.injectionengine.InjectionTarget.inject(InjectionTarget.java:104) at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectTargets(WebApp.java:1353) at com.ibm.ws.webcontainer.osgi.webapp.WebApp.inject(WebApp.java:1279) at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectAndPostConstruct(WebApp.java:1436) at com.ibm.ws.webcontainer.osgi.webapp.WebApp.injectAndPostConstruct(WebApp.java:1424) at com.ibm.ws.webcontainer.osgi.servlet.ServletWrapper.createTarget(ServletWrapper.java:63) at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1535) at java.security.AccessController.doPrivileged(AccessController.java:694) at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1503) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:587) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1154) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4962) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:995) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279) at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1009) at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:412) at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:371) at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:530) at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:464) at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:329) at com.ibm.ws.http.channel.internal.inbound.HttpICLReadCallback.complete(HttpICLReadCallback.java:70) at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:501) at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:571) at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:926) at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1015) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.lang.Thread.run(Thread.java:811) Caused by: java.lang.NullPointerException at org.jboss.weld.bean.proxy.ProtectionDomainCache.create(ProtectionDomainCache.java:76) at org.jboss.weld.bean.proxy.ProtectionDomainCache.getProtectionDomainForProxy(ProtectionDomainCache.java:63) at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:497) at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:380) ... 54 more

      Description

      With security manager enabled, ProtectionDomainCache.create() throws a NullPointerException if ProtectionDomain.getPermissions() returns null.

      The javadoc for that method says that it can return null.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                azquelt Andrew Rouse
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: