vaadin -“无法调用“com.vaadin.flow.di.Lookup.lookup(java.lang.Class)”,因为“lookup”为null”

bxgwgixi  于 2023-08-02  发布在  Java
关注(0)|答案(1)|浏览(113)

我的vaadin v24项目在测试模式下运行良好。部署的WAR未在Tomcat上启动。
报告以下错误:

“无法调用'com.vaadin.flow.di.Lookup.lookup(java.lang.Class)',因为'lookup'为null”

我正在使用JPA实现登录安全性。我在网上没有找到任何关于这个问题的信息。
如何解决这个问题?
安全配置:

  1. @EnableWebSecurity
  2. @Configuration
  3. public class SecurityConfiguration extends VaadinWebSecurity {
  4. public static final String LOGOUT_URL = "/";
  5. @Bean
  6. public PasswordEncoder passwordEncoder() {
  7. return new BCryptPasswordEncoder();
  8. }
  9. @Override
  10. protected void configure(HttpSecurity http) throws Exception {
  11. http.authorizeHttpRequests()
  12. .requestMatchers("/images/*.png").permitAll();
  13. super.configure(http);
  14. setLoginView(http, LoginView.class, LOGOUT_URL);
  15. }
  16. }

字符串
应用类:

  1. @SpringBootApplication
  2. @EnableJpaRepositories("com.tools.dimcontrol.data.repository")
  3. @Theme(value = "dimcontrol")
  4. public class Application extends SpringBootServletInitializer implements AppShellConfigurator {
  5. public static void main(String[] args) {
  6. SpringApplication.run(Application.class, args);
  7. }
  8. @Override
  9. protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
  10. return application.sources(Application.class);
  11. }
  12. @Bean
  13. SqlDataSourceScriptDatabaseInitializer dataSourceScriptDatabaseInitializer(DataSource dataSource,
  14. SqlInitializationProperties properties, UserRepository repository) {
  15. // This bean ensures the database is only initialized when empty
  16. return new SqlDataSourceScriptDatabaseInitializer(dataSource, properties) {
  17. @Override
  18. public boolean initializeDatabase() {
  19. if (repository.count() == 0L) {
  20. return super.initializeDatabase();
  21. }
  22. return false;
  23. }
  24. };
  25. }
  26. }


POM:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <!-- Project from https://start.vaadin.com/project/d6e40e84-c292-43aa-a0a7-44ff9774bd1f -->
  6. <groupId>com.tools.dimcontrol</groupId>
  7. <artifactId>dimcontrol</artifactId>
  8. <name>dimcontrol</name>
  9. <version>1.0-SNAPSHOT</version>
  10. <packaging>war</packaging>
  11. <properties>
  12. <java.version>17</java.version>
  13. <vaadin.version>24.0.2</vaadin.version>
  14. <selenium.version>4.8.1</selenium.version>
  15. </properties>
  16. <parent>
  17. <groupId>org.springframework.boot</groupId>
  18. <artifactId>spring-boot-starter-parent</artifactId>
  19. <version>3.0.5</version>
  20. </parent>
  21. <repositories>
  22. <!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
  23. <!-- Main Maven repository -->
  24. <repository>
  25. <id>central</id>
  26. <url>https://repo.maven.apache.org/maven2</url>
  27. <snapshots>
  28. <enabled>false</enabled>
  29. </snapshots>
  30. </repository>
  31. <repository>
  32. <id>vaadin-prereleases</id>
  33. <url>
  34. https://maven.vaadin.com/vaadin-prereleases/
  35. </url>
  36. </repository>
  37. <!-- Repository used by many Vaadin add-ons -->
  38. <repository>
  39. <id>Vaadin Directory</id>
  40. <url>https://maven.vaadin.com/vaadin-addons</url>
  41. <snapshots>
  42. <enabled>false</enabled>
  43. </snapshots>
  44. </repository>
  45. </repositories>
  46. <pluginRepositories>
  47. <!-- The order of definitions matters. Explicitly defining central here to make sure it has the highest priority. -->
  48. <pluginRepository>
  49. <id>central</id>
  50. <url>https://repo.maven.apache.org/maven2</url>
  51. <snapshots>
  52. <enabled>false</enabled>
  53. </snapshots>
  54. </pluginRepository>
  55. <pluginRepository>
  56. <id>vaadin-prereleases</id>
  57. <url>
  58. https://maven.vaadin.com/vaadin-prereleases/
  59. </url>
  60. </pluginRepository>
  61. </pluginRepositories>
  62. <dependencyManagement>
  63. <dependencies>
  64. <dependency>
  65. <groupId>com.vaadin</groupId>
  66. <artifactId>vaadin-bom</artifactId>
  67. <version>${vaadin.version}</version>
  68. <type>pom</type>
  69. <scope>import</scope>
  70. </dependency>
  71. </dependencies>
  72. </dependencyManagement>
  73. <dependencies>
  74. <dependency>
  75. <groupId>com.vaadin</groupId>
  76. <!-- Replace artifactId with vaadin-core to use only free components -->
  77. <artifactId>vaadin</artifactId>
  78. </dependency>
  79. <dependency>
  80. <groupId>com.vaadin</groupId>
  81. <artifactId>vaadin-spring-boot-starter</artifactId>
  82. </dependency>
  83. <dependency>
  84. <groupId>org.parttio</groupId>
  85. <artifactId>line-awesome</artifactId>
  86. <version>1.1.0</version>
  87. </dependency>
  88. <dependency>
  89. <groupId>org.springframework.boot</groupId>
  90. <artifactId>spring-boot-starter-validation</artifactId>
  91. </dependency>
  92. <dependency>
  93. <groupId>org.springframework.boot</groupId>
  94. <artifactId>spring-boot-starter-data-jpa</artifactId>
  95. </dependency>
  96. <dependency>
  97. <groupId>org.springframework.boot</groupId>
  98. <artifactId>spring-boot-devtools</artifactId>
  99. <optional>true</optional>
  100. </dependency>
  101. <dependency>
  102. <groupId>org.springframework.boot</groupId>
  103. <artifactId>spring-boot-starter-test</artifactId>
  104. <scope>test</scope>
  105. </dependency>
  106. <dependency>
  107. <groupId>org.springframework.boot</groupId>
  108. <artifactId>spring-boot-starter-tomcat</artifactId>
  109. <scope>provided</scope>
  110. </dependency>
  111. <dependency>
  112. <groupId>com.vaadin</groupId>
  113. <artifactId>vaadin-testbench-junit5</artifactId>
  114. <scope>test</scope>
  115. </dependency>
  116. <dependency>
  117. <groupId>org.springframework.boot</groupId>
  118. <artifactId>spring-boot-starter-security</artifactId>
  119. </dependency>
  120. <dependency>
  121. <groupId>org.springframework.boot</groupId>
  122. <artifactId>spring-boot-starter-web</artifactId>
  123. </dependency>
  124. <dependency>
  125. <groupId>com.mysql</groupId>
  126. <artifactId>mysql-connector-j</artifactId>
  127. <!--<version>8.0.32</version>-->
  128. </dependency>
  129. <!-- <dependency>
  130. <groupId>org.springframework</groupId>
  131. <artifactId>spring-context-support</artifactId>
  132. <version>6.0.6</version>
  133. </dependency>-->
  134. <dependency>
  135. <groupId>org.springframework.boot</groupId>
  136. <artifactId>spring-boot-starter-mail</artifactId>
  137. <!--<version>3.0.5</version>-->
  138. </dependency>
  139. <dependency>
  140. <groupId>javax.mail</groupId>
  141. <artifactId>mail</artifactId>
  142. <version>1.4.7</version>
  143. </dependency>
  144. <dependency>
  145. <groupId>jakarta.mail</groupId>
  146. <artifactId>jakarta.mail-api</artifactId>
  147. <!--<version>2.1.1</version>-->
  148. </dependency>
  149. </dependencies>
  150. <build>
  151. <finalName>${project.artifactId}</finalName>
  152. <defaultGoal>spring-boot:run</defaultGoal>
  153. <plugins>
  154. <plugin>
  155. <groupId>org.springframework.boot</groupId>
  156. <artifactId>spring-boot-maven-plugin</artifactId>
  157. <!-- Clean build and startup time for Vaadin apps sometimes may exceed
  158. the default Spring Boot's 30sec timeout. -->
  159. <configuration>
  160. <jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5464</jvmArguments>
  161. <wait>500</wait>
  162. <maxAttempts>240</maxAttempts>
  163. </configuration>
  164. </plugin>
  165. <plugin>
  166. <groupId>com.vaadin</groupId>
  167. <artifactId>vaadin-maven-plugin</artifactId>
  168. <version>${vaadin.version}</version>
  169. <executions>
  170. <execution>
  171. <goals>
  172. <goal>prepare-frontend</goal>
  173. </goals>
  174. </execution>
  175. </executions>
  176. </plugin>
  177. </plugins>
  178. </build>
  179. <profiles>
  180. <profile>
  181. <!-- Production mode is activated using -Pproduction -->
  182. <id>production</id>
  183. <properties>
  184. <vaadin.productionMode>true</vaadin.productionMode>
  185. </properties>
  186. <dependencies>
  187. <!-- Exclude development dependencies from production -->
  188. <dependency>
  189. <groupId>com.vaadin</groupId>
  190. <artifactId>vaadin</artifactId>
  191. <exclusions>
  192. <exclusion>
  193. <groupId>com.vaadin</groupId>
  194. <artifactId>vaadin-dev-server</artifactId>
  195. </exclusion>
  196. </exclusions>
  197. </dependency>
  198. <dependency>
  199. <groupId>com.vaadin</groupId>
  200. <artifactId>vaadin-core</artifactId>
  201. <exclusions>
  202. <exclusion>
  203. <groupId>com.vaadin</groupId>
  204. <artifactId>vaadin-dev</artifactId>
  205. </exclusion>
  206. </exclusions>
  207. </dependency>
  208. </dependencies>
  209. <build>
  210. <plugins>
  211. <plugin>
  212. <groupId>com.vaadin</groupId>
  213. <artifactId>vaadin-maven-plugin</artifactId>
  214. <version>${vaadin.version}</version>
  215. <executions>
  216. <execution>
  217. <goals>
  218. <goal>build-frontend</goal>
  219. </goals>
  220. <phase>compile</phase>
  221. </execution>
  222. </executions>
  223. </plugin>
  224. </plugins>
  225. </build>
  226. </profile>
  227. <profile>
  228. <id>it</id>
  229. <build>
  230. <plugins>
  231. <plugin>
  232. <groupId>org.springframework.boot</groupId>
  233. <artifactId>spring-boot-maven-plugin</artifactId>
  234. <executions>
  235. <execution>
  236. <id>start-spring-boot</id>
  237. <phase>pre-integration-test</phase>
  238. <goals>
  239. <goal>start</goal>
  240. </goals>
  241. </execution>
  242. <execution>
  243. <id>stop-spring-boot</id>
  244. <phase>post-integration-test</phase>
  245. <goals>
  246. <goal>stop</goal>
  247. </goals>
  248. </execution>
  249. </executions>
  250. </plugin>
  251. <!-- Runs the integration tests (*IT) after the server is started -->
  252. <plugin>
  253. <groupId>org.apache.maven.plugins</groupId>
  254. <artifactId>maven-failsafe-plugin</artifactId>
  255. <executions>
  256. <execution>
  257. <goals>
  258. <goal>integration-test</goal>
  259. <goal>verify</goal>
  260. </goals>
  261. </execution>
  262. </executions>
  263. <configuration>
  264. <trimStackTrace>false</trimStackTrace>
  265. <enableAssertions>true</enableAssertions>
  266. </configuration>
  267. </plugin>
  268. </plugins>
  269. </build>
  270. </profile>
  271. </profiles>
  272. </project>


和Tomcat错误日志:

  1. ...
  2. org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  3. 30-Mar-2023 17:27:41.019 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [E:\webapps\dimcontrol.war]
  4. java.lang.IllegalStateException: Error starting child
  5. at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:686)
  6. at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
  7. at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:713)
  8. at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:975)
  9. at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1949)
  10. at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  11. at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  12. at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
  13. at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
  14. at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:776)
  15. at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
  16. at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1656)
  17. at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
  18. at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
  19. at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
  20. at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
  21. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:898)
  22. at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:846)
  23. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  24. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
  25. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
  26. at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  27. at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
  28. at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
  29. at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)
  30. at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:241)
  31. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  32. at org.apache.catalina.core.StandardService.startInternal(StandardService.java:428)
  33. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  34. at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:913)
  35. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  36. at org.apache.catalina.startup.Catalina.start(Catalina.java:795)
  37. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  38. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  39. at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  40. at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  41. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347)
  42. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
  43. Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dimcontrol]]
  44. at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
  45. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
  46. at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
  47. ... 37 more
  48. Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChains' parameter 0: Error creating bean with name 'VaadinSecurityFilterChainBean' defined in class path resource [com/tools/dimcontrol/security/SecurityConfiguration.class]: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'filterChain' threw exception with message: Cannot invoke "com.vaadin.flow.di.Lookup.lookup(java.lang.Class)" because "lookup" is null
  49. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:818)
  50. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:770)
  51. at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:133)
  52. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:482)
  53. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1416)
  54. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:597)
  55. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520)
  56. at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
  57. at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
  58. at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
  59. at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
  60. at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973)
  61. at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917)
  62. at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584)
  63. at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
  64. at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
  65. at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
  66. at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
  67. at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:174)
  68. at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:154)
  69. at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:96)
  70. at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
  71. at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4875)
  72. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  73. ... 38 more
  74. Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'VaadinSecurityFilterChainBean' defined in class path resource [com/tools/dimcontrol/security/SecurityConfiguration.class]: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'filterChain' threw exception with message: Cannot invoke "com.vaadin.flow.di.Lookup.lookup(java.lang.Class)" because "lookup" is null
  75. at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)
  76. at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:645)
  77. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1332)
  78. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1162)
  79. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560)
  80. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520)
  81. at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
  82. at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
  83. at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
  84. at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
  85. at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
  86. at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1633)
  87. at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1597)
  88. at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1488)
  89. at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1375)
  90. at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337)
  91. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:810)
  92. ... 61 more
  93. Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'filterChain' threw exception with message: Cannot invoke "com.vaadin.flow.di.Lookup.lookup(java.lang.Class)" because "lookup" is null
  94. at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171)
  95. at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
  96. ... 77 more
  97. Caused by: java.lang.NullPointerException: Cannot invoke "com.vaadin.flow.di.Lookup.lookup(java.lang.Class)" because "lookup" is null
  98. at com.vaadin.flow.router.internal.RouteUtil.resolve(RouteUtil.java:283)
  99. at com.vaadin.flow.router.internal.RouteUtil.getRoutePath(RouteUtil.java:110)
  100. at com.vaadin.flow.spring.security.VaadinWebSecurity.setLoginView(VaadinWebSecurity.java:426)
  101. at com.tools.dimcontrol.security.SecurityConfiguration.configure(SecurityConfiguration.java:39)
  102. at com.vaadin.flow.spring.security.VaadinWebSecurity.filterChain(VaadinWebSecurity.java:140)
  103. at com.tools.dimcontrol.security.SecurityConfiguration$$SpringCGLIB$$0.CGLIB$filterChain$3(<generated>)
  104. at com.tools.dimcontrol.security.SecurityConfiguration$$SpringCGLIB$$1.invoke(<generated>)
  105. at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:258)
  106. at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
  107. at com.tools.dimcontrol.security.SecurityConfiguration$$SpringCGLIB$$0.filterChain(<generated>)
  108. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  109. at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  110. at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  111. at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  112. at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:139)
  113. ... 78 more
  114. 30-Mar-2023 17:27:41.032 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\webapps\dimcontrol.war] has finished in [13,753] ms
  115. 30-Mar-2023 17:27:41.032 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [E:\webapps\docs]
  116. 30-Mar-2023 17:27:41.094 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\webapps\docs] has finished in [62] ms
  117. 30-Mar-2023 17:27:41.094 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [E:\webapps\examples]
  118. 30-Mar-2023 17:27:41.375 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\webapps\examples] has finished in [281] ms
  119. 30-Mar-2023 17:27:41.375 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [E:\webapps\host-manager]
  120. 30-Mar-2023 17:27:41.407 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\webapps\host-manager] has finished in [32] ms
  121. 30-Mar-2023 17:27:41.407 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [E:\webapps\manager]
  122. 30-Mar-2023 17:27:41.438 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\webapps\manager] has finished in [31] ms
  123. 30-Mar-2023 17:27:41.438 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [E:\webapps\ROOT]
  124. 30-Mar-2023 17:27:41.453 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [E:\webapps\ROOT] has finished in [15] ms
  125. 30-Mar-2023 17:27:41.453 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
  126. 30-Mar-2023 17:27:41.485 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [14287] milliseconds
  127. 30-Mar-2023 17:27:41.485 INFO [Thread-1] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
  128. 30-Mar-2023 17:27:41.485 INFO [Thread-1] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
  129. 30-Mar-2023 17:27:41.517 INFO [Thread-1] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
  130. 30-Mar-2023 17:27:41.533 INFO [Thread-1] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
  131. 30-Mar-2023 17:27:41.533 WARNING [Thread-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [dimcontrol] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
  132. 30-Mar-2023 17:27:41.533 WARNING [Thread-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [dimcontrol] appears to have started a thread named [mysql-cj-abandoned-connection-cleanup] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
  133. java.base@17.0.6/java.lang.Object.wait(Native Method)
  134. java.base@17.0.6/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
  135. com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:91)
  136. java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  137. java.base@17.0.6/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  138. java.base@17.0.6/java.lang.Thread.run(Thread.java:833)

3lxsmp7m

3lxsmp7m1#

我也犯了同样的错误。只需升级到Vaadin 24.1.1和Sping Boot 3.1.1就可以解决这个问题

相关问题