有问题的“文件”实际上是一个 Ajax 调用。对于特定文件中的每个 ajax 调用,我们几乎都会遇到一个错误。我们过去常常打开固定装置,但从那以后就将它们移除了。
错误:
failed to open file file:/profile/getPolicy JavaException: java.io.FileNotFoundException: /profile/getPolicy (No such file or directory)
Exception in thread "Thread-2" org.mozilla.javascript.EcmaError: TypeError: Cannot call method "indexOf" of null (steal/rhino/env.js#24532)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3660)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3679)
at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3698)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2221)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2214)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3143)
at script(steal/rhino/env.js:24532)
at script(steal/rhino/env.js:2278)
at script.makeRequest(steal/rhino/env.js:24484)
at script(steal/rhino/env.js:2027)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
at org.mozilla.javascript.Synchronizer.call(Synchronizer.java:79)
at org.mozilla.javascript.tools.shell.Runner.run(Global.java:1162)
at org.mozilla.javascript.Context.call(Context.java:515)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
at org.mozilla.javascript.tools.shell.Runner.run(Global.java:1156)
at java.lang.Thread.run(Thread.java:662)
could not load script http://localhost:3000/socket.io/1/?t=1334594888337&jsonp=0
TypeError: Cannot find function 0.0.
!!!!!!!!!!! ERROR !!!!!!!!!!!
-message = Cannot find function 0.0.
-fileName = http://localhost:3000/socket.io/1/?t=1334594888337&jsonp=0
-name = TypeError
-lineNumber = 0
failed to open file file:/profile/getProfile JavaException: java.io.FileNotFoundException: /profile/getProfile (No such file or directory)
Exception in thread "Thread-4" org.mozilla.javascript.EcmaError: TypeError: Cannot call method "indexOf" of null (steal/rhino/env.js#24532)
如您所见,下一个错误与下一个 ajax 调用有关。我们的 ajax 调用并没有做任何奇怪的事情:
$.ajax({
url:"/profile/getProfile",
type:"get",
success:function(data){
try{
STATE.PROFILE = JSON.parse(data);
}catch(err){
STATE.PROFILE = data;
}
updateState();
}
});
有谁知道为什么我们在尝试构建时会遇到这些错误?此代码在浏览器中运行良好!