Prem created CXF-6581:
-------------------------

             Summary: Failed to generate types->Access is denied 
                 Key: CXF-6581
                 URL: https://issues.apache.org/jira/browse/CXF-6581
             Project: CXF
          Issue Type: Bug
          Components: Build system
    Affects Versions: 3.1.2
         Environment: Windows 7 64bit, JDK 7 or 8
            Reporter: Prem


[ERROR] Failed to execute goal 
org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java (generate-sources) on project 
service-data-model-provider: Execution generate-sources of goal 
org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java failed: Failed to generate 
types. 
a:\Misc\WsMock\service-data-model-provider\src\main\java\schema\eo\common\system\messageheader\v1\MessageContextType.java
 (Access is denied) -> [Help 1]

Its completely random and happens for me on all cxf versions and different java 
versions. At the moment I'm on jdk 1.8.45 and cxf 3.1.2

The issue can be resolved by setting always

But then the build is always successful even is some errors will happen which 
are shown as [Warning] in the log.. So I can't use anything like that.

Here's my cfg

<plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <executions>
        <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
                <sourceRoot>${basedir}/src/main/java</sourceRoot>
                <defaultOptions>
                    <extraargs>
                        <extraarg>-validate</extraarg>
                        <extraarg>-exsh</extraarg>
                        <extraarg>true</extraarg>
                    </extraargs>
                </defaultOptions>
                <wsdlRoot>..\..\..</wsdlRoot>
                <includes>
                    <include>mds/apps/services/**/*.wsdl</include>
                </includes>
            </configuration>
            <goals>
                <goal>wsdl2java</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Another thing that helps but its not resolving the issue completely is to 
disable the WriteToCache setting in the WindowsHardDrive driver.

That indicates that the system is too slow and CXF\Java is trying to use the 
file before its completely written to the disk. Using an SSD the issue is 
happening only occasionally.

Our data model is huge (lots of XSD's) and the hard drives are encrypted so 
that's why everything is so slow.

Any ideas how to tune java to handle this? Or maybe its a CXF problem?

Full Stack Trace

    [ERROR] Failed to execute goal 
org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java (generate-sources) on project 
service-data-model-provider: Execution generate-sources of goal 
org.apache.cxf:cxf-codegen-plugin:3.1.2:wsdl2java failed: Fai led to generate 
types. 
a:\Misc\WsMock\service-data-model-provider\src\main\java\co\schema\common\fault\creati
 onfault\v1\ObjectFactory.java (Access is denied) -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.cxf:cxf-codegen-plugin:3.1.2:w sdl2java (generate-sources) on 
project service-data-model-provider: Execution generate-sources of goal 
org.apache.cx f:cxf-codegen-plugin:3.1.2:wsdl2java failed: Failed to generate 
types. at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224) 
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
 at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
 at 
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.
 java:51) at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at 
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at 
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at 
org.apache.maven.cli.MavenCli.execute(MavenCli.java:862) at 
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at 
org.apache.maven.cli.MavenCli.main(MavenCli.java:197) at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:497) at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
generate-sources of goal org.apache.cxf:cxf-codeg en-plugin:3.1.2:wsdl2java 
failed: Failed to generate types. at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
 at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) 
... 20 more Caused by: org.apache.cxf.tools.common.ToolException: Failed to 
generate types. at 
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.generate(JAXBDataBinding.java:839)
 at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:730)
 at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:270)
 at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
 at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:415)
 at 
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103) at 
org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113) at 
org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86) at 
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:415)
 at 
org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:260)
 at 
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:512)
 at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 ... 21 more Caused by: java.io.FileNotFoundException: 
a:\Misc\WsMock\service-data-model-provider\src\main\java\uk\co\schema\ 
common\fault\creationfault\v1\ObjectFactory.java (Access is denied) at 
java.io.FileOutputStream.open0(Native Method) at 
java.io.FileOutputStream.open(FileOutputStream.java:270) at 
java.io.FileOutputStream.(FileOutputStream.java:213) at 
java.io.FileOutputStream.(FileOutputStream.java:162) at 
org.sonatype.plexus.build.incremental.DefaultBuildContext.newFileOutputStream(DefaultBuildContext.java:54)
 at 
org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo$1.createOutputStream(WSDL2JavaMojo.java:411)
 at 
org.apache.cxf.tools.wsdlto.databinding.jaxb.TypesCodeWriter.openBinary(TypesCodeWriter.java:72)
 at com.sun.codemodel.CodeWriter.openSource(CodeWriter.java:100) at 
com.sun.codemodel.JPackage.createJavaSourceFileWriter(JPackage.java:490) at 
com.sun.codemodel.JPackage.build(JPackage.java:441) at 
com.sun.codemodel.JCodeModel.build(JCodeModel.java:311) at 
com.sun.codemodel.JCodeModel.build(JCodeModel.java:301) at 
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.generate(JAXBDataBinding.java:827)
 ... 32 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full 
debug logging. [ERROR] [ERROR] For more information about the errors and 
possible solutions, please read the following articles: [ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to