对于这种类型的程序设计我还是很陌生。实际上,这是我使用该Spring设置的第一个Java项目。对于我的可在Postman和h2控制台上在本地提供良好结果的Web应用程序,我创建了一个jarfile。现在,执行此jar文件以及控制台捕获的其他有问题的消息:
Cannot enhance @Configuration bean definition
'org.axonframework.springboot.autoconfig.EventProcessingAutoConfiguration'
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'.
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
@Configuration
@EnableWebSocketMessageBroker
public class WebsocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config){
config.enableSimpleBroker("/topic");
//config.setApplicationDestinationPrefixes("/app");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws")
.setAllowedOrigins("*");
}
}
我使用此注释的唯一类是上面的Web socket Config类。 但是我看不到“静态”如何解决这个问题,更不用说了。 我已经在整个互联网上寻找了这个特定问题,并观看了有关Spring bean定义的教程。我仍然不确定我是否可以在这里确定问题。如果您需要我班上的更多代码,请告诉我。