-
Notifications
You must be signed in to change notification settings - Fork 560
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
No public method named handleRequest with appropriate method signature on SpringBootLambdaContainerHandler #770
Comments
Hi,
In your case the easiest fix is replacing |
I think I'm almost there. I'm getting this message now:
I've took a look on uploaded jar:
As you can see, FluxApplication in on jar file.
package me.jeusdi.slab.localstack.flux.presentation.frontoffice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
import me.jeusdi.slab.localstack.flux.application.document.pull.PullDocumentInputPort;
import me.jeusdi.slab.localstack.flux.application.document.push.PushDocumentInputPort;
import me.jeusdi.slab.localstack.flux.application.document.push.PushDocumentPersistenceGatewayOutputPort;
import me.jeusdi.slab.localstack.flux.application.document.pushed.PushedDocumentPersistenceGatewayOutputPort;
import me.jeusdi.slab.localstack.flux.domain.model.document.PullDocumentService;
import me.jeusdi.slab.localstack.flux.domain.model.document.PushDocumentService;
import me.jeusdi.slab.localstack.flux.domain.model.document.ResourceProvider;
import me.jeusdi.slab.localstack.flux.infrastructure.repository.ResourceMongoRespository;
@SpringBootApplication
@ComponentScan
@ComponentScan(basePackages = "me.jeusdi.slab.localstack.flux.domain.model.document", includeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = PullDocumentService.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = PushDocumentService.class),
})
@ComponentScan(basePackages = "me.jeusdi.slab.localstack.flux.application", includeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = PushDocumentInputPort.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = PullDocumentInputPort.class)
})
@ComponentScan(basePackages = "me.jeusdi.slab.localstack.flux.infrastructure", includeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = ResourceProvider.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = PushDocumentPersistenceGatewayOutputPort.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = PushedDocumentPersistenceGatewayOutputPort.class),
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = ResourceMongoRespository.class)
})
@EnableMongoRepositories(basePackages = "me.jeusdi.slab.localstack.flux.infrastructure")
public class FluxApplication {
public static void main(String[] args) {
SpringApplication.run(FluxApplication.class, args);
}
} In order to set with "main" to pick up for DelegateContainer, I've set service: espaidoc
provider:
name: aws
runtime: java17
stage: dev
region: us-east-1
versionFunctions: false
package:
artifact: ./target/frontoffice-0.0.1-SNAPSHOT.jar
plugins:
- serverless-localstack
custom:
localstack:
stages:
- dev
host: localstack.localhost
edgePort: 8000
endpointFile: .localstack/endpoints.json
functions:
api:
handler: com.amazonaws.serverless.proxy.spring.SpringDelegatingLambdaContainerHandler
environment:
MAIN_CLASS: FluxApplication
events:
- http:
method: POST
path: /documents Any ideas? |
Yeah it has to be a fully qualified class name including the package. So in your case: |
Thanks @deki . I was solved it using fully qualified class name. Another issue here: I'm getting:
Any suggestion here? EDIT I've also tested trying to invoke my function using serverless framework getting the same but more detailed logs. Here the output:
|
@olegz can you look into this one? |
I'm running into the exact same problem that @jeusdi is running into, i.e. |
see also #819 it seems to be webflux related. we'll take a look... |
I have not tested it with webflux, so at this point it is safe to say it is not supported. Not saying it can not be supported, but DispatcherServlet model is not really for webflux |
Also, based on your stack trace it appears you can't start the application at all. That is strange since it appears |
@olegz @deki I actually created a separate ticket last week for my issue, and it has my full stack trace: #828 |
@fabiencoppens I was on PTO and getting back to it now. Give me few days and I'll see what is going on |
@fabiencoppens @deki I just used your POM from the above comments and everything works as expected, so what am I missing?
And here is the full POM.xml which is pretty much a copy of what you have up above in the comments. In fact I am not seeing eny webflux there, so it puzzles me even more when you say you are using it
|
To help us debug your issue fill in the basic information below using the options provided
Serverless Java Container version:
2.0
Implementations:
Spring Boot
Framework version:
SpringBoot
Frontend service:
HTTP API
Deployment method:
Serverless Framework
Scenario
I'm trying to execute my lambda.
Expected behavior
Reach my exposed endpoints
Actual behavior
I'm getting:
Steps to reproduce
Here my
pom.xml
related tree dependencies:Full log output
Here my lambda output (`aws logs filter-log-events --log-group-name "/aws/lambda/espaidoc-dev-api")
I also put my entire
pom.xml
:Also, my
serverless.yml
:Any ideas?
The text was updated successfully, but these errors were encountered: