You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by prem <pr...@gmail.com> on 2015/09/03 17:42:35 UTC

Failed to generate types->Access is denied

Hi 

I'm struggling to fix this issue since 2013...
I'm using Windows 7.

[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 <fork>always</fork> 

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>





Cheers
Prem





--
View this message in context: http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Failed to generate types->Access is denied

Posted by prem <pr...@gmail.com>.
No clean works fine and its related to the system performance.

thats rather a java issue than the CXF itself.

Cxf generates a file and Java writes it to the file system. As windows has
a write buffer the handle to the file is being released and Java thinks the
file is on the HDD but its still being locked.

My HDD is encrypted that's why this is happening for me.

On a ssd its not happening that often and after disabling windows write
buffer on the driver its almost gone.

Cxf should wait and verify the created file before it will try to read it
again.

I've reported a bug at cxf Jira.
On 8 Sep 2015 2:42 pm, "Aki Yoshida-3 [via CXF]" <
ml-node+s547215n5760890h83@n5.nabble.com> wrote:

> okay. i saw your pom in your earlier post.
> i think you shouldn't be generating your source files in your normal
> source folder because then you can't automatically get a clean build
> option.
>
> maybe your old build process is locking that directory and the
> generator couldn't write to the files or something in windows
> interfering with it.
>
> if you generate your source files into one of the sub directories
> within the target directory, you'll have an option of running a clean
> build to eliminate such issues. (you may see mvn clean already
> throwing an error if something is locking one of its sub directories).
>
> other than that, i have no idea.
>
> 2015-09-08 15:04 GMT+02:00 prem <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5760890&i=0>>:
>
> > Hi Aki,
> >
> > No its not a build problem, please read my previous post in details.
> > There are no java files. Everything is generated from wsdl's on the fly.
> > Using fast ssd or with cxf with enabled fork=always everything works
> fine.
> > But that's not an option for me and I'm still looking for the real issue
> > behind this.
> >
> > Cheers
> > Prem
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743p5760888.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743p5760890.html
> To unsubscribe from Failed to generate types->Access is denied, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5760743&code=cHJ6ZW1lay5jaEBnbWFpbC5jb218NTc2MDc0M3wtODk1OTcwODE4>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743p5760913.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Failed to generate types->Access is denied

Posted by Aki Yoshida <el...@gmail.com>.
okay. i saw your pom in your earlier post.
i think you shouldn't be generating your source files in your normal
source folder because then you can't automatically get a clean build
option.

maybe your old build process is locking that directory and the
generator couldn't write to the files or something in windows
interfering with it.

if you generate your source files into one of the sub directories
within the target directory, you'll have an option of running a clean
build to eliminate such issues. (you may see mvn clean already
throwing an error if something is locking one of its sub directories).

other than that, i have no idea.

2015-09-08 15:04 GMT+02:00 prem <pr...@gmail.com>:
> Hi Aki,
>
> No its not a build problem, please read my previous post in details.
> There are no java files. Everything is generated from wsdl's on the fly.
> Using fast ssd or with cxf with enabled fork=always everything works fine.
> But that's not an option for me and I'm still looking for the real issue
> behind this.
>
> Cheers
> Prem
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743p5760888.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Failed to generate types->Access is denied

Posted by prem <pr...@gmail.com>.
Hi Aki,

No its not a build problem, please read my previous post in details.
There are no java files. Everything is generated from wsdl's on the fly.
Using fast ssd or with cxf with enabled fork=always everything works fine.
But that's not an option for me and I'm still looking for the real issue
behind this.

Cheers
Prem



--
View this message in context: http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743p5760888.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Failed to generate types->Access is denied

Posted by Aki Yoshida <el...@gmail.com>.
i don't know how your build job is organized and i think there is some
issue there.

what is this a:\Misc\WsMock\service-data-model-provider\src\main\java\uk\co\schema\
common\fault\creationfault\v1\ObjectFactory.java?
isn't it an automatically generated file and why is it placed in this
source folder?


2015-09-03 17:44 GMT+02:00 prem <pr...@gmail.com>:
> Full stack:
>
> [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.<init>(FileOutputStream.java:213)
>         at java.io.FileOutputStream.<init>(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
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743p5760744.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Failed to generate types->Access is denied

Posted by prem <pr...@gmail.com>.
Full stack:

[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.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(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



--
View this message in context: http://cxf.547215.n5.nabble.com/Failed-to-generate-types-Access-is-denied-tp5760743p5760744.html
Sent from the cxf-user mailing list archive at Nabble.com.