ASF Bugzilla – Attachment 35192 Details for
Bug 61366
"Unable to find [comp]" when attempting to use JNDI datasource for JDBCStore session store
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Properly set the TCCL before performing JNDI datasource lookups
JDBCStore.java.patch (text/plain), 1.27 KB, created by
Jonathan Horowitz
on 2017-08-01 00:47:46 UTC
(
hide
)
Description:
Properly set the TCCL before performing JNDI datasource lookups
Filename:
MIME Type:
Creator:
Jonathan Horowitz
Created:
2017-08-01 00:47:46 UTC
Size:
1.27 KB
patch
obsolete
>Index: java/org/apache/catalina/session/JDBCStore.java >=================================================================== >--- java/org/apache/catalina/session/JDBCStore.java (revision 1803599) >+++ java/org/apache/catalina/session/JDBCStore.java (working copy) >@@ -867,6 +867,9 @@ > return dbConnection; > > if (dataSourceName != null && dataSource == null) { >+ org.apache.catalina.Context context = getManager().getContext(); >+ ClassLoader oldThreadContextCL = context.bind(Globals.IS_SECURITY_ENABLED, null); >+ > Context initCtx; > try { > initCtx = new InitialContext(); >@@ -873,10 +876,12 @@ > Context envCtx = (Context) initCtx.lookup("java:comp/env"); > this.dataSource = (DataSource) envCtx.lookup(this.dataSourceName); > } catch (NamingException e) { >- manager.getContext().getLogger().error( >+ context.getLogger().error( > sm.getString(getStoreName() + ".wrongDataSource", > this.dataSourceName), e); >- } >+ } finally { >+ context.unbind(Globals.IS_SECURITY_ENABLED, oldThreadContextCL); >+ } > } > > if (dataSource != null) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61366
:
35191
|
35192
|
35194