0

我正在构建一个小的 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)

我的主要问题不是如何解决它,而是我该如何找出问题所在?

4

2 回答 2

1

我猜的问题是我没有将 org.json.* 包包含到我的应用程序中。它起作用的原因(以及为什么我认为它在本地工作没有任何问题)是因为 Wowza 加载插件的方式。另一个插件已经有了 JSON 包,但是服务器没有这个相同的插件。

我通过将 JSON 包包含到插件的构建路径中来修复它。

对我来说仍然很奇怪,但根本没有错误。

于 2013-11-19T16:03:55.643 回答
0

您是否尝试过远程调试?

于 2013-11-18T05:17:37.573 回答