Skip to content

SipFactory初始化StackOverflowError异常 #23

@handsomestWei

Description

@handsomestWei

使用场景

配置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);
    } 
    ... ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions