2

i am using 'enunciate' for the existing Java REST (using Jersey) project. i have build.xml and enunciate.xml: output file docs.zip is created but after unzip this file, i have: css/ dir, js/ dir, robots.txt, model.html, index.html, favicon.ico, crossdomain.xml, application.wadl, apple-touch-icon.png files.

index.html and model.html do not have any docs from my java REST code. Could anyone help me here? I have no 'enunciate' experience.

Thanks,

---> this is one of REST code example:

@Path("/{spacecraftId}/log")

public class UserLogHandler implements ProcessCommunicationFacilityFailureListenerInterface, MessageCustomerInterface, IMessageAvailable {

/**
 *  Retrieve log file information from MySQL database:
 *
 */
@GET
@Produces(MediaType.TEXT_XML)
public Response retrieveLogFromDatabase(
        @PathParam("spacecraftId") String spacecraftId,
        @Context HttpServletRequest servletRequest)
{
}

}

---> the 'build.xml' file:

<!--The enunciate classpath points to all the jars in the "lib" directory.-->
<path id="enunciate.classpath">

 <pathelement path="${acmd-class-dir}:${mdasclasses.dir}"/>

  <fileset dir="/TPS/V19.0.2">
    <include name="xerces/xercesImpl.jar"/>
    <include name="xerces/xml-apis.jar"/>
    <include name="jdkaddons/jdom.jar"/>
    <include name="jdkaddons/mail.jar"/>
    <include name="jdkaddons/commons-codec.jar"/>
    <include name="jdkaddons/asm-3.1.jar"/>
    <include name="jdkaddons/jersey-core-1.7.jar"/>
    <include name="jdkaddons/jersey-server-1.7.jar"/>
    <include name="jdkaddons/jsr311-api-1.1.1.jar"/>
    <include name="jdkaddons/jersey-client-1.7.jar"/>
    <include name="jdkaddons/jersey-multipart-1.7.jar"/>
  </fileset>


  <fileset dir="${enunciate.home}/lib">
    <include name="*.jar"/>
  </fileset>

  <fileset dir="${enunciate.java}"> 
    <include name="lib/tools.jar"/>
  </fileset>           

</path>

<!--define the task...-->
<taskdef name="enunciate" classname="org.codehaus.enunciate.main.EnunciateTask">
  <classpath refid="enunciate.classpath"/>
</taskdef>

<enunciate basedir="./" verbose="true" configFile="./enunciate.xml" >

  <include name="**/*.java"/>
  <classpath refid="enunciate.classpath"/>
  <export artifactId="docs" destination="./docs.zip"/>  
  <javacArgument argument="-g"/> 
</enunciate>

---> the 'enunciate.xml' file:

<api-classes>
    <include pattern="/tps/tomcat/lib/servlet-api.jar"/>>

    <exclude pattern="com.sun.jersey.multipart.FormDataParam"/>
</api-classes>

<services>
    <rest defaultRestSubcontext="api">
    </rest>
</services>

<webapp disabled="true">
</webapp>

<modules>
  <disable-rule id="csharp.warnings"/>
  <disable-rule id="c-warnings"/>
  <disable-rule id="obj-c.warnings"/>
  <basic-app disabled="true"/>
  <c disabled="true"/>
  <csharp disabled="true"/>
  <jaxws-ri disabled="true"/>
  <obj-c disabled="true"/>
  <amf disabled="true"/>
  <gwt disabled="true"/>
  <jboss disabled="true"/>
  <object-c disabled="true"/>
  <rubby disabled="true"/>
  <jaxws-client disabled="true"/>

  <jersey disabled="false"/>

  <docs title="ICMD API"  docsDir="./" splashPackage="cmd.acmd_mdc_servlet" includeDefaultDownloads="true" includeExampleXml="false" disableRestMountpoint="true" copyright="copyright" forceExampleJson="true"/>
</modules>

derek
  • 51
  • 3
  • 6

1 Answers1

2

Your "include pattern" is incorrect. The "includes" refer to classes, not jars. So it might look something like:

 <include pattern="com.mycompany.api.resources.**"/>

Also, make sure all those classes are on your classpath when you invoke Enunciate.

Ryan Heaton
  • 1,173
  • 7
  • 11