FastBee icon indicating copy to clipboard operation
FastBee copied to clipboard

SipFactory初始化StackOverflowError异常

Open handsomestWei opened this issue 1 year ago • 0 comments

使用场景

配置sip.enabled=true启用sip服务,media_server表重建清空数据。

异常日志

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sip.SipFactory]: Factory method 'createSipFactory' threw exception; nested exception is java.lang.StackOverflowError
at com.fastbee.sip.service.impl.MediaServerServiceImpl.selectMediaServerBytenantId(MediaServerServiceImpl.java:77)

问题代码

表数据为空时,出现死循环

public MediaServer selectMediaServerBytenantId(Long tenantId) {
    List<MediaServer> list = mediaServerMapper.selectMediaServerBytenantId(tenantId);
    if (list.size() == 0) {
        return selectMediaServerBytenantId(1L);
    } 
    ... ...
}

handsomestWei avatar Dec 26 '24 07:12 handsomestWei