Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when using maven plugin to generate api for interface #73

wtpau opened this issue Jan 20, 2015 · 2 comments

NPE when using maven plugin to generate api for interface #73

wtpau opened this issue Jan 20, 2015 · 2 comments


Copy link

@wtpau wtpau commented Jan 20, 2015


I am using jsondoc 1.1.0 with maven plugin, but when I run the jsondoc:generate goal i got NPE. I found that it is cause by I have an Interface and Impl class and I have the jsondoc annotaction on the interface, but my intention is to annotate the interface as it was supported in the jsondoc 1.0.2 version.

Here is the exception message from maven:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building jsondoctesting 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- jsondoc-maven-plugin:1.1.0:generate (default-cli) @ test ---
log4j:WARN No appenders could be found for logger (org.jsondoc.core.util.JSONDocScanner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See for more info.
at org.jsondoc.core.pojo.ApiDoc.buildFromAnnotation(
at org.jsondoc.core.util.AbstractJSONDocScanner.getApiDoc(
at org.jsondoc.core.util.AbstractJSONDocScanner.getApiDocs(
at org.jsondoc.core.util.AbstractJSONDocScanner.getApiDocsMap(
at org.jsondoc.core.util.AbstractJSONDocScanner.getJSONDoc(
at org.jsondoc.JSONDocMojo.execute(
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(
at org.apache.maven.DefaultMaven.doExecute(
at org.apache.maven.DefaultMaven.execute(
at org.apache.maven.cli.MavenCli.execute(
at org.apache.maven.cli.MavenCli.doMain(
at org.apache.maven.cli.MavenCli.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(
at org.codehaus.plexus.classworlds.launcher.Launcher.main(
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.374s
[INFO] Finished at: Tue Jan 20 11:19:39 CST 2015
[INFO] Final Memory: 10M/112M
[INFO] ------------------------------------------------------------------------

Here is my pom.xml

4.0.0 test test 0.0.1-SNAPSHOT jsondoctesting

## Here is my interface class:

package com.test;

import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiAuthNone;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.annotation.ApiQueryParam;
import org.jsondoc.core.annotation.ApiResponseObject;
import org.jsondoc.core.pojo.ApiVerb;

@Api(name = "test services", description = "Methods for querying location data")
public interface TestInterface {

@ApiMethod(path = "/api/rest/locations", verb = ApiVerb.GET, description = "search location")
Integer searchLocation(
        @ApiQueryParam(name = "site", description = "site", required = true) String site,
        @ApiQueryParam(name = "building", description = "building", required = true) String building,
        @ApiQueryParam(name = "floor", description = "floor", required = true) String floor,
        @ApiQueryParam(name = "room", description = "room", required = true) String room);


Here is my impl class

package com.test.impl;

import com.test.TestInterface;

public class TestImpl implements TestInterface {

public Integer searchLocation(String site, String building, String floor, String room) {
    // TODO Auto-generated method stub
    return null;


Thanks a lot
Wai Tak Pau

Copy link

@Yangjierong Yangjierong commented Jan 20, 2015

I have the same issue!

@fabiomaffioletti fabiomaffioletti added this to the 1.1.3 milestone Jan 20, 2015
@fabiomaffioletti fabiomaffioletti self-assigned this Jan 20, 2015
Copy link

@fabiomaffioletti fabiomaffioletti commented Jan 21, 2015

Should be fine with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.