Enunciate not able to assemble a jersey based REST API to upload a file: No more than one JAX-RS entity parameter is allowed

StackOverflow https://stackoverflow.com/questions/16788743

  •  30-05-2022
  •  | 
  •  

Вопрос

I have a resource like this. Enunciate has problem documenting this resource: "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)".

@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;

I found a similar issue reported http://markmail.org/message/vgvi3cljo3a2f6eh http://jira.codehaus.org/browse/ENUNCIATE-537 and this was fixed in version 1.23.

I'm using the latest version 1.26.2 but still seeing this error.

When I annotate with org.codehaus.enunciate.XmlTransient I'm able to avoid this error, but this removes documentation for the whole resource (all methods).

Any help would be great.

Maven Error stack:

[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
Это было полезно?

Решение

I'm not getting the same error. Maybe you could try using Enunciate 1.27?

Другие советы

Updating...

New schema location is: http://enunciate.webcohesion.com/schemas/enunciate-1.27.xsd

Regards.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top