cagataygurturk / lambadaframework

Build serverless REST API's with JAVA. It implements the JAX-RS API and deploys your application easily to AWS Lambda and API Gateway
MIT License
244 stars 48 forks source link

Delete fails when doing a deploy with similar end points #17

Closed arranubels closed 8 years ago

arranubels commented 8 years ago

I ran the boilerplate example, and my only change was to change the contents of the class to:

    @Path("/")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public String root() {
        return "Test";
    }

    @Path("rest/server/test")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public String test() {
        return "Test";
    }

    @Path("rest/server/test2")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public String test2() {
        return "Test";
    }

This seems to cause an error when doing a deploy in the maven plugin:

[INFO] 4 resources found in JAR File.
[INFO] Returning API: n889e5scqb
[INFO] Removing all resources
[INFO] Resource is being created: /
[INFO] Resource created: / (gsu58nvr1l)
[INFO] Methods are being deployed
[INFO] Removing all methods
[INFO] GET method deleted on resource id gsu58nvr1l
[INFO] Resource is being created: /
[INFO] Resource created: / (gsu58nvr1l)
[INFO] Methods are being deployed
[INFO] Removing all methods
[INFO] Creating GET method on resource gsu58nvr1l
[INFO] Resource is being created: /rest/server/test
[INFO] Resource created: /rest/server/test (mylkmj)
[INFO] Methods are being deployed
[INFO] Removing all methods
[INFO] Creating GET method on resource mylkmj
[INFO] Resource is being created: /rest/server/test2
[INFO] Resource created: /rest/server/test2 (2cscgt)
[INFO] Methods are being deployed
[INFO] Removing all methods
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:24.255s
[INFO] Finished at: Thu May 26 12:31:18 EST 2016
[INFO] Final Memory: 27M/341M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.lambadaframework:lambada-maven-plugin:0.0.4:deploy (default) on project kagura-lambda: Exception at deployment: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.lambadaframework:lambada-maven-plugin:0.0.4:deploy (default) on project kagura-lambda: Exception at deployment
    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:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    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)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.apache.maven.plugin.MojoExecutionException: Exception at deployment
    at org.lambadaframework.deployer.LambadaDeployer.execute(LambadaDeployer.java:86)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 25 more
Caused by: java.lang.NullPointerException
    at org.lambadaframework.aws.ApiGateway.deployMethods(ApiGateway.java:415)
    at org.lambadaframework.aws.ApiGateway.deployResource(ApiGateway.java:380)
    at org.lambadaframework.aws.ApiGateway.lambda$walkThroughResources$1(ApiGateway.java:308)
    at org.lambadaframework.aws.ApiGateway$$Lambda$5/1976502072.accept(Unknown Source)
    at java.lang.Iterable.forEach(Iterable.java:75)
    at org.lambadaframework.aws.ApiGateway.walkThroughResources(ApiGateway.java:308)
    at org.lambadaframework.aws.ApiGateway.deployEndpoints(ApiGateway.java:107)
    at org.lambadaframework.deployer.LambadaDeployer.execute(LambadaDeployer.java:81)
    ... 27 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
arranubels commented 8 years ago

Example: https://github.com/arranubels/lambadaframework-boilerplate

cagataygurturk commented 8 years ago

Fixed in 0.5 release

cagataygurturk commented 8 years ago

0.5 has been released fyi.