我有这样的资源。Enunciate 在记录此资源时遇到问题:“不允许超过一个 JAX-RS 实体参数(所有其他参数必须使用 JAX-RS 资源参数注释之一进行注释)”。
@POST
@Path("{appId}/versions/{id}/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public Response upload(@PathParam("appId") Long appId,
@PathParam("id") Long id,
@FormDataParam("file") InputStream uploadedInputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail)
throws Exception;
我发现一个类似的问题报告了 http://markmail.org/message/vgvi3cljo3a2f6eh http://jira.codehaus.org/browse/ENUNCIATE-537 ,这在 1.23 版中得到了修复。
我正在使用最新版本 1.26.2 但仍然看到此错误。
当我使用 org.codehaus.enunciate.XmlTransient 进行注释时,我能够避免此错误,但这会删除整个资源(所有方法)的文档。
任何帮助都会很棒。
Maven错误堆栈:
[WARNING] Validation result has errors.
error: [core] AppResource.upload: No more than one JAX-RS entity parameter is allowed (all other parameters must be annotated with one of the JAX-RS resource parameter annotations).
1 error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.640s
[INFO] Finished at: Tue May 28 14:48:18 IST 2013
[INFO] Final Memory: 20M/50M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.26.2:assemble (default) on project crashreport-ws: Problem assembling the enunciate app. org.codehaus.enunciate.apt.ModelValidationException: There were validation errors -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.26.2:assemble (default) on project crashreport-ws: Problem assembling the enunciate app.
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: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: Problem assembling the enunciate app.
at org.codehaus.enunciate.AssembleMojo.execute(AssembleMojo.java:75)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more