[ 
https://issues.apache.org/jira/browse/CXF-8049?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ranjit Vadakkan updated CXF-8049:
---------------------------------
    Description: 
I'm trying to create a dynamic client using 
[https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/wsdl_first_dynamic_client/src/main/java/demo/hw/client/ComplexClient.java]
 as a template.

 

When I try to debug this, I intermittently get a (javac compile) failure where 

org.apache.cxf.common.util.Compiler.internalCompile fails because the classpath 
contains an entry with spaces. In my case, this entry with a space was a jar 
from the IntelliJ installation path.

After spending some time debugging it, I could work around the problem by 
escaping the said entry from the calling code (ComplexClient.java), but maybe 
this should be done inside org.apache.cxf.common.util.Compiler.addArgs where 
the classpath is being retrieved from the system property 'java.class.path'. My 
workaround was -

 
{quote}String javaClasspath = System.getProperty("java.class.path");
if(javaClasspath != null){
    List<String> correctedEntries = new ArrayList<>();
     String[] toks = javaClasspath.split(File.pathSeparator);
     for(String tok: toks) {
         if(tok.matches(".*\\s+.*"))
             correctedEntries.add("\"" + tok + "\"");
         else
             correctedEntries.add(tok);
     }

     System.setProperty("java.class.path", String.join(File.pathSeparator, 
correctedEntries));
}{quote}
 

 

  was:
I'm trying to create a dynamic client using 
[https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/wsdl_first_dynamic_client/src/main/java/demo/hw/client/ComplexClient.java]
 as a template.

 

When I try to debug this, I intermittently get a (javac compile) failure where 

org.apache.cxf.common.util.Compiler.internalCompile fails because the classpath 
contains an entry with spaces. In my case, this entry with a space was a jar 
from the IntelliJ installation path.

After spending some time debugging it, I could work around the problem by 
escaping the said entry from the calling code (ComplexClient.java), but maybe 
this should be done inside org.apache.cxf.common.util.Compiler.addArgs where 
the classpath is being retrieved from the system property 'java.class.path'. My 
workaround was -

 

{{String javaClasspath = System.getProperty("java.class.path");}}
 {{if(javaClasspath != null){}}
 {{    List<String> correctedEntries = new ArrayList<>();}}
 {{    String[] toks = javaClasspath.split(File.pathSeparator);}}
 {{    for(String tok: toks) {}}
 {{        if(tok.matches(".*\\}}{{*s+.**"))}}
 {{            correctedEntries.add("\"" + tok + "\"");}}
 {{        else}}
 {{            correctedEntries.add(tok);}}
 \{{    }}}

{{    System.setProperty("java.class.path", String.join(File.pathSeparator, 
correctedEntries));}}
 {{}}}

 

 


> org.apache.cxf.common.util.Compiler fails to compile if a classpath entry 
> contains spaces
> -----------------------------------------------------------------------------------------
>
>                 Key: CXF-8049
>                 URL: https://issues.apache.org/jira/browse/CXF-8049
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 3.3.2
>         Environment: IntelliJ IDEA 2019.1.2 (Ultimate Edition)
> Build #IU-191.7141.44, built on May 7, 2019
> JRE: 1.8.0_202-release-1483-b49 x86_64
> JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
> macOS 10.14.3
>  
> Using OpenJDK 12 to run/debug my project
>            Reporter: Ranjit Vadakkan
>            Priority: Major
>
> I'm trying to create a dynamic client using 
> [https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/wsdl_first_dynamic_client/src/main/java/demo/hw/client/ComplexClient.java]
>  as a template.
>  
> When I try to debug this, I intermittently get a (javac compile) failure 
> where 
> org.apache.cxf.common.util.Compiler.internalCompile fails because the 
> classpath contains an entry with spaces. In my case, this entry with a space 
> was a jar from the IntelliJ installation path.
> After spending some time debugging it, I could work around the problem by 
> escaping the said entry from the calling code (ComplexClient.java), but maybe 
> this should be done inside org.apache.cxf.common.util.Compiler.addArgs where 
> the classpath is being retrieved from the system property 'java.class.path'. 
> My workaround was -
>  
> {quote}String javaClasspath = System.getProperty("java.class.path");
> if(javaClasspath != null){
>     List<String> correctedEntries = new ArrayList<>();
>      String[] toks = javaClasspath.split(File.pathSeparator);
>      for(String tok: toks) {
>          if(tok.matches(".*\\s+.*"))
>              correctedEntries.add("\"" + tok + "\"");
>          else
>              correctedEntries.add(tok);
>      }
>      System.setProperty("java.class.path", String.join(File.pathSeparator, 
> correctedEntries));
> }{quote}
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to