Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A739C1028B for ; Sun, 27 Oct 2013 22:41:52 +0000 (UTC) Received: (qmail 33084 invoked by uid 500); 27 Oct 2013 22:41:48 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 32636 invoked by uid 500); 27 Oct 2013 22:41:44 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 32627 invoked by uid 99); 27 Oct 2013 22:41:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Oct 2013 22:41:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-we0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Oct 2013 22:41:37 +0000 Received: by mail-we0-f180.google.com with SMTP id q59so5804136wes.39 for ; Sun, 27 Oct 2013 15:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=BumRpTTyIADxyoRN8Jv69sQl6sCheht1yqZ/e5oiLK8=; b=GkjuLa2gRkWBb7G7dTZsQUzPqSmLXseZb4F9jHtSN3nUtP8NkUAJsF7j1pwaXU3bkk llRKHvNIZ+mxAc6GM0y72T/pBGL1jUkp3r6Xl/wr8pngIY/+Ur4yJ2s30BmP0TtDzw/C mYOtywqEuWIdx0/aJM8XTcwnbBLNdMotpnKtHW3AqBQRTLbn3Gt0juktbadaOd82BG76 +9jgnUh/H+zXVFxNfSwWOAX/QNLDurMaU6uQfTaDwbp/3L0D73a2JofDwm7Ezm1x/kEE S3ifFJh+ZkgahMruGLA0ma6N0xvxSVMA+HecsJ6BBJR5K+2Ar8uWVR6MLks9IBQk3V1O xxxQ== MIME-Version: 1.0 X-Received: by 10.194.9.100 with SMTP id y4mr11363936wja.22.1382913676058; Sun, 27 Oct 2013 15:41:16 -0700 (PDT) Received: by 10.216.161.196 with HTTP; Sun, 27 Oct 2013 15:41:15 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Oct 2013 02:41:15 +0400 Message-ID: Subject: Re: Tomcat 7.0.47 Websocket + JNDI problems From: Konstantin Kolinko To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 2013/10/28 Francesco Bassi : > Hello everybody. > > I just downloaded 7.0.47 and updated one web application that I developed > in order to use the new standard JSR 356 websocket implementation. > > With this new implementation, I noticed that during the processing of > incoming websocket events, it's not possible to access the JNDI resources. > > ie: > > Context initCtx = new InitialContext(); > Context c = (Context) initCtx.lookup("java:comp/env"); > > gives > > javax.naming.NameNotFoundException: Name [comp/env] is not bound in this > Context. Unable to find [comp]. > > I'm using a custom ServerEndpointConfig.Configurator. > > Everything used to work properly with the old custom tomcat implementation. > > Is it an expected behaviour? > I think it means that the thread where you process those events does not have its Thread.getContextClassLoader() (aka TCCL) configured and thus JNDI does not know to what web application this thread belongs. Can you provide the stack trace of the place where you access JNDI and check what is the value of Thread.currentThread().getContextClassLoader() there? If the class loader is not a o.a.c.loader.WebappClassLoader one, I think it is OK to create a bugzilla issue. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org