Java 扩展配置程序中的Spring Boot@Autowired null

Java 扩展配置程序中的Spring Boot@Autowired null,java,spring-boot,Java,Spring Boot,嗯。我知道这个问题在这里被问了很多次,但我很抱歉再次问,因为他们都不适合我。我试图做的是@Autowired my JpaRepository在Configurator扩展类中这里是我的代码,但我的连接为空。我搜索了internet,发现这超出了范围spring boot,我需要将webSocketConfigurator类注入spring boot?如果我错了,请纠正我?如果是,我怎么做 @Configurable public class webSocketConfigurator exte

嗯。我知道这个问题在这里被问了很多次,但我很抱歉再次问,因为他们都不适合我。我试图做的是@Autowired my JpaRepository在Configurator扩展类中这里是我的代码,但我的连接为空。我搜索了internet,发现这超出了范围spring boot,我需要将webSocketConfigurator类注入spring boot?如果我错了,请纠正我?如果是,我怎么做

@Configurable
public class webSocketConfigurator extends Configurator
{
    @Autowired
    ClientConnectionDao connections;

    @Override
    public void modifyHandshake(ServerEndpointConfig config, HandshakeRequest request, HandshakeResponse response)
    {
        super.modifyHandshake(config, request, response);

        config.getUserProperties().put("ClientSession", request.getHttpSession());
    }
 }


public interface ClientConnectionDao extends JpaRepository<ClientConnection, Long> {
    public ClientConnection findByport(String port);
  public List<ClientConnection> findBymyuserName(String myUserName);


}
@可配置
公共类webSocketConfigurator扩展了Configurator
{
@自动连线
客户端连接DAO连接;
@凌驾
public void modifyHandshake(ServerEndpointConfig配置、HandshakeRequest请求、HandshakeResponse响应)
{
super.modifyHandshake(配置、请求、响应);
config.getUserProperties().put(“ClientSession”,request.getHttpSession());
}
}
公共接口ClientConnectionDao扩展了JpaRepository{
公共客户端连接findByport(字符串端口);
公共列表findBymyuserName(字符串myUserName);
}

正确的注释是
@Configuration
,而不是
@Configurable
正确的注释是
@Configuration
,而不是
@Configurable

最初提供了您是如何定义ClientConnectionDao的?spring是如何在你的应用程序中初始化bean的,它是以xml、编程方式还是扫描注释的方式配置的?在应用程序中是否使用AspectJ?ClientConnectionDao是接口还是具体实现?@eg04lt3r在问题中添加了我的ClientConnectionDao还有其他问题吗?首先请提供您是如何定义ClientConnectionDao的?spring是如何在你的应用程序中初始化bean的,它是以xml、编程方式还是扫描注释的方式配置的?在应用程序中是否使用AspectJ?ClientConnectionDao是接口还是具体实现?@eg04lt3r在问题中添加了我的ClientConnectionDao还有其他问题吗?