Spring Boot 注入错误:com.vaadin.flow.plugin.maven.PrepareFrontendMojo

bnl4lu3b  于 2023-10-16  发布在  Spring
关注(0)|答案(2)|浏览(118)

我尝试从github克隆这个项目来实现web推送通知。此项目使用vaadin发送通知link for github project我使用的是IntelliJ 2023版本。我已经成功地实现了密钥,但运行mvn clean install后,我得到以下日志

Error injecting: com.vaadin.flow.plugin.maven.PrepareFrontendMojo
java.lang.TypeNotPresentException: Type com.vaadin.flow.plugin.maven.PrepareFrontendMojo not present
    at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:147)     
    at org.eclipse.sisu.space.NamedClass.load (NamedClass.java:46)
    at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:86)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:67)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:62)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)      
    at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)      
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)    
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:491)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:114)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)  
Caused by: java.lang.UnsupportedClassVersionError: com/vaadin/flow/plugin/maven/Pre
pareFrontendMojo has been compiled by a more recent version of the Java Runtime (cl
ass file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142)    
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:473)
    at java.net.URLClassLoader.access$100 (URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged (Native Method)
    at java.net.URLClassLoader.findClass (URLClassLoader.java:362)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.findClassInternal (ClassRealm.java:313)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf (ClassRealm.java:432)
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:42)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
    at org.eclipse.sisu.space.URLClassSpace.loadClass (URLClassSpace.java:139)     
    at org.eclipse.sisu.space.NamedClass.load (NamedClass.java:46)
    at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:86)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:67)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:62)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)      
    at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)      
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)    
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:491)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:114)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)  
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------    
[INFO] Total time:  4.946 s
[INFO] Finished at: 2023-10-05T13:53:58+05:30
[INFO] ------------------------------------------------------------------------    
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:24.0.0.beta4:prepare-
frontend (default) on project webpush: Execution default of goal com.vaadin:vaadin-
maven-plugin:24.0.0.beta4:prepare-frontend failed: Unable to load the mojo 'prepare
-frontend' in the plugin 'com.vaadin:vaadin-maven-plugin:24.0.0.beta4' due to an AP
I incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLook
upException: com/vaadin/flow/plugin/maven/PrepareFrontendMojo has been compiled by 
a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.vaadin:vaadin-maven-plugin:24.0.0.beta4
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy      
[ERROR] urls[0] = file:/C:/Users/sukri/.m2/repository/com/vaadin/vaadin-maven-plugin/24.0.0.beta4/vaadin-maven-plugin-24.0.0.beta4.jar
[ERROR] urls[1] = file:/C:/Users/sukri/.m2/repository/com/vaadin/flow-maven-plugin/24.0.0.beta4/flow-maven-plugin-24.0.0.beta4.jar
[ERROR] urls[2] = file:/C:/Users/sukri/.m2/repository/com/vaadin/flow-plugin-base/24.0.0.beta4/flow-plugin-base-24.0.0.beta4.jar
[ERROR] urls[3] = file:/C:/Users/sukri/.m2/repository/com/vaadin/flow-server/24.0.0.beta4/flow-server-24.0.0.beta4.jar
[ERROR] urls[4] = file:/C:/Users/sukri/.m2/repository/com/vaadin/flow-push/24.0.0.beta4/flow-push-24.0.0.beta4.jar
[ERROR] urls[5] = file:/C:/Users/sukri/.m2/repository/com/vaadin/external/atmosphere/atmosphere-runtime/3.0.0.slf4jvaadin2/atmosphere-runtime-3.0.0.slf4jvaadin2.jar  
[ERROR] urls[6] = file:/C:/Users/sukri/.m2/repository/jakarta/inject/jakarta.inject-api/2.0.1/jakarta.inject-api-2.0.1.jar
[ERROR] urls[7] = file:/C:/Users/sukri/.m2/repository/com/vaadin/servletdetector/throw-if-servlet3/1.0.2/throw-if-servlet3-1.0.2.jar
[ERROR] urls[8] = file:/C:/Users/sukri/.m2/repository/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar
[ERROR] urls[9] = file:/C:/Users/sukri/.m2/repository/com/vaadin/external/gwt/gwt-elemental/2.8.2.vaadin2/gwt-elemental-2.8.2.vaadin2.jar
[ERROR] urls[10] = file:/C:/Users/sukri/.m2/repository/com/vaadin/flow-commons-upload/24.0.0.beta4/flow-commons-upload-24.0.0.beta4.jar
[ERROR] urls[11] = file:/C:/Users/sukri/.m2/repository/org/jsoup/jsoup/1.15.3/jsoup-1.15.3.jar
[ERROR] urls[12] = file:/C:/Users/sukri/.m2/repository/com/helger/ph-css/6.5.0/ph-css-6.5.0.jar
[ERROR] urls[13] = file:/C:/Users/sukri/.m2/repository/com/helger/commons/ph-commons/10.1.6/ph-commons-10.1.6.jar
[ERROR] urls[14] = file:/C:/Users/sukri/.m2/repository/net/bytebuddy/byte-buddy/1.12.22/byte-buddy-1.12.22.jar
[ERROR] urls[15] = file:/C:/Users/sukri/.m2/repository/com/vaadin/external/gentyref/1.2.0.vaadin1/gentyref-1.2.0.vaadin1.jar
[ERROR] urls[16] = file:/C:/Users/sukri/.m2/repository/commons-codec/commons-codec/1.15/commons-codec-1.15.jar
[ERROR] urls[17] = file:/C:/Users/sukri/.m2/repository/com/vaadin/license-checker/1.12.0/license-checker-1.12.0.jar
[ERROR] urls[18] = file:/C:/Users/sukri/.m2/repository/com/github/oshi/oshi-core/6.4.0/oshi-core-6.4.0.jar
[ERROR] urls[19] = file:/C:/Users/sukri/.m2/repository/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
[ERROR] urls[20] = file:/C:/Users/sukri/.m2/repository/net/java/dev/jna/jna-platform/5.12.1/jna-platform-5.12.1.jar
[ERROR] urls[21] = file:/C:/Users/sukri/.m2/repository/com/nimbusds/nimbus-jose-jwt/9.23/nimbus-jose-jwt-9.23.jar
[ERROR] urls[22] = file:/C:/Users/sukri/.m2/repository/org/lucee/jcip-annotations/1.0.0/jcip-annotations-1.0.0.jar
[ERROR] urls[23] = file:/C:/Users/sukri/.m2/repository/com/vaadin/open/8.5.0/open-8.5.0.jar
[ERROR] urls[24] = file:/C:/Users/sukri/.m2/repository/org/reflections/reflections/0.10.2/reflections-0.10.2.jar
[ERROR] urls[25] = file:/C:/Users/sukri/.m2/repository/org/javassist/javassist/3.28.0-GA/javassist-3.28.0-GA.jar
[ERROR] urls[26] = file:/C:/Users/sukri/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
[ERROR] urls[27] = file:/C:/Users/sukri/.m2/repository/org/zeroturnaround/zt-exec/1.12/zt-exec-1.12.jar
[ERROR] urls[28] = file:/C:/Users/sukri/.m2/repository/com/google/gwt/gwt-elemental/2.9.0/gwt-elemental-2.9.0.jar
[ERROR] urls[29] = file:/C:/Users/sukri/.m2/repository/com/github/eirslett/frontend-plugin-core/1.12.1/frontend-plugin-core-1.12.1.jar
[ERROR] urls[30] = file:/C:/Users/sukri/.m2/repository/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar
[ERROR] urls[31] = file:/C:/Users/sukri/.m2/repository/org/apache/commons/commons-exec/1.3/commons-exec-1.3.jar
[ERROR] urls[32] = file:/C:/Users/sukri/.m2/repository/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
[ERROR] urls[33] = file:/C:/Users/sukri/.m2/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar
[ERROR] urls[34] = file:/C:/Users/sukri/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
[ERROR] urls[35] = file:/C:/Users/sukri/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[36] = file:/C:/Users/sukri/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.14.2/jackson-core-2.14.2.jar
[ERROR] urls[37] = file:/C:/Users/sukri/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.14.2/jackson-databind-2.14.2.jar
[ERROR] urls[38] = file:/C:/Users/sukri/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
[ERROR] urls[39] = file:/C:/Users/sukri/.m2/repository/org/apache/commons/commons-compress/1.22/commons-compress-1.22.jar
[ERROR] urls[40] = file:/C:/Users/sukri/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
[ERROR] urls[41] = file:/C:/Users/sukri/.m2/repository/com/vaadin/flow-polymer2lit/24.0.0.beta4/flow-polymer2lit-24.0.0.beta4.jar
[ERROR] urls[42] = file:/C:/Users/sukri/.m2/repository/org/apache/commons/commons-text/1.10.0/commons-text-1.10.0.jar
[ERROR] urls[43] = file:/C:/Users/sukri/.m2/repository/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
[ERROR] urls[44] = file:/C:/Users/sukri/.m2/repository/org/jboss/forge/roaster/roaster-api/2.28.0.Final/roaster-api-2.28.0.Final.jar
[ERROR] urls[45] = file:/C:/Users/sukri/.m2/repository/org/jboss/forge/roaster/roaster-jdt/2.28.0.Final/roaster-jdt-2.28.0.Final.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]      
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

在运行Application.java文件时,我将获得以下日志

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-10-05T13:59:50.540+05:30 ERROR 10492 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webPushService': Injection of autowired dependencies failed
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:487) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1398) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[spring-context-6.0.5.jar:6.0.5]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) ~[spring-context-6.0.5.jar:6.0.5]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.3.jar:3.0.3]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-3.0.3.jar:3.0.3]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-3.0.3.jar:3.0.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-3.0.3.jar:3.0.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1304) ~[spring-boot-3.0.3.jar:3.0.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1293) ~[spring-boot-3.0.3.jar:3.0.3]
    at org.vaadin.marcus.Application.main(Application.java:24) ~[classes/:na]
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:578) ~[na:na]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-3.0.3.jar:3.0.3]
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'BBRr0fhjce28znjRAeYZd2epA4qah18Zb-SrDvppgxFV56JAa_tuQBO55MRPq_Wc2YS-uyQBgsyJdsajHQiu-fU' in value "${BBRr0fhjce28znjRAeYZd2epA4qah18Zb-SrDvppgxFV56JAa_tuQBO55MRPq_Wc2YS-uyQBgsyJdsajHQiu-fU}"
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) ~[spring-core-6.0.5.jar:6.0.5]
    at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-6.0.5.jar:6.0.5]
    at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) ~[spring-core-6.0.5.jar:6.0.5]
    at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-6.0.5.jar:6.0.5]
    at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:191) ~[spring-context-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:920) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1346) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1325) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:709) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:692) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:133) ~[spring-beans-6.0.5.jar:6.0.5]
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:481) ~[spring-beans-6.0.5.jar:6.0.5]
    ... 20 common frames omitted

另一件事我有是,我用我的键值在这个代码块在WebPushService.java文件

@Value("${BBRr0fhjce28znjRAeYZd2epA4qah18Zb-SrDvppgxFV56JAa_tuQBO55MRPq_Wc2YS-uyQBgsyJdsajHQiu-fU}")
    private String publicKey;
    @Value("${GBlA_fQpQjPCAWVxqeNmY_cWGEJQ7-Vka8hyRBZJJXE}")
    private String privateKey;
    @Value("${http://localhost:8080}")

有什么办法可以解决这个问题吗?
我很抱歉张贴这么长的日志,因为我无法找出确切的错误在这里
我在网上看过解决方案,但没有一个解决方案能解决这个错误。

bjp0bcyl

bjp0bcyl1#

你正在尝试“注入”一个值,但不是通过一个变量-所以你得到的错误是告诉你,没有名为BBRr0...的变量。
使用适当的变量名,如app.push.pubkey
@Value("${app.push.pubkey}") private String publicKey
并将其与测试值一起添加到application.ymlapplication.properties中。
app.push.pubkey=BBRr0...
或者,如果你绝对需要,使用test-key作为后备,如果var丢失:
@Value("${app.push.pubkey:BBRr0...}") private String publicKey

2exbekwf

2exbekwf2#

maven错误是因为您正在使用Java 8运行构建,而使用的Vaadin版本至少需要Java 17

相关问题