Skip to content

JNDI lookup fails with keys ending ":" in IBM Liberty during application startup #6460

Closed
@remesh22

Description

@remesh22

I am facing a weird issue with containers other than Tomcat(spring boot 1.3.5). The issue is with StandardServletEnvironment which includes JNDIDatasource as one of the property source.

@Override
protected void customizePropertySources(MutablePropertySources propertySources) {
    propertySources.addLast(new StubPropertySource(SERVLET_CONFIG_PROPERTY_SOURCE_NAME));
    propertySources.addLast(new StubPropertySource(SERVLET_CONTEXT_PROPERTY_SOURCE_NAME));
    if (JndiLocatorDelegate.isDefaultJndiEnvironmentAvailable()) {
        propertySources.addLast(new JndiPropertySource(JNDI_PROPERTY_SOURCE_NAME));
    }
    super.customizePropertySources(propertySources);
}

Spring is by default looking for some jndi properties ending with ":" at the end of the property. The lookup is failing for the following properties

spring.cloud.bootstrap.name:
SPRING_APPLICATION_JSON: 
spring.cloud.bootstrap.location: 

etc

Here is the sample application.
demo_ibm.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions