Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1E509200CB4 for ; Mon, 12 Jun 2017 16:12:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1D0BC160BEC; Mon, 12 Jun 2017 14:12:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6084B160BDE for ; Mon, 12 Jun 2017 16:12:05 +0200 (CEST) Received: (qmail 39947 invoked by uid 500); 12 Jun 2017 14:12:04 -0000 Mailing-List: contact notifications-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list notifications@groovy.apache.org Received: (qmail 39776 invoked by uid 99); 12 Jun 2017 14:12:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2017 14:12:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 92274C076E for ; Mon, 12 Jun 2017 14:12:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.011 X-Spam-Level: X-Spam-Status: No, score=-100.011 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id yknibs1hp3OV for ; Mon, 12 Jun 2017 14:12:02 +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 6818A5FD21 for ; Mon, 12 Jun 2017 14:12:02 +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 541DEE0C0D for ; Mon, 12 Jun 2017 14:12:01 +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 32F7D21E13 for ; Mon, 12 Jun 2017 14:12:00 +0000 (UTC) Date: Mon, 12 Jun 2017 14:12:00 +0000 (UTC) From: "Denis Jouvin (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (GROOVY-8227) Allow to specify Groovysh (and GroovyShell) class loader different from TCCL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 12 Jun 2017 14:12:06 -0000 Denis Jouvin created GROOVY-8227: ------------------------------------ Summary: Allow to specify Groovysh (and GroovyShell) class loader different from TCCL Key: GROOVY-8227 URL: https://issues.apache.org/jira/browse/GROOVY-8227 Project: Groovy Issue Type: Bug Components: groovy-runtime, Groovysh Affects Versions: 2.4.x, 2.5.x Environment: OSGi (Karaf 2.x, 3.X or 4.x) Reporter: Denis Jouvin Fix For: 2.4.x, 2.5.x Allthough the Groovy API seem to allow one to specify the class loader when instanciating a Groovysh or GroovyShell, internally in some places Groovy will silently use the TCCL (thread context class loader) and there is no way to avoid that without hacking Groovy and chasing all the places where {code:java}getThreadContextClassLoader(){code} is used. This is problematic, especially in OSGi environement, since the TCCL is not compatible with OSGi principles (i.e. every bundle has its own class loader), and also with some modern modular containers similar to OSGi. When a class loader is specified in the GroovyShell or Groovysh creation, Groovy should propagate that class loader correctly (or instanciate children class loader of that specified class loader), and in no way use the TCCL. This may be a dupplicate of [Groovy 4895|https://issues.apache.org/jira/browse/GROOVY-4895] -- This message was sent by Atlassian JIRA (v6.4.14#64029)