Andrew created CXF-5403: --------------------------- Summary: wsdl2java generating file names that are too long for encrypted filesystem Key: CXF-5403 URL: https://issues.apache.org/jira/browse/CXF-5403 Project: CXF Issue Type: Bug Components: Tooling Affects Versions: 2.7.7 Environment: Linux Mint 15, EcryptFS Reporter: Andrew
When using the CXF Codegen Maven plugin, and the wsdl2java goal, I get the following exception: {noformat} [WARNING] Could not create marker file /home/andrew/workspace/XXXX/xxxx-interfaces-esb-parent/xxxx-interfaces-client/target/cxf-codegen-plugin-markers/.file__home_andrew_workspace_XXXX_xxxx-interfaces-esb-parent_xxxx-interfaces-webservice_target_classes_META-INF_wsdl_XXXXInterfaces.wsdl.java.DONE [DEBUG] java.io.IOException: File name too long at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:947) at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.createMarkerFile(WSDL2JavaMojo.java:271) at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:453) at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:310) at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:524) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 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:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) {noformat} The reason for this is that I've encrypted my home directory with EcryptFS, but (unknown to me at the time) it does not support file names which are longer than 143 characters, and will not in the foreseeable future (as per https://bugs.launchpad.net/ecryptfs/+bug/344878). Is there any way to do something about the file name being generated by CXF in this instance? Surely it doesn't need to duplicate the whole path in the file name? And if it does, wouldn't it make more sense to hash it and include the hash instead of the path? e.g. a SHA512 hash would be a fixed 128 characters, plus 5 for the ".DONE" suffix makes 133, which is within the 143 characters I'm allowed... That would also guard against the possibility of the name exceeding 255 characters, which, while less likely, is still quite possible if you're going to store the whole path in the file name. This does mean that I have to be *very* careful about the naming of my projects if I want to get the WSDL generator to work, which isn't an awful lot of fun. It's also eating the actual error, as you will note that the exception is above is only being output at DEBUG level. The actual exception I see when I run mvn -e is: {noformat} [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.7:wsdl2java (generate-sources) on project xxxx-interfaces-client: Failed to create marker file /home/andrew/workspace/XXXX/xxxx-interfaces-esb-parent/xxxx-interfaces-client/target/cxf-codegen-plugin-markers/.file__home_andrew_workspace_XXXX_xxxx-interfaces-esb-parent_xxxx-interfaces-webservice_target_classes_META-INF_wsdl_XXXXInterfaces.wsdl.java.DONE -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.7:wsdl2java (generate-sources) on project xxxx-interfaces-client: Failed to create marker file /home/andrew/workspace/XXXX/xxxx-interfaces-esb-parent/xxxx-interfaces-client/target/cxf-codegen-plugin-markers/.file__home_andrew_workspace_XXXX_xxxx-interfaces-esb-parent_xxxx-interfaces-webservice_target_classes_META-INF_wsdl_XXXXInterfaces.wsdl.java.DONE at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 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:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to create marker file /home/andrew/workspace/XXXX/xxxx-interfaces-esb-parent/xxxx-interfaces-client/target/cxf-codegen-plugin-markers/.file__home_andrew_workspace_XXXX_xxxx-interfaces-esb-parent_xxxx-interfaces-webservice_target_classes_META-INF_wsdl_XXXXInterfaces.wsdl.java.DONE at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.generate(WSDL2JavaMojo.java:458) at org.apache.cxf.maven_plugin.AbstractCodegenMoho.execute(AbstractCodegenMoho.java:310) at org.apache.cxf.maven_plugin.wsdl2java.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:524) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) ... 19 more {noformat} Which is not particularly helpful. -- This message was sent by Atlassian JIRA (v6.1#6144)