title: Problem with creating AWS Lambda function using Micronaut and GraalVM
body: <p>I'm trying to create and deploy AWS Lambda function in Java using Micronaut, GraalVM, and Docker. I'm following <a href="https://micronaut-projects.github.io/micronaut-aws/latest/guide/#customRuntimes" rel="nofollow noreferrer">this tutorial</a> to create AWS lambda with GraalVM runtime.</p>
  
  <p>I've created java project using <code>micronaut</code> command <code>$ mn create-app my-app --features aws-api-gateway-graal</code>. And then without any change in code or config files, try to build a Docker image with GraalVM native image. In the step of docker build when graalvm native image is building I get these warnings: </p>
  
  <blockquote>
    <p>Warning: Aborting stand-alone image build. No instances are allowed in
    the image heap for a class that is initialized or reinitialized at
    image runtime com.amazonaws.serverless.proxy.model.ContainerConfig.
    Try marking this class for build-time initialization with
    --initialize-at-build-time=com.amazonaws.serverless.proxy.model.ContainerConfig</p>
  
  <pre><code>Detailed message:
  Trace:     field io.micronaut.function.aws.proxy.AbstractLambdaContainerHandler.config
  </code></pre>
    
    <p>Warning: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying
    exception*</p>
    
    <p>Warning: Image 'server' is a fallback image that requires a JDK for
    execution (use --no-fallback to suppress fallback image generation).</p>
  </blockquote>
  
  <p>After build I export docker image with bootstrap file to function.zip file as it's written in tutorial. Then I upload function.zip file to my created AWS lambda function and when I try to test function I get this error: </p>
  
  <blockquote>
  <pre><code>{  "errorType": "Runtime.ExitError",
     "errorMessage": "RequestId: 888854d7-0e0e-42b4-a138-9a003c3455e1 Error: Runtime exited with error:
      exit status 1"
  }
  </code></pre>
    
    <p>START RequestId: 888854d7-0e0e-42b4-a138-9a003c3455e1 Version:
    $LATEST<br>
    <strong>Error: No bin/java and no environment variable JAVA_HOME</strong><br> END RequestId: 888854d7-0e0e-42b4-a138-9a003c3455e1<br> REPORT RequestId:
    888854d7-0e0e-42b4-a138-9a003c3455e1  Duration: 415.09 ms Billed
    Duration: 500 ms  Memory Size: 128 MB Max Memory Used: 16 MB  <br>
    RequestId: 888854d7-0e0e-42b4-a138-9a003c3455e1 Error: Runtime exited
    with error: exit status 1<br> Runtime.ExitError<br></p>
  </blockquote>
  
  <p>I don't know what is wrong. I haven't found any solution for this problem yet.</p>