繁体   English   中英

java.util.NoSuchElementException

[英]java.util.NoSuchElementException

尝试执行我的代码时出现以下错误

--- Check the Segment.getVirtualSegmentId.  
--- Check the SQL statement.  
--- Cause: java.util.NoSuchElementException

(但是该方法确实存在,并且查询在SQL Developer中正确运行),重新部署tomcat可以达到目的,但是在一段时间后又没有更改代码中的任何内容,则抛出了上述错误。

引发错误的代码是

<select id="getVirtualSegmentId" resultClass="java.lang.String" >
  select max(substr(attr_value,instr(attr_value, '-')+1))
  from circ_inst inner join circ_attr_settings
     on circ_inst.circ_inst_id=circ_attr_settings.circ_inst_id and val_attr_inst_id=1045
  where REGEXP_LIKE (circ_attr_settings.attr_value, 'LAYER 2 SWITCH-[0-9]+$') or
      REGEXP_LIKE (circ_attr_settings.attr_value, 'IPANEMA-[0-9]+$') or
      REGEXP_LIKE (circ_attr_settings.attr_value, 'FIREWALL-[0-9]+$')
</select>

我可以通过从查询中删除“ + $”来避免异常。 谢谢大家的回应

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM