From dev-return-91166-archive-asf-public=cust-asf.ponee.io@sling.apache.org Wed Sep 5 22:49:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id DC8D0180654 for ; Wed, 5 Sep 2018 22:49:04 +0200 (CEST) Received: (qmail 73896 invoked by uid 500); 5 Sep 2018 20:49:03 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 73885 invoked by uid 99); 5 Sep 2018 20:49:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2018 20:49:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7D8EEC1C64 for ; Wed, 5 Sep 2018 20:49:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id hfy36Bd4URDZ for ; Wed, 5 Sep 2018 20:49:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 8A7E15F1EA for ; Wed, 5 Sep 2018 20:49:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id EEFF6E25B2 for ; Wed, 5 Sep 2018 20:49:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3E4E826B5A for ; Wed, 5 Sep 2018 20:49:00 +0000 (UTC) Date: Wed, 5 Sep 2018 20:49:00 +0000 (UTC) From: "Stefan Seifert (JIRA)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (SLING-7880) Avoid NPE when adapting to Tenant for a system users MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SLING-7880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Seifert closed SLING-7880. --------------------------------- > Avoid NPE when adapting to Tenant for a system users > ---------------------------------------------------- > > Key: SLING-7880 > URL: https://issues.apache.org/jira/browse/SLING-7880 > Project: Sling > Issue Type: Bug > Components: Extensions > Affects Versions: Tenant 1.1.0 > Reporter: Stefan Seifert > Assignee: Stefan Seifert > Priority: Major > Fix For: Tenant 1.1.2 > > > when trying to adapt a Resource to a tenant: > {code:java} > Tenant tenant = resourceResolver.adaptTo(Tenant.class); > {code} > this can lead to a NPE in the {{TenantAdapterFactory}} which is catched and logged: > {noformat} > 02.09.2018 11:14:27.586 *ERROR* [0:0:0:0:0:0:0:1 [1535879667510] GET /content/alpha64Project/en.html HTTP/1.1] org.apache.sling.tenant.internal.TenantAdapterFactory can not get user from session > java.lang.NullPointerException: null > at org.apache.sling.tenant.internal.TenantAdapterFactory.getAdapter(TenantAdapterFactory.java:122) > at org.apache.sling.tenant.internal.TenantAdapterFactory.getAdapter(TenantAdapterFactory.java:101) > at org.apache.sling.adapter.internal.AdapterManagerImpl.getAdapter(AdapterManagerImpl.java:143) > at org.apache.sling.api.adapter.SlingAdaptable.adaptTo(SlingAdaptable.java:104) > at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.adaptTo(ResourceResolverImpl.java:818) > ... > {noformat} > when the user of the resource resolver is a system user, and this user has no special access privileges to it's own home path. -- This message was sent by Atlassian JIRA (v7.6.3#76005)