[
https://issues.apache.org/jira/browse/CXF-7830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16597525#comment-16597525
]
ASF GitHub Bot commented on CXF-7830:
-------------------------------------
fwangel opened a new pull request #440: [CXF-7830] Support for running
java2ws-plugin using JDK9+ on Windows.
URL: https://github.com/apache/cxf/pull/440
### Problem description
When using the `cxf-java2ws-plugin` from a Maven project using JDK 9+ (10
and 11 release candidate) on Windows 10, it fails to run because the generated
command line is too long.
As an example, in one project I'm working on, the generated classpath was
more than 75000 characters long – Yes, it is a big project. It works on JDK 8.
`[ERROR] Failed to execute goal
org.apache.cxf:cxf-java2ws-plugin:3.2.6:java2ws (EXECUTIONNAME) on project
PROJECTNAME: Error while executing process.: Cannot run program "cmd.exe" (in
directory "C:\opt\dev\..._PROJECTNAME_\target"): CreateProcess error=206, The
filename or extension is too long -> [Help 1]`
The current code base (3.3.0-SNAPSHOT) does not work at all with JDK 10 or
11.
The problem is that the classpath is part of the command line and on Windows
it seems to be limited to around 8000 characters.
### This commit includes:
Fix for "CreateProcess error=206, The filename or extension is too long":
- Added parameter `classpathAsEnvVar`, which is `false` by default,
unless plugin is running in a Windows OS using JDK 9+, in which
case it is activated automatically. This parameter controls if
the CLASSPATH is applied via environment variable or as an
argument to the command line that executes the java2ws tool.
Cleaning up the JDK9+ JVM arguments code:
- Single block for JDK 9, 10, 11 and up.
- For JDK 11 and up the java.xml.ws module is skipped since
it was moved out of the JDK.
More verbose error reporting:
- If command fails to execute, the reported message
includes information about the command line, and
the CLASSPATH environment variable if defined.
Other fixes:
- Fixed NPE when classifier is undefined.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> cxf-java2ws-plugin command too long (because of -cp argument)
> -------------------------------------------------------------
>
> Key: CXF-7830
> URL: https://issues.apache.org/jira/browse/CXF-7830
> Project: CXF
> Issue Type: Bug
> Components: Tooling
> Affects Versions: 3.2.6
> Environment: Windows 10
> JDK 9, 10 and 11
> Reporter: Fredrik Wangel
> Priority: Critical
> Labels: CLASSPATH, jdk10, jdk11, wsdl
>
> Using the cxf-java2ws-plugin from a Maven project using JDK 9+ (10 and 11
> release candidate) on Windows 10, it fails to run because the generated
> command line is too long.
> In our case, the generated classpath was more than 75000 characters long –
> Yes, it is a big project. It used to work on JDK 8.
> {{[ERROR] Failed to execute goal
> org.apache.cxf:cxf-java2ws-plugin:3.2.6:java2ws (_EXECUTIONNAME_) on project
> _PROJECTNAME_: Error while executing process.: Cannot run program "cmd.exe"
> (in directory "C:\opt\dev\...\_PROJECTNAME_\target"): CreateProcess
> error=206, The filename or extension is too long -> [Help 1]}}
>
> The current code base (3.3.0-SNAPSHOT) does not work at all with JDK 10 or 11.
> The problem is that the classpath is part of the command line and on Windows
> it seems to be limited to around 8000 characters.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)