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-4140: Ignore unresolvable JNDI references #4222

Merged
merged 1 commit into from
Sep 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -833,14 +833,18 @@ private boolean isEmbedded(Application application, String raname) {
*/
private void validateJNDIRefs(DeploymentContext deploymentContext, Application application, AppResource resource, JNDINamespace namespace) {
// In case lookup is not present, check if another resource with the same name exists
String jndiName = resource.getJndiName();
if (jndiName == null || !resource.hasLookup() && !namespace.find(resource.getName(), resource.getEnv())) {
if (!resource.hasLookup() && !namespace.find(resource.getName(), resource.getEnv())) {
deplLogger.log(Level.SEVERE, RESOURCE_REF_JNDI_LOOKUP_FAILED,
new Object[]{resource.getName(), null, resource.getType()});
throw new DeploymentException(localStrings.getLocalString("enterprise.deployment.util.resource.validation",
"JNDI lookup failed for the resource: Name: {0}, Lookup: {1}, Type: {2}",
resource.getName(), null, resource.getType()));
}
String jndiName = resource.getJndiName();
if (jndiName == null) {
// there's no mapping in this resource, but it exists in JNDI namespace, so it's validated by other ref.
return;
}

JndiNameEnvironment env = resource.getEnv();

Expand Down