[1.1] Error while executing the JavaScript provider for property 'user.agent'Error while executing the JavaScript provider for property 'user.agent'

826 views
Skip to first unread message

Gunnar Wagenknecht

unread,
Aug 11, 2006, 5:30:30 PM8/11/06
to Google Web Toolkit
Hi!

I'm getting the following error after updating to GWT 1.1 when
launching the GWT Browser in hosted mode. Any ideas what changed?

[DEBUG] Rebinding com.google.gwt.user.client.impl.DOMImpl
[DEBUG] Checking rule <replace-with
class='com.google.gwt.user.client.impl.DOMImplMozilla'/>
[ERROR] Error while executing the JavaScript provider for property
'user.agent'
java.lang.RuntimeException: Could not find a native method with the
signature 'prop$user.agent'
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:355)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeString(ModuleSpaceIE6.java:264)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:83)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getPropertyValue(ModuleSpacePropertyOracle.java:48)
at
com.google.gwt.dev.cfg.ConditionWhenPropertyIs.doEval(ConditionWhenPropertyIs.java:22)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:19)
at com.google.gwt.dev.cfg.ConditionAny.doEval(ConditionAny.java:19)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:19)
at com.google.gwt.dev.cfg.ConditionAll.doEval(ConditionAll.java:19)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:19)

Cu, Gunnar

br...@google.com

unread,
Aug 11, 2006, 5:51:12 PM8/11/06
to Google Web Toolkit
Hi Gunnar,

Are you using the -noserver option, by any chance?

The gwt.js startup script injects an IFRAME that points to
"<your-modue>.nocache.html" in both hosted mode and web mode. In 1.0.x,
hosted mode relied on a well-known gwt-hosted.html file which is no
longer necessary. In 1.1, GWTShellServlet generates a .nocache.html
file in hosted mode.

If you're running your own separate server in hosted mode (and using
-noserver), then you probably copied over gwt-hosted.html to that other
server. In 1.1, it should be simpler: you can just compile your module
once for web mode, copy the output directory to other web server, and
the .nocache.html file will be there.

If you're not using -noserver and the above explanation made no sense
at all, then try clearing your IE cache -- and please tell us which
thing it ended up being.

-- Bruce

Gunnar Wagenknecht

unread,
Aug 12, 2006, 8:37:19 AM8/12/06
to Google Web Toolkit
Yes, I am using the -noserver option to run on an external server. I'll
try your suggestions.

Thanks,
Gunnar

Gunnar Wagenknecht

unread,
Aug 12, 2006, 9:45:58 AM8/12/06
to Google Web Toolkit
Bruce,

It looks like the problem is solved. At least, the exception is gone.
But the result is different.

The HTML page body looks like this:
<body>
<script language="javascript" src="gwt.js"></script>
<div id="root">
<script type="text/javascript">
document.write("Loading...");
</script>
<noscript>This is a rich browser application which requires
JavaScript. Please activate JavaScript to view this content.</noscript>
</div>
<iframe id="__gwt_historyFrame"
style="width:0;height:0;border:0"></iframe>
</body>

In the module's entry point I have the following call to place my
widgets:
RootPanel.get("root").clear();
RootPanel.get("root").add(myDockPanel);

With 1.0.21 the "Loading..." message disappeared. However, with 1.1 it
stays on the top of the page. I'm not able to get rid of it. That
happens in both, compiled and hosted mode with -noserver option.

Cu, Gunnar

Vivian

unread,
Aug 13, 2006, 2:08:52 AM8/13/06
to Google Web Toolkit

Gunnar,
There has been a change to the way RootPanel.get() works (noted in
the release notes: "# RootPanel.get(String) should not be clearing the
div's contents.")

The clear() function does not clear the contents of the DIV, it only
clears Widgets from the DIV, so any HTML elements that were added by a
different method (static HTML, DOM manipulation, innerHTML, etc) will
not be cleared by clear().

If you want to clear the contents of the DIV, you can use the source
from 1.0.21's RootPanel() constructor, which I will reproduce below

public void clearDiv(String id)
{
Element elem = DOM.getElementById(id);
// copied from 1.0.21 RootPanel constructor
if(elem != null)
while (DOM.getChildCount(elem) > 0)
DOM.removeChild(elem, DOM.getChild(elem, 0));
}

-Vivian
GWT Team

Reply all
Reply to author
Forward
0 new messages