在露天内容的迁移过程中获得异常,打开的文件过多

时间:2017-09-27 14:27:02

标签: alfresco alfresco-share opencmis

我在将内容从一个露天存储库迁移到其他存储库时收到此错误。

我在实时生产服务器日志中收到此错误。

在迁移过程中,服务器也正在崩溃。

任何人都可以帮我解决这个问题,或者有任何建议可以避免这个问题。

任何帮助或意见将不胜感激。 在此先感谢。

我在下面写了代码片段

ContentStream contentStream = new ContentStreamImpl("content." + FilenameUtils.getExtension(fileName),
            BigInteger.valueOf(fileName.length()), new MimetypesFileTypeMap().getContentType(newfile), doc.getContentStream().getStream());

我有2个存储库,使用上面的代码我正在从源读取内容流并在目标存储库中创建新文件并添加内容流。但我没有找到任何方法来关闭内容流。

请在下面找到错误日志以获取更多详细信息。

java.net.SocketException:打开的文件过多         at java.net.PlainSocketImpl.socketAccept(Native Method)

1 个答案:

答案 0 :(得分:1)

如果您在客户端使用DotCMIS方法<script src="js/jquery-1.11.1.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/bootstrap-table.js"></script> <div class="row"> <div class="col-md-12"></div> <div class="col-md-4"> <?php $apage = array('id'=>'','name'=>'');?> <script> var page_0 = <?php echo json_encode($apage)?> </script> <h3><a data="page_0" class="model_form btn btn-sm btn-danger" href="#"><span class="glyphicon glyphicon-plus"></span> Add new record</a></h3> </div> </div> <div id="table-container"> <div class="row"> <div class="col-md-12"> <table id="table" class="table table-striped table-sortable table-condensed " cellspacing="0" width="100%" data-show-columns="true"> <tbody> <?php if(isset($result) && ($data_record) > 0) : $i=1; ?> <?php while ($users = mysqli_fetch_object($result)) { ?> <tr class="<?=$users->id?>_del"> <td> <?=$i;?> </td> <td> <?=$users->zonee;?> </td> <td> <?=$users->location;?> </td> <td> <?=$users->pop_type;?> </td> <td> <?=$users->switch_name;?> </td> <td> <?=$users->switch_ip;?> </td> <td> <?=$users->switch_make;?> </td> <td> <?=$users->switch_serial;?> </td> <td> <?=$users->switch_model;?> </td> <td> <a href="http://maps.google.com/?q=<?=$users->latitude;?>,<?=$users->longitude;?>" target=\ "_blank\"><i class="material-icons">&#xE0C8;</i></a></td> <script> var page_ <?php echo $users->id ?> = <?php echo json_encode($users);?> </script> <td><a data="<?php echo 'page_'.$users->id ?>" class="model_form btn btn-info btn-sm" href="#"> <span class="glyphicon glyphicon-pencil"></span></a> <a data="<?php echo $users->id ?>" title="Delete <?php echo $users->name;?>" class="tip delete_check btn btn-info btn-sm "><span class="glyphicon glyphicon-remove"></span> </a> <a data="<?php echo 'page_'.$users->id ?>" class="model_form btn btn-info btn-sm" href="#"> <span class="glyphicon glyphicon-view"></span></a> </td> </tr> <?php $i++; } ?> <?php else : echo '<tr><td colspan="8"><div align="center">-------No record found -----</div></td></tr>'; ?> <?php endif; ?> </tbody> </table> <?php if(isset($_SESSION['flash_msg'])) : $message = $_SESSION['flash_msg']; echo $error= '<div class="alert alert-success" role="alert"> <span class="glyphicon glyphicon-envelope"></span> <strong>'.$message.'</strong> </div>'; unset($_SESSION['flash_msg']); endif; ?> </div> </div> </div> <!-- Form modal --> <div id="form_modal" class="modal fade" tabindex="-1" role="dialog"> <div class="modal-dialog modal-md"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title"><i class="icon-paragraph-justify2"></i><span id="pop_title">ADD</span> POP INFORMATION</h4> </div> <!-- Form inside modal --> <form method="post" action="add_edit.php" id="cat_form"> <div class="modal-body with-padding"> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>zonee :</label> <input type="text" name="zonee" id="zonee" class="form-control required"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>location :</label> <input type="text" name="location" id="location" class="form-control required"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>pop_type :</label> <input type="text" name="pop_type" id="pop_type" class="form-control required number"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>switch_name:</label> <input type="text" name="switch_name" id="switch_name" class="form-control required number"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>switch_ip :</label> <input type="text" name="switch_ip" id="switch_ip" class="form-control required"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>switch_make :</label> <input type="text" name="switch_make" id="switch_make" class="form-control required"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>switch_serial :</label> <input type="text" name="switch_serial" id="switch_serial" class="form-control required"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>switch_model :</label> <input type="text" name="switch_model" id="switch_model" class="form-control required"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>Latitude:</label> <input type="text" name="latitude" id="latitude" class="form-control required"> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-12"> <label>Longitude:</label> <input type="text" name="longitude" id="longitude" class="form-control required"> </div> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-warning" data-dismiss="modal">Cancel</button> <span id="add"> <input type="hidden" name="id" value="" id="id"> <button type="submit" name="form_data" class="btn btn-primary">Submit</button> </span> </div> </form> </div> </div> </div>,请确保始终关闭流 - 即使您没有阅读它。否则,服务器的套接字保持打开状态。根据您的应用程序,客户端和/或服务器可能会耗尽套接字。

关闭流的方式如下:

GetContentStream