You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Scott Palmer (Jira)" <ji...@apache.org> on 2022/04/08 23:03:00 UTC

[jira] [Commented] (CXF-8689) cxf-java2ws-plugin plugin running on non-modular JDK fails with NullPointerException

    [ https://issues.apache.org/jira/browse/CXF-8689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17519838#comment-17519838 ] 

Scott Palmer commented on CXF-8689:
-----------------------------------

Suggested fix is trivial:

{code:java}
        if (fork) {
            if (additionalJvmArgs) {
                String[] split = additionalJvmArgs.split("\\s+");
                for (String each : split) {
                    args.add(each);
                }
            }
            // @see JavaToWS#isExitOnFinish()
            args.add("-DexitOnFinish=true");
        }
{code}


> cxf-java2ws-plugin plugin running on non-modular JDK fails with NullPointerException
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-8689
>                 URL: https://issues.apache.org/jira/browse/CXF-8689
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.2.14, 3.3.13, 3.4.6, 3.5.1
>         Environment: JDK 8
>            Reporter: Scott Palmer
>            Priority: Major
>
> additionalJvmArgs is assumed to be non-null when fork=true, but that is not the case when running on a non-modular JDK and not specifying explicitly a non-empty value for additionalJvmArgs in the configuration XML.
> In the case were requiresModules=true a null value is changed to an empty string, but if requiresModules is false the null value remains.
> {code:java}
>         if (fork) {
>             String[] split = additionalJvmArgs.split("\\s+");
> {code}
> Caused by: java.lang.NullPointerException
>     at org.apache.cxf.maven_plugin.Java2WSMojo.initArgs (Java2WSMojo.java:296)
> Work-around is to specify a non-empty value for <additionalJvmArgs> , e.g. <additionalJvmArgs>-Dworkaroundnpe</additionalJvmArgs>



--
This message was sent by Atlassian Jira
(v8.20.1#820001)