Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-2779 fix NPE regression in concurrent for Payara 4 #2798

Merged
merged 1 commit into from May 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -170,24 +170,24 @@ public ContextHandle setup(ContextHandle contextHandle) throws IllegalStateExcep
InvocationContext handle = (InvocationContext) contextHandle;
String appName = null;

ClassLoader backupClassLoader = null;
if (handle.getInvocation() != null) {
appName = handle.getInvocation().getAppName();
}
if(appName == null && handle.getInvocation().getJNDIEnvironment() != null) {
appName = DOLUtils.getApplicationFromEnv((JndiNameEnvironment)handle.getInvocation().getJNDIEnvironment()).getName();
}
ClassLoader backupClassLoader = null;
if (appName == null) {
// try to get environment from component ID
if(handle.getInvocation().getComponentId() != null && compEnvMgr != null) {
JndiNameEnvironment currJndiEnv = compEnvMgr.getJndiNameEnvironment(handle.getInvocation().getComponentId());
if(currJndiEnv != null) {
com.sun.enterprise.deployment.Application appInfo = DOLUtils.getApplicationFromEnv(currJndiEnv);
if(appInfo != null) {
appName = appInfo.getName();
// cache JNDI environment
handle.getInvocation().setJNDIEnvironment(currJndiEnv);
backupClassLoader = appInfo.getClassLoader();
if (appName == null && handle.getInvocation().getJNDIEnvironment() != null) {
appName = DOLUtils.getApplicationFromEnv((JndiNameEnvironment) handle.getInvocation().getJNDIEnvironment()).getName();
}
if (appName == null) {
// try to get environment from component ID
if (handle.getInvocation().getComponentId() != null && compEnvMgr != null) {
JndiNameEnvironment currJndiEnv = compEnvMgr.getJndiNameEnvironment(handle.getInvocation().getComponentId());
if (currJndiEnv != null) {
com.sun.enterprise.deployment.Application appInfo = DOLUtils.getApplicationFromEnv(currJndiEnv);
if (appInfo != null) {
appName = appInfo.getName();
// cache JNDI environment
handle.getInvocation().setJNDIEnvironment(currJndiEnv);
backupClassLoader = appInfo.getClassLoader();
}
}
}
}
Expand Down