我是Spring和Vaadin的新手.我正在尝试浏览视图导航教程.
我想将来启用@Push来定期更新从数据库获取的数据.
该项目非常非常简单.我不使用配置类,也不使用任何XML - 仅Java注释.
任何人都可以帮我修复示例代码吗?因为我收到了警告,我不知道可以用它做什么,忽略它们的结果是什么.
第一个是:
onClassPostProcessor : Cannot enhance @Configuration bean definition 'com.vaadin.spring.VaadinConfiguration' since its singleton instance has been created too early.
The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type:
Consider declaring such methods as 'static'.
另一个是我添加compile("com.vaadin:vaadin-push")依赖时:
o.a.util.IOUtils : More than one Servlet Mapping defined.
WebSocket may not work org.apache.catalina.core.ApplicationServletRegistration
AppMain
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AppMain {
public static void main(String[] args) {
SpringApplication.run(AppMain.class, args);
} …Run Code Online (Sandbox Code Playgroud) 使用时启动我的应用程序时一切正常Intellij.但当我fatJar(使用gradle插件:) eu.appsatori.fatjar并执行时:
java -jar myapp.jar
Run Code Online (Sandbox Code Playgroud)
我得到这样的东西:
11:41:01.224 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [my.testing.MyAppMain]; nested exception is java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:482)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184)
...
Run Code Online (Sandbox Code Playgroud)
看起来它没有找到自动配置类META-INF/spring.factories.
如何添加此文件?它的内容应该是什么?
我有以下构建脚本:
apply plugin: "java";
apply plugin: "idea";
apply plugin: 'application'
apply plugin: 'eu.appsatori.fatjar'
apply plugin: 'org.springframework.boot'
repositories { …Run Code Online (Sandbox Code Playgroud)