Spring boot 整合netty 无法通过autowired 注入redis

网上搜的方法也试过了但是也没用,请帮帮忙

@Component
@Slf4j
@ChannelHandler.Sharable
public class RemoteUpgradeHandler extends SimpleChannelInboundHandler {
public static RemoteUpgradeHandler remoteUpgradeHandler;

private static Map<String, Integer> sendBasiFile = new HashMap<>();
/**
 * 设备长时间不回应 用于记数给设备发送指令
 */
private static Map<String, Integer> sendNum = new HashMap<>();
ApplicationContext applicationContext=SpringUtil.getApplicationContext();
RedisUtil redis=applicationContext.getBean(RedisUtil.class);


@Autowired
private RedisUtil redis;

public RemoteUpgradeHandler(){}

@PostConstruct
public void init(){
    System.out.println("项目handler初始化");
    remoteUpgradeHandler=this;
    remoteUpgradeHandler.redis=this.redis;
}

RedisUtil redis=applicationContext.getBean(RedisUtil.class);

@Autowired
private RedisUtil redis;

这两种写法同时存在?不能注入有报错吗。