title: NoClassDefFoundError with SpringBootRequestHandler
body: <p>I have implemented a simple AWS lambda application with spring cloud function. When i create labmda function and send the request in AWS then the following error has thrown.</p>
  <pre><code>{
    &quot;errorMessage&quot;: &quot;Error loading class com.benz.aws.lambda.api.handler.OrderHandler: org/springframework/cloud/function/adapter/aws/SpringBootRequestHandler&quot;,
    &quot;errorType&quot;: &quot;java.lang.NoClassDefFoundError&quot;
  }
  </code></pre>
  <p><strong>functon package</strong></p>
  <pre><code> @Component
      public class OrderFunction implements ApplicationContextInitializer&lt;GenericApplicationContext&gt;
      {
      
          private OrderDao orderDao;
      
          @Autowired
          public OrderFunction(OrderDao orderDao)
          {
              this.orderDao=orderDao;
          }
  
      @Bean
      public Function&lt;String,Object&gt; getOrderByName()
      {
          return name-&gt; {
              System.out.println(&quot;Hello Benz&quot;);
              return name;
          };
      }
  
      @Override
      public void initialize(GenericApplicationContext context) {
          context.registerBean(&quot;getOrderByName&quot;, FunctionRegistration.class,
                  () -&gt; new FunctionRegistration&lt;Function&lt;String,Object&gt;&gt;(getOrderByName())
                          .type(FunctionType.from(String.class).to(Object.class).getType()));
      }
  }
  </code></pre>
  <p><strong>handler package</strong></p>
  <pre><code>public class OrderHandler extends SpringBootRequestHandler&lt;String,Object&gt; {
  
  }
  </code></pre>
  <p><strong>pom.xml</strong></p>
  <pre><code>&lt;dependencies&gt;
  
   &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-function-adapter-aws&lt;/artifactId&gt;
              &lt;version&gt;3.0.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  &lt;dependency&gt;
              &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
              &lt;artifactId&gt;aws-lambda-java-events&lt;/artifactId&gt;
              &lt;version&gt;3.8.0&lt;/version&gt;
          &lt;/dependency&gt;
  
       &lt;dependency&gt;
                  &lt;groupId&gt;com.amazonaws&lt;/groupId&gt;
                  &lt;artifactId&gt;aws-lambda-java-core&lt;/artifactId&gt;
                  &lt;version&gt;1.2.1&lt;/version&gt;
              &lt;/dependency&gt;
      
      &lt;/dependencies&gt;
      
      &lt;build&gt;
              &lt;plugins&gt;
      
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;skip&gt;true&lt;/skip&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
      
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
      
                      &lt;dependencies&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;org.springframework.boot.experimental&lt;/groupId&gt;
                              &lt;artifactId&gt;spring-boot-thin-layout&lt;/artifactId&gt;
                              &lt;version&gt;${wrapper.version}&lt;/version&gt;
                          &lt;/dependency&gt;
                      &lt;/dependencies&gt;
      
                      &lt;configuration&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;
                                  &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
                                  &lt;artifactId&gt;lombok&lt;/artifactId&gt;
                              &lt;/exclude&gt;
                          &lt;/excludes&gt;
                          &lt;finalName&gt;
                              boot-lambda
                          &lt;/finalName&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
      
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.2.4&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;createDependencyReducedPom&gt;
                              false
                          &lt;/createDependencyReducedPom&gt;
                          &lt;shadedArtifactAttached&gt;
                              true
                          &lt;/shadedArtifactAttached&gt;
                          &lt;shadedClassifierName&gt;
                              aws
                          &lt;/shadedClassifierName&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
      
              &lt;/plugins&gt;
          &lt;/build&gt;
  </code></pre>
  <p><strong>in AWS</strong></p>
  <p><a href="https://i.stack.imgur.com/mYL0J.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mYL0J.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/yi2qg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yi2qg.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/m41PB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m41PB.jpg" alt="enter image description here" /></a></p>
  <p>I have tried to debug it many ways but didn't work. If there any simple ways to do the above things without extending <code>SpringBootRequestHandler</code> class</p>