Open alvuberui opened 12 months ago
I was not above to reproduce the error given your explanation. Please provide a working sample (i.e., small project that reproduces the issue, push it to github so we can tale a look)
For privacy reasons of the code, I cannot upload an example to a public repository. I will try to explain it in more detail in case it is of any further assistance.
In my case, I do not directly use Spring Boot; instead, I use a library created by me that extends Spring Boot. This means that in my main class, I do not use the @SpringBootApplication annotation, but rather I use @MyLibraryApplication. Not including the @SpringBootApplication annotation causes the error I mentioned.
However, the @MyLibraryApplication annotation does not include anything more than what the @SpringBootApplication includes. I do not understand why the error occurs for that reason.
Example of a normal main class of a spring boot project: ` @SpringBootApplication public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}`
Example of my main class with my own library: ` @MyLibraryApplication public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}`
Code of my library annotation: ` @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @SpringBootApplication public @interface MyLibraryApplication{
}`
As you can see, even when using my library, it is still a Spring Boot application without adding anything additional. However, just because of the absence of the @SpringBootApplication annotation, it no longer works.
Describe the bug I am making a serverless application with gcp-adapter. In the main class of my application instead of using @SpringBootApplication I am using a custom tag that extends @SpringBootApplication (below you can see the code). The problem is that with my tag the application launches but when testing my function it returns error 500, with exactly the same code but using the @SpringBootApplication tag it does work correctly.
Sample I give you the code of my main class: ` @CustomTagExample public class Application {
} `
And the code of @CustomTagExample is the following: ` @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @SpringBootApplication public @interface CustomTagExample {
} `
Error Here I show you the error: