我正在构建一个小的 API,我将调用并接收有关目录的 JSON 数据。它在我运行的开发盒上完美运行,但是当我将它放在我需要它的服务器上时,它会通过应用程序的一部分并停止。
没有抛出异常,控制台输出不做任何事情,并且我没有收到来自我的 GET 请求到服务器的响应。插件就停止了。
这是一个在 Wowza 服务器上作为插件运行的 HTTPProvider,但我认为这无关紧要。服务器没有崩溃,我的插件在代码中的这一点之后没有做任何事情(每组注释都是我用控制台输出测试的地方,除了最后一个之外都有效):
File dir = new File(appInst.getStreamStoragePath()+"/"+content_path);
//Correct Path is formed and file object created
if(dir.exists() && dir.isDirectory())
{
//Directory exists
File[] files = dir.listFiles();
//Was able to find the 2 files in this directory
JSONObject output = new JSONObject();
JSONArray directories = new JSONArray();
JSONArray videos = new JSONArray();
boolean access_allowed = true;
//Nothing happens after these declarations, no errors
//No thrown exceptions or console output
for (int i = 0; i < files.length; i++) {
//Build JSON objects+arrays with files
}
}
dev box 和 server 都是相同版本的 java 和 wowza server。(1.6)
我的主要问题不是如何解决它,而是我该如何找出问题所在?