0

I want to document my REST Based API, so for that I searched the google and found this http://jsondoc.org/

I am using GuiceConfig to inject the objects and there I used the method JSONDocUtils.getApiDoc(servletContext, version, basePath); inside GuiceConfig.java

public void contextInitialized(ServletContextEvent servletContextEvent) {

    LOGGER.info("Initializing Context : configuring juice Injector");
    injector = Guice.createInjector(new Module[] { new PropertiesModule(),
     ................       
    } });

    ServletContext servletContext = servletContextEvent.getServletContext();
    servletContext.setAttribute(Injector.class.getName(), injector);
    System.out.println("JSON DOC UTILS......");
    JSONDocUtils.getApiDoc(servletContext, "1.0", "jsondoc");
}

Code is throwing an exception that "java.lang.NoClassDefFoundError: org/jsondoc/core/util/JSONDocUtils" but in reality the jar I have specified as a dependency like this

  <dependency>
    <groupId>org.jsondoc</groupId>
    <artifactId>org.jsondoc</artifactId>
    <version>1.0.2</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/jsondoc-core.jar</systemPath>
   </dependency>

And yes it is there in the lib folder.

Simulant
  • 19,190
  • 8
  • 63
  • 98
Ankur Verma
  • 5,793
  • 12
  • 57
  • 93

2 Answers2

2

Now JSONDoc is available on maven central, so the best thing is that you upgrade it to latest version and eventually follow the migration notes on the website.

Fabio Maffioletti
  • 820
  • 1
  • 8
  • 17
0

Are you sure the dependencies of jsondoc are available at runtime ?

I suspect the one missng to be org.reflections:reflections. See full dependencies list

Olivier.Roger
  • 4,241
  • 5
  • 40
  • 68