Hyperjaxb和Apache CXF [英] Hyperjaxb and Apache CXF

查看:105
本文介绍了Hyperjaxb和Apache CXF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Hyperjaxb3与Apache CXF一起使用,以便从WSDL优先的Web服务生成持久性注释。我已经将Hyperjaxb3-ejb-plugin插入到cxf-codegen-plugin中,就像这样。

I'm trying to use Hyperjaxb3 with Apache CXF to generate persistence annotations from a WSDL-first web service. I've plugged the Hyperjaxb3-ejb-plugin into the cxf-codegen-plugin, like so.

<plugin>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-codegen-plugin</artifactId>
  <version>${cxf.version}</version>
  <dependencies>
    <dependency>
      <groupId>org.jvnet.jaxb2_commons</groupId>
      <artifactId>jaxb2-basics</artifactId>
      <version>0.5.2</version>
    </dependency>
    <dependency>    
      <groupId>org.jvnet.hyperjaxb3</groupId>
      <artifactId>hyperjaxb3-ejb-plugin</artifactId>
      <version>0.5.4</version>
    </dependency>
  </dependencies> 
  <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/CDXLEAToCourt.wsdl</wsdl>
            <xjcargs>
              <xjcarg>-Xequals</xjcarg>
              <xjcarg>-XtoString</xjcarg>
              <xjcarg>-Xhyperjaxb3-ejb</xjcarg>
            </xjcargs>
          </wsdlOption>
        </wsdlOptions>
      </configuration>
      <goals>
        <goal>wsdl2java</goal>
      </goals>
    </execution>
  </executions>
</plugin>

当我生成源代码时,我得到以下信息性的堆栈跟踪。

When I generate source, I get the following informative stack trace.

Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.2.7:wsdl2java (generate-sources) on project leaToCourtWS: Failed to generate types. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.2.7:wsdl2java (generate-sources) on project leaToCourtWS: Failed to generate types.
  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:585)
  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
  at org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)
  at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)
  at org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  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 generate types.
  at org.apache.cxf.maven_plugin.WSDL2JavaMojo.callWsdl2Java(WSDL2JavaMojo.java:409)
  at org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:361)
  at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
  at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:577)
  ... 14 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:716)
  at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:582)
  at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:228)
  at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:128)
  at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:271)
  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.WSDL2JavaMojo.callWsdl2Java(WSDL2JavaMojo.java:406)
  ... 17 more

我一直在反对这个问题。我试图在没有Hyperjaxb的情况下继续项目,但不想承担维护费用。有任何想法吗?异常的解决方案 - 或者使用Hyperjaxb的替代方案 - 会很棒。

I've been banging my head against this for a while. I tried to continue the project without Hyperjaxb, but don't want to incur the maintenance costs. Any ideas? A solution to the exception- or an alternative to using Hyperjaxb- would be great.

推荐答案

找到解决方案。我通过电子邮件向Aleksei发送了电子邮件 - 项目所有者 - 他告诉我,Hyperjaxb3 CXF集成是在.5.5中引入的,尚未发布。 D'oh!

Found a solution. I emailed Aleksei - the project owner- and he informed me that Hyperjaxb3 CXF integration was introduced in .5.5, which has yet to be released. D'oh!

他建议我使用快照存储库。我将存储库添加到我的POM中,将hyperjaxb3-ejb-plugin的版本更改为0.5.5-SNAPSHOT-到目前为止,一切都运行良好。

He suggested I use the snapshot repository. I added the repository to my POM, changed the version of the hyperjaxb3-ejb-plugin to 0.5.5-SNAPSHOT- and so far, everything works beautifully.

这篇关于Hyperjaxb和Apache CXF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆