java.lang.StackOverflowError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I have an infinite loop error in SmbSession class when i use the "list" method with path ".\MYFOLDER\" : java.lang.StackOverflowError: null at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:396) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402) ~[spring-integration-smb-1.0.0-20121226.jar:na] ... The inifite loop is in this method : {code}  private SmbFile createSmbFileObject(String _path, Boolean _isDirectory) throws IOException { String path = StringUtils.cleanPath(_path); if (!StringUtils.hasText(path)) { return smbShare; } SmbFile smbFile = new SmbFile(smbShare, path); boolean appendFileSeparator = !path.endsWith(FILE_SEPARATOR); if (appendFileSeparator) { try { appendFileSeparator = smbFile.isDirectory() || (_isDirectory != null && _isDirectory); } catch (Exception _ex) { appendFileSeparator = false; } } if (appendFileSeparator) { smbFile = createSmbFileObject(path + FILE_SEPARATOR); } if (logger.isDebugEnabled()) { logger.debug("Created new " + SmbFile.class.getName() + "[" + smbFile + "] for path [" + path + "]."); } return smbFile; } {code}  After cleaning path, the boolean variable "appendFileSeparator" is always true because the "path" variable ends with '/' and FILE_SEPARATOR is '\'. A possible solution is to use the variable "_path" instead of "path" in this code : {code}boolean appendFileSeparator = !path.endsWith(FILE_SEPARATOR);{code} Thanks.
    via by Fares Hassak,
  • I have an infinite loop error in SmbSession class when i use the "list" method with path ".\MYFOLDER\" : java.lang.StackOverflowError: null at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:396) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414) ~[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402) ~[spring-integration-smb-1.0.0-20121226.jar:na] ... The inifite loop is in this method : {code}  private SmbFile createSmbFileObject(String _path, Boolean _isDirectory) throws IOException { String path = StringUtils.cleanPath(_path); if (!StringUtils.hasText(path)) { return smbShare; } SmbFile smbFile = new SmbFile(smbShare, path); boolean appendFileSeparator = !path.endsWith(FILE_SEPARATOR); if (appendFileSeparator) { try { appendFileSeparator = smbFile.isDirectory() || (_isDirectory != null && _isDirectory); } catch (Exception _ex) { appendFileSeparator = false; } } if (appendFileSeparator) { smbFile = createSmbFileObject(path + FILE_SEPARATOR); } if (logger.isDebugEnabled()) { logger.debug("Created new " + SmbFile.class.getName() + "[" + smbFile + "] for path [" + path + "]."); } return smbFile; } {code}  After cleaning path, the boolean variable "appendFileSeparator" is always true because the "path" variable ends with '/' and FILE_SEPARATOR is '\'. A possible solution is to use the variable "_path" instead of "path" in this code : {code}boolean appendFileSeparator = !path.endsWith(FILE_SEPARATOR);{code} Thanks.
    via by Fares Hassak,
    • java.lang.StackOverflowError: null at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:396)[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414)[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402)[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414)[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402)[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:414)[spring-integration-smb-1.0.0-20121226.jar:na] at org.springframework.integration.smb.session.SmbSession.createSmbFileObject(SmbSession.java:402)[spring-integration-smb-1.0.0-20121226.jar:na]
    No Bugmate found.