[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17544664#comment-17544664 ] ASF subversion and git services commented on GEODE-10312: - Commit 62f8dbce3848a8feb14021fe992a5d5f1fd3fb82 in geode's branch refs/heads/support/1.15 from Patrick Johnson [ https://gitbox.apache.org/repos/asf?p=geode.git;h=62f8dbce38 ] GEODE-10312: Fix the v1/v3 mismatch. (#7720) * Remove SpringBootApplication annotation from swagger APIs. * Change v1 to v3 in swagger api-docs URLs. (cherry picked from commit eedbe293d4b96839ea192c88c479c3e92de52ef8) > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Assignee: Patrick Johnsn >Priority: Major > Labels: blocks-1.15.0, pull-request-available > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccess
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17544663#comment-17544663 ] ASF subversion and git services commented on GEODE-10312: - Commit eedbe293d4b96839ea192c88c479c3e92de52ef8 in geode's branch refs/heads/develop from Patrick Johnson [ https://gitbox.apache.org/repos/asf?p=geode.git;h=eedbe293d4 ] GEODE-10312: Fix the v1/v3 mismatch. (#7720) * Remove SpringBootApplication annotation from swagger APIs. * Change v1 to v3 in swagger api-docs URLs. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Assignee: Patrick Johnsn >Priority: Major > Labels: blocks-1.15.0, pull-request-available > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > at > org.springframework.beans.factory.support.Constructo
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17542246#comment-17542246 ] Patrick Johnsn commented on GEODE-10312: The ` springdoc.api-docs.path` property should allow the api-docs URL to be changed, but is being ignored. I just discovered that this works in previous versions of springdoc, so downgrading from 1.6.x to 1.5.x fixes the issue and everything works. I'm going to submit a bug against the project and see if we can get this fixed. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Assignee: Patrick Johnsn >Priority: Major > Labels: blocks-1.15.0, pull-request-available > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > at > org.springframework.beans.factory.support.ConstructorResolver.createArgument
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17542109#comment-17542109 ] Patrick Johnsn commented on GEODE-10312: That is my concern, but I'm not sure. Most URLs are unchanged, including all the endpoints I could find mentioned in the docs. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Assignee: Patrick Johnsn >Priority: Major > Labels: blocks-1.15.0, pull-request-available > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > at > org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) > at > org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:541) > at > org.springframework
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17541884#comment-17541884 ] Juan Ramos commented on GEODE-10312: {quote}If changing the URL is permissible, then I think this is done, if not, I will work on finding a way to configure it correctly. {quote} I don't think this is permissible as it implies breaking backward compatibility, doesn't it?. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Assignee: Patrick Johnsn >Priority: Major > Labels: blocks-1.15.0, pull-request-available > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > at > org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) > at > org.springframework.beans.factory.support.ConstructorR
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17541755#comment-17541755 ] Patrick Johnsn commented on GEODE-10312: I think I may be close. I've removed @SpringBootApplication and the swagger endpoints seem to be working. The only issue is that I've had to change `v1/api-docs` to `v3/api-docs` in the URLs, which is the new default for springdoc/AOS3.0. I thought this should be configurable with the `springdoc.swagger-ui.configUrl` property, but it's seemingly ignored. If changing the URL is permissible, then I think this is done, if not, I will work on finding a way to configure it correctly. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Assignee: Patrick Johnsn >Priority: Major > Labels: blocks-1.15.0, pull-request-available > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.l
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17541628#comment-17541628 ] Patrick Johnsn commented on GEODE-10312: I'm still having trouble getting Springdoc working correctly without boot/autoconfiguration. It should be possible, but none of the documentation or samples talk about doing it without boot. Apparently, the library was designed to integrate with spring boot specifically. I have made some progress: I've gotten swagger UI to start without boot for geode-web-api at least, but not at the correct URL (v3/v1). This should be configurable, but the properties seem to be ignored. This at least gives me a starting point to figure out what's missing without boot. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Assignee: Patrick Johnsn >Priority: Major > Labels: blocks-1.15.0 > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538218#comment-17538218 ] Juan Ramos commented on GEODE-10312: Another side effect of the change is that the automatically generated {{swagger}} docs are not "sorted" anymore. Not a deal breaker, sure, but it might cause headaches for customers interacting with the REST API using clients automatically generated (through the {{swagger-codegen-cli}} as an example). I've done some local tests and adding the configuration property [writer-with-order-by-keys|https://springdoc.org/index.html#springdoc-openapi-core-properties], both to [geode-web-api/src/main/resources/swagger.properties|https://github.com/apache/geode/blob/develop/geode-web-api/src/main/resources/swagger.properties] and [geode-web-management/src/main/resources/swagger-management.properties|https://github.com/apache/geode/blob/develop/geode-web-management/src/main/resources/swagger-management.properties], seems to fix this. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Priority: Major > Labels: blocks-1.15.0 > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource'
[jira] [Commented] (GEODE-10312) Remove SpringBootApplication In SwaggerConfig
[ https://issues.apache.org/jira/browse/GEODE-10312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538208#comment-17538208 ] Juan Ramos commented on GEODE-10312: Another side effect of the change is that the automatically generated {{swagger}} docs are not "sorted" anymore. Not a deal breaker, sure, but it might cause headaches for customers interacting with the REST API using clients automatically generated (through the {{swagger-codegen-cli}} as an example). I've done some local tests and adding the configuration property [writer-with-order-by-keys|https://springdoc.org/index.html#springdoc-openapi-core-properties], both to [geode-web-api/src/main/resources/swagger.properties|https://github.com/apache/geode/blob/develop/geode-web-api/src/main/resources/swagger.properties] and [geode-web-management/src/main/resources/swagger-management.properties|https://github.com/apache/geode/blob/develop/geode-web-management/src/main/resources/swagger-management.properties], seems to fix this. > Remove SpringBootApplication In SwaggerConfig > - > > Key: GEODE-10312 > URL: https://issues.apache.org/jira/browse/GEODE-10312 > Project: Geode > Issue Type: Bug > Components: locator, rest (admin), rest (dev) >Affects Versions: 1.15.0 >Reporter: Juan Ramos >Priority: Major > Labels: blocks-1.15.0 > Attachments: GEODE-10312.zip > > > The issue was introduced by GEODE-10282. As part of commit > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4], > {{SwaggerConfig}} classes used to start and configure the internal > {{geode-web-management}} and {{geode-web-api}} services use the > {{@SpringBootApplication}} annotation. This annotation automatically enables > other spring annotations (like {{@EnableAutoConfiguration}} and > {{@ComponentScan}}) which, in turn, might cause critical issues during > startup as {{spring}} tries to automatically configure several services based > on classes and interfaces found within the member's class path. > --- > I'm attaching a small scenario that reproduces the problem; the > {{reproduce.sh}} script simply starts a locator making sure that the > {{spring-jdbc-5.3.20.jar}} is part of the class path. When using any commit > after > [41305de1405c2125142e6b337c3f1704f736fca4|https://github.com/apache/geode/commit/41305de1405c2125142e6b337c3f1704f736fca4] > the logs will contain the following: > {noformat} > [info 2022/05/16 15:54:38.997 IST locator0 tid=0x1] Adding webapp > /management > [info 2022/05/16 15:54:39.610 IST locator0 tid=0x1] Initializing > Servlet 'management' > [info 2022/05/16 15:54:42.124 IST locator0 tid=0x1] Will secure any > request with > [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33ed6546, > > org.springframework.security.web.context.SecurityContextPersistenceFilter@5a503cf0, > org.springframework.security.web.header.HeaderWriterFilter@5b04224a, > org.springframework.security.web.authentication.logout.LogoutFilter@17db90a7, > org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6f78c132, > > org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@42f9b425, > > org.springframework.security.web.authentication.AnonymousAuthenticationFilter@54d62c35, > org.springframework.security.web.session.SessionManagementFilter@78907a46, > org.springframework.security.web.access.ExceptionTranslationFilter@eaf3dd0, > org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7cd6b76a] > [warn 2022/05/16 15:54:42.975 IST locator0 tid=0x1] Exception > encountered during context initialization - cancelling refresh attempt: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource' parameter 0; > nested exception is org.springframework.beans.factory.BeanCreationException: > Error creating bean with name > 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': > Invocation of init method failed; nested exception is > java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException > [error 2022/05/16 15:54:42.980 IST locator0 tid=0x1] Context > initialization failed > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'dataSource' defined in class path resource > [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: > Unsatisfied dependency expressed through method 'dataSource'