Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

In Liberty, BoosterConfigurator with wrong version leads to NPE #351

Open
scottkurz opened this issue Aug 20, 2019 · 1 comment
Open

In Liberty, BoosterConfigurator with wrong version leads to NPE #351

scottkurz opened this issue Aug 20, 2019 · 1 comment
Assignees

Comments

@scottkurz
Copy link
Contributor

By the time we get to: boost.runtimes.openliberty.LibertyRuntime.generateLibertyServerConfig(List<AbstractBoosterConfig>) we're only calling configurator.getFeature() for the select configurators w/ corresponding boosters as dependencies in this project.

So instead of falling through and returning 'null':

public class LibertyJAXRSBoosterConfig extends JAXRSBoosterConfig implements LibertyBoosterI {

    public LibertyJAXRSBoosterConfig(Map<String, String> dependencies, BoostLoggerI logger) throws BoostException {
        super(dependencies, logger);
    }

    @Override
    public String getFeature() {
        if (getVersion().equals(JAXRS_VERSION_20)) {
            return JAXRS_20;
        } else if (getVersion().equals(JAXRS_VERSION_21)) {
            return JAXRS_21;
        }
        return null;
    }

we should probably fail fast with a clear error message.

@ajm01
Copy link
Member

ajm01 commented Aug 20, 2019

top level failure during a mvn boost package will look like:

[INFO] CWWKM2001I: Invoke command is ["C:\BoostRepo\systemtestToolsRepo\system-test\sample-apps\maven-app\target\liberty\wlp\bin\server.bat", create, BoostServer].
[INFO] Server BoostServer created.
[INFO] CWWKM2129I: Server BoostServer has been created at C:\BoostRepo\systemtestToolsRepo\system-test\sample-apps\maven-app\target\liberty\wlp\usr\servers\BoostServer.
FATAL ERROR:  'java.lang.NullPointerException'
           :null
[INFO] CWWKM2102I: Using installDirectory : C:\BoostRepo\systemtestToolsRepo\system-test\sample-apps\maven-app\target\liberty\wlp.
[INFO] CWWKM2102I: Using serverName : BoostServer.
[INFO] CWWKM2102I: Using serverDirectory : C:\BoostRepo\systemtestToolsRepo\system-test\sample-apps\maven-app\target\liberty\wlp\usr\servers\BoostServer.
Downloading from central: https://repo.maven.apache.org/maven2/io/openliberty/features/install-map/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/io/openliberty/features/install-map/maven-metadata.xml (350 B at 1.4 kB/s)
[Fatal Error] :-1:-1: Premature end of file.
[WARNING] The server file C:\BoostRepo\systemtestToolsRepo\system-test\sample-apps\maven-app\target\liberty\wlp\usr\servers\BoostServer\server.xml cannot be parsed. Skipping its features.

@uberskigeek uberskigeek self-assigned this Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants