我试图按照http://cxf.apache.org/setting-up-eclipse.html上的说明设置Apache CXF v2.7.7(使用Maven 3.1.0设置),以便在我的win7上使用Eclipse WTP(Kepler Service Release 1) 64位笔记本电脑。我能够成功地将所有三个插件(CheckStyle,PMD,Subversion)添加到Eclipse,但是当创建工作区时,我遇到了两个问题:
1。)来自Subversion的第一个check out CXF方向。"对我毫无意义。该页面将我引导至" svn co {URL}"的三种不同变体形式。命令,但我没有明显的svn批处理或可执行文件,因为我所做的只是安装插件。不知道我应该在这里做些什么。
2。)" mvn -Pfastinstall"很好,但是" mvn -Psetup.eclipse"命令在数据绑定步骤中结束:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.9
:eclipse (setup.eclipse.project) on project cxf-systests-databinding: Cant canon
icalize system path: {0}: The filename, directory name, or volume label syntax i
s incorrect -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-eclipse-plugin:2.9:eclipse (setup.eclipse.project)
on project cxf-systests-databinding: Cant canonicalize system path: {0}
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:216)
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.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
357)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cant canonicalize sys
tem path: {0}
at org.apache.maven.plugin.ide.IdeUtils.getCanonicalPath(IdeUtils.java:1
47)
at org.apache.maven.plugin.ide.IdeUtils.toRelativeAndFixSeparator(IdeUti
ls.java:591)
at org.apache.maven.plugin.eclipse.EclipsePlugin.extractResourceDirs(Ecl
ipsePlugin.java:1787)
at org.apache.maven.plugin.eclipse.EclipsePlugin.buildDirectoryList(Ecli
psePlugin.java:1684)
at org.apache.maven.plugin.eclipse.EclipsePlugin.createEclipseWriterConf
ig(EclipsePlugin.java:1359)
at org.apache.maven.plugin.eclipse.EclipsePlugin.writeConfiguration(Ecli
psePlugin.java:1178)
at org.apache.maven.plugin.ide.AbstractIdeSupportMojo.execute(AbstractId
eSupportMojo.java:511)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:106)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
... 19 more
Caused by: java.io.IOException: The filename, directory name, or volume label sy
ntax is incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:414)
at java.io.File.getCanonicalPath(File.java:618)
at org.apache.maven.plugin.ide.IdeUtils.getCanonicalPath(IdeUtils.java:1
43)
... 27 more
有这样的规范化错误指向使用" $ {basedir}"的pom文件中的问题。以某种方式不参考pom文件,但我不明白这一点。
关于如何解决此问题的任何想法?这是Eclipse WTP的全新安装,并遵循了启动和运行Apache CXF的说明。没有任何定制,我只是正在做他们告诉我的事情所以我可以写一些基本的Web服务代码。
答案 0 :(得分:0)
我对你所指的页面一无所知。但是,如果从CXF开始这里是从WSDL生成JAXB,服务和客户端类的两种最简单的方法,那么使用自下而上的方法生成wsdl也很容易。
第一种方法
其他方式来自maven。
在下面的代码中,我添加了profile code-gen,我运行它来使用目标生成资源生成类。
代码生成 本地
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<versionRange>[2.7,)</versionRange>
<goals>
<goal>wsdl2java</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<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>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/MyWSDL.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/MyWSDL.wsdl</wsdlLocation>
<extraargs>
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-client</extraarg>
<extraarg>-server</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
第一种方法的优点是eclipse甚至生成cxf-bean.xml,而第二种方法不生成beans.xml。所以我更喜欢的是,如果我第一次使用第一种方法生成。在子序列上运行,如果有任何wsdl更改我运行maven方式。