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 48A7A11708 for ; Wed, 3 Sep 2014 15:46:57 +0000 (UTC) Received: (qmail 85968 invoked by uid 500); 3 Sep 2014 15:46:37 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 85897 invoked by uid 500); 3 Sep 2014 15:46:37 -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 85886 invoked by uid 99); 3 Sep 2014 15:46:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2014 15:46:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dmikusa@pivotal.io designates 74.125.82.42 as permitted sender) Received: from [74.125.82.42] (HELO mail-wg0-f42.google.com) (74.125.82.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2014 15:46:32 +0000 Received: by mail-wg0-f42.google.com with SMTP id b13so8596871wgh.1 for ; Wed, 03 Sep 2014 08:46:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=XVZe+ef+Q0pASJxP6rb1thxn30sLjOkZzp5805OzMwU=; b=O+AHUIDzPAVG4G70TDFd6GUJ+61W3dL/hFHT5F6Ym5KyfLU45qXeoBoTjvSN9SN9Nn oHbRzijQQtNiBgLXekCkD0tC1MzX3aTAj4tkQvVuEJk/C/+kfwTGNfPV1E3Uusw5zop5 3dV5y3RPnl37NkoMpnD/z2vGdGzqrG8QlkAjE95FqOj6eTFvvx4UBTeBsoRhL4h+pXHo TMA5b3LpUOIolLLYLilOLvQ5gBCUDXf6iDES+Mc0+/OBFrWOUQckvbHuMXsosd+q8IL0 jXPV2h3EU+GoHvceQ18WFsWhd3h/8z+9UmnHUhGGDS5WBkc4do4eUM6Cw8gu53d/NaeH Xbfg== X-Gm-Message-State: ALoCoQm0YqpN2Yl5eELgm6oPytPWn1CtSXQzPboNwNNDuYnWgL4SW31PxGq+yKm9Xktw9SQcTvnP MIME-Version: 1.0 X-Received: by 10.194.76.133 with SMTP id k5mr48425129wjw.28.1409759169334; Wed, 03 Sep 2014 08:46:09 -0700 (PDT) Received: by 10.217.12.205 with HTTP; Wed, 3 Sep 2014 08:46:09 -0700 (PDT) In-Reply-To: References: Date: Wed, 3 Sep 2014 11:46:09 -0400 Message-ID: Subject: Re: Global JNDI resources lookup behavior difference between version 6.0.39 and 6.0.41/7.0.55 From: Daniel Mikusa To: Tomcat Users List Content-Type: multipart/alternative; boundary=047d7bfcf7b081f18505022b2277 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bfcf7b081f18505022b2277 Content-Type: text/plain; charset=UTF-8 On Wed, Sep 3, 2014 at 11:36 AM, Robert Anderson wrote: > Hi, > > > In a privileged context, a have the following jsp to test a global jndi > resource: > > <%@ page session="false" import="java.util.*,java.sql.*,javax.naming.*, > javax.sql.*,org.apache.commons.dbcp.*" contentType="text/html" %> > <%! > > protected void doLookup(JspWriter out) throws ServletException, IOException > { > Context ctx; > try { > ctx = new InitialContext(); > Object o = ctx.lookup("java:jdbc/cacheapp"); > out.println(o); > > > } catch (NamingException e) { > out.println(e.getMessage()); > } catch (Exception e) { > } > } > > %> > > > > Test JNDI > > > >

Teste JNDI

>
> <% > doLookup(out); > %> >
> > > > > > Versions earlier than 6.0.41: > > org.apache.tomcat.jdbc.pool.DataSource@29050dfd > {ConnectionPool[defaultAutoCommit=null; > defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; > driverClassName=com.intersys.jdbc.CacheDriver; maxActive=10; maxIdle=2; > minIdle=1; initialSize=10; maxWait=10000; testOnBorrow=true; > testOnReturn=false; timeBetweenEvictionRunsMillis=5000; > numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=60000; > testWhileIdle=false; testOnConnect=false; password=********; > url=jdbc:Cache://localhost:1972/USER; username=tomcat; > validationQuery=select 1 from dual; validationQueryTimeout=-1; > validatorClassName=null; validationInterval=0; > accessToUnderlyingConnectionAllowed=true; removeAbandoned=true; > removeAbandonedTimeout=300; logAbandoned=false; connectionProperties=null; > initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true; > useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false; > dataSource=null; dataSourceJNDI=null; suspectTimeout=0; > alternateUsernameAllowed=true; commitOnReturn=false; > rollbackOnReturn=false; useDisposableConnectionFacade=true; > logValidationErrors=false; propagateInterruptState=false; > ignoreExceptionOnPreLoad=false; } > > > 6.0.41 and 7.0.55: > > Name jdbc is not bound in this Context > You'll usually see this when the resource is not successfully created for some reason. Do you see any errors in the logs that might indicate a problem with the resource? Connection issue, missing JDBC driver, etc... You can also see if the resource exists by looking for it through jconsole or jvisualvm. Can you confirm it exists? Lastly you mentioned it's a global resource. Can you confirm that there's a resource link setup? Dan > > That is a bug? > > > We are having a issue in psi-probe because this behavior change ( > https://code.google.com/p/psi-probe/issues/detail?id=411). > > > Thanks in advance. > --047d7bfcf7b081f18505022b2277--