sjivan / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

Bad NPObject as private data! in oophm mode #443

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run a gwt-ext app in oophm hosted mode  
2.
3.

What is the expected output? What do you see instead?
expected is to navigating pages. nothing happens. In firebug console i get
an error "Bad NPObject as private data!"

What version of the product are you using? On what operating system?
Ubuntu 8.04, firefox 3.0.3, GiWT branch oophm 

Please provide any additional information below.

Original issue reported on code.google.com by gnuy...@gmail.com on 18 Oct 2008 at 9:00

Attachments:

GoogleCodeExporter commented 8 years ago
Please upload error message...

Original comment by mlim1...@gmail.com on 9 Nov 2008 at 8:43

GoogleCodeExporter commented 8 years ago
All the firefox error console show is:
"Bad NPObject as private data!"

The location where the error occurs is on line three of the following generated 
snippet:
__gwt_javaInvokes[0] =
2 function(thisObj, dispId) {
3 var result = __static(dispId, thisObj);
4 if (result[0]) {
5 throw result[1];
6 } else {
7 return result[1];
8 }
9 }

Firebug shows a number for dispId and nothing for thisObj. The stacktrace just
contains two '?()' entries.

Firefox loads the whole page, but as soon as the error occurs, the GWT Hosted 
mode
aborts the connection.

Original comment by florian....@gmail.com on 6 Dec 2008 at 11:46

GoogleCodeExporter commented 8 years ago
When trying to debug with firebug, I get out of memory errors on line 32 of the
following snipped. It seems to loop endlessly or something.
// wrapper to call JS methods, which we need both to be able to supply a
// different this for method lookup and to get the exception back
function __gwt_jsInvoke(thisObj, methodName) {
  try {
    var args = Array.prototype.slice.call(arguments, 2);
32    return [0, window[methodName].apply(thisObj, args)];
  } catch (e) {
    return [1, e];
  }
}

Here is a detailed backtrace just before getting the errors:
stack:
eval()
eval()
__gwt_doMa...JavaInvoke
__gwt_makeJavaInvoke
(?)()
__gwt_jsInvoke
gwtOnLoad
re
b()

=======================
eval():2
this = Window
hosted.html?gwt.hosted=127.0.0.1:9997&org_acoveo_infostars_web_logbook_Logbook
=======================
1 __gwt_javaInvokes[0] =
2 function(thisObj, dispId) {
3 var result = __static(dispId, thisObj);
4 if (result[0]) {
5 throw result[1];
6 } else {
7 return result[1];
8 }
9 }

=======================
eval() : 18
s = "__gwt_javaInvokes[0]=\n  function(thisObj,dispId) {\n
var result = __static(dispId, thisObj);\n if (result[0]) {\n
throw result[1];\n } else {\n
return result[1];\n }\n }\n"
=======================
// install eval wrapper on FF to avoid EvalError problem
15if (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) {
16 var __eval = window.eval;
17 window.eval = function(s) {
18 return __eval(s);
19 }
20}

=======================
__gwt_doMa...JavaInvoke:65
argCount = 0
argList = ""
i = ""
=======================
function __gwt_doMakeJavaInvoke(argCount) {
49 // IE6 won't eval() anonymous functions except as r-values
50 var argList = "";
51 for (var i = 0; i < argCount; i++) {
52 argList += ",p" + i;
53 }
54 var argListNoComma = argList.substring(1);
55
56 return eval(
57 "__gwt_javaInvokes[" + argCount + "] =\n" +
58 " function(thisObj, dispId" + argList + ") {\n" +
59 " var result = __static(dispId, thisObj" + argList + ");\n" +
60 " if (result[0]) {\n" +
61 " throw result[1];\n" +
62 " } else {\n" +
63 " return result[1];\n" +
64 " }\n" +
65 " }\n"
66 );
67}

=======================
__gwt_makeJavaInvoke:45
argCount = 0
=======================
43var __gwt_javaInvokes = [];
44function __gwt_makeJavaInvoke(argCount) {
45 return __gwt_javaInvokes[argCount] || __gwt_doMakeJavaInvoke(argCount);
46}

=======================
(?)() no line number
=======================
1 function () {
2 return $wnd.navigator.userAgent.toLowerCase();
3 }

=======================
__gwt_jsInvoke:37
methodName = "@com.extjs.gxt.ui.client.GXT::initInternal()"
thisObj = null
args = [ ]
=======================
// wrapper to call JS methods, which we need both to be able to supply a
33// different this for method lookup and to get the exception back
34function __gwt_jsInvoke(thisObj, methodName) {
35 try {
36 var args = Array.prototype.slice.call(arguments, 2);
37 return [0, window[methodName].apply(thisObj, args)];
38 } catch (e) {
39 return [1, e];
40 }
41}

=======================
gwtOnLoad: 167
$moduleName = org.acoveo.infostars.web.logbook.Logbook
=======================
function gwtOnLoad(errFn, modName, modBase){
138 $moduleName = modName;
139 $moduleBase = modBase;
140
141 /*
142 * NOTE: this presently sucks and is the only formulation I can find that 
will
143 * work across browsers. On a Windows box where both plugins are registered,
144 * FF will instantiate the (non-working) IE plugin. But plugins have problems
145 * that prevent making this easy.
146 *
147 * The IE plugin will throw an exception in FF if you try to resolve
148 * "pluginObject.connect" as a value. Thus the try/catch below.
149 *
150 * The FF plugin will actually do illegal crashy things in IE if you try to
151 * resolve "pluginEmbed.connect" as a value. Thus we have to try the IE
152 * plugin first.
153 *
154 * Both plugins need some work to make them truly safe. I have no idea what
155 * will happen in Safari.
156 */
157 var pluginFinders = [
158 findPluginXPCOM,
159 findPluginObject,
160 findPluginEmbed,
161 ];
162 var found = false;
163 for (var i = 0; i < pluginFinders.length; ++i) {
164 try {
165 var plugin = pluginFinders[i]();
166 if (plugin != null) {
167 if (plugin.connect($hosted, $moduleName, window)) {
168 found = true;
169 break;
170 } else {
171 if (errFn) {
172 errFn(modName);
173 } else {
174 alert("failed to connect to hosted mode server at " + $hosted);
175 }
176 }
177 }
178 } catch (e) {
179 }
180 }
181 if (!found) {
182 alert("No GWT plugin found");
183 }
184}

Original comment by florian....@gmail.com on 6 Dec 2008 at 12:20