Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RWT Exception after Refresh of the current page(at org.eclipse.rwt.internal.lifecycle.FakeContextUtil$RequestInvocationHandler.invoke(FakeContextUtil.java:119))
RWT Exception after Refresh of the current page [message #909620] Fri, 07 September 2012 12:35 Go to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
I would like create a new RAP application without use of Perspectives/Views (Workbench)
Just a simple rwt application...
But I've got a problem with an internal exception from the RWT platform.

To explain the problem, I've created a new fake project with a minimum of resources (two classes).
Try it (if possible).

Here is the exception displayed in the console after each refresh of the only one page of this application:
I think that the problem comes from the ToolItems used by the ToolBar into the class "DefaultPage".
If you remove the ToolItems => Good Refresh of the current page (without exception)
If you let the ToolItems => Bad Refresh (an internal exception is displayed into the rwt console)

Note:
I've tried with an EntryPoint (to replace the Application.class) and launch this application like a RWT Application (I've got the same problem with the refresh)

2012-09-07 14:12:07.132:INFO:oejs.Server:jetty-8.1.3.v20120416
2012-09-07 14:12:07.195:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:65244
osgi> 2012-09-07 14:12:10.607:WARN:/:ERROR:  Exception while disposing shell: Shell {}
java.lang.UnsupportedOperationException
	at org.eclipse.rwt.internal.lifecycle.FakeContextUtil$RequestInvocationHandler.invoke(FakeContextUtil.java:119)
	at $Proxy2.getParameter(Unknown Source)
	at org.eclipse.rwt.internal.textsize.MeasurementOperator.requestContainsMeasurementResult(MeasurementOperator.java:154)
	at org.eclipse.rwt.internal.textsize.MeasurementOperator.addItemToMeasure(MeasurementOperator.java:87)
	at org.eclipse.rwt.internal.textsize.MeasurementUtil.addItemToMeasure(MeasurementUtil.java:65)
	at org.eclipse.rwt.internal.textsize.TextSizeUtil.addItemToMeasure(TextSizeUtil.java:147)
	at org.eclipse.rwt.internal.textsize.TextSizeUtil.determineTextSize(TextSizeUtil.java:98)
	at org.eclipse.rwt.internal.textsize.TextSizeUtil.stringExtent(TextSizeUtil.java:36)
	at org.eclipse.rwt.graphics.Graphics.stringExtent(Graphics.java:289)
	at org.eclipse.swt.widgets.ToolItem.getPreferredWidth(ToolItem.java:575)
	at org.eclipse.swt.widgets.ToolItem.getWidth(ToolItem.java:544)
	at org.eclipse.swt.widgets.ToolItem.getBounds(ToolItem.java:468)
	at org.eclipse.swt.widgets.ToolBar.layoutItems(ToolBar.java:380)
	at org.eclipse.swt.widgets.ToolBar.destroyItem(ToolBar.java:374)
	at org.eclipse.swt.widgets.ToolItem.releaseParent(ToolItem.java:755)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:792)
	at org.eclipse.swt.widgets.ToolBar.releaseChildren(ToolBar.java:349)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:788)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:788)
	at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
	at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1113)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:788)
	at org.eclipse.swt.widgets.Display.disposeShells(Display.java:723)
	at org.eclipse.swt.widgets.Display.release(Display.java:686)
	at org.eclipse.swt.graphics.Device.dispose(Device.java:287)
	at org.eclipse.rwt.internal.lifecycle.UIThread.processShutdown(UIThread.java:166)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:308)
	at java.lang.Thread.run(Unknown Source)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)


/* -------------------*/

Here is the code of my classes

package refreshpagebug;

import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import org.eclipse.ui.PlatformUI;



public final class Application
  implements IApplication {


  @Override public Object start(IApplicationContext context)
    throws Exception {

    final Display display = PlatformUI.createDisplay();
    final Shell shell = new Shell(display, SWT.APPLICATION_MODAL);

    shell.setLayout(new GridLayout());

    final DefaultPage defaultPage = new DefaultPage(shell, SWT.NONE);
    defaultPage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    shell.setMaximized(true);
    shell.open();

    return display;

  }


  @Override public void stop() {
    // nothing

  }

}


package refreshpagebug;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;


public final class DefaultPage
  extends Composite {

  
  public DefaultPage(Composite parent,
                     int style) {

    super(parent, style);
    initGUI();

  }

  
  private void initGUI() {

    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    setLayout(gridLayout);

    {

      this.label = new Label(this, SWT.NONE);
      this.label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
      this.label.setText("Hello World");

    }

    {

      this.toolBar = new ToolBar(this, SWT.FLAT | SWT.RIGHT);

      {

        this.loginItem = new ToolItem(this.toolBar, SWT.NONE);
        this.loginItem.setText("Login");

      }

      {

        this.logoutItem = new ToolItem(this.toolBar, SWT.NONE);
        this.logoutItem.setText("Logout");

      }

    }

  }


  private static final long serialVersionUID = -4953708325934782254L;

  /** A field. */
  private Label label;

  /** A field. */
  private ToolItem loginItem;

  /** A field. */
  private ToolItem logoutItem;

  /** A field. */
  private ToolBar toolBar;

}


Here is the content of my plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         id="refreshpagebug"
         point="org.eclipse.core.runtime.applications">
      <application
            cardinality="singleton-global"
            thread="main"
            visible="true">
         <run
               class="refreshpagebug.Application">
         </run>
      </application>
   </extension>
   <extension
         point="org.eclipse.rap.ui.branding">
      <branding
            id="refreshpagebug.branding"
            servletName="rwtBug">
      </branding>
   </extension>
</plugin>


And the content of my MANIFEST.MF

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: RefreshPageBug
Bundle-SymbolicName: RefreshPageBug;singleton:=true
Bundle-Version: 1.0.0.qualifier
Require-Bundle: org.eclipse.rap.ui
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: javax.servlet;version="2.4.0",
 javax.servlet.http;version="2.4.0"


Note:
My current config is:
Windows 7 64bits,
Java JRE 7,
Indigo 32bits For RAP & RCP Developers + Plugins like Window Builder Pro from Google (GUI Designer),
RAP Target 1.5.0-M7
Re: RWT Exception after Refresh of the current page [message #909625 is a reply to message #909620] Fri, 07 September 2012 12:45 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
I've found another topic with the same exception but not the same way to obtain it...
http://www.eclipse.org/forums/index.php/t/317704/

A problem with the resize (refresh => resize)?

[Updated on: Fri, 07 September 2012 12:46]

Report message to a moderator

Re: RWT Exception after Refresh of the current page [message #909685 is a reply to message #909625] Fri, 07 September 2012 15:20 Go to previous messageGo to next message
Francis Delsinnes is currently offline Francis Delsinnes
Messages: 49
Registered: November 2011
Member
Easy => SOOOOORRRRRRRYYY.

Adding of the following code into the start method:

while (!shell.isDisposed()) {

        if (!display.readAndDispatch()) {

          display.sleep();

        }

      }

      display.dispose();




like this:

public final class Application
  implements IApplication {

  /*
   * (non-Javadoc)
   * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
   */
  @Override public Object start(IApplicationContext context)
    throws Exception {

    final Display display = PlatformUI.createDisplay();

    if ((display != null) && !display.isDisposed()) {

      final Shell shell = new Shell(display, SWT.APPLICATION_MODAL);
      shell.setLayout(new GridLayout());

      final StartPanel startPanel = new StartPanel(shell, SWT.NONE);
      startPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

      shell.pack();
      shell.setMaximized(true);
      shell.open();

      while (!shell.isDisposed()) {

        if (!display.readAndDispatch()) {

          display.sleep();

        }

      }

      display.dispose();

    }

    return display;

  }

  /*
   * (non-Javadoc)
   * @see org.eclipse.equinox.app.IApplication#stop()
   */
  @Override public void stop() {
    // Do nothing

  }

}

Re: RWT Exception after Refresh of the current page [message #909695 is a reply to message #909620] Fri, 07 September 2012 15:47 Go to previous message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1816
Registered: July 2009
Senior Member
Hi Francis,
it seems that you are NOT running the RAP 1.5 release. This issue has
been fixed in 1.5RC1. See bug:
353053: FakeContextUtil doesn't support getProperty on Request proxy
https://bugs.eclipse.org/bugs/show_bug.cgi?id=353053
Best,
Ivan

On 9/7/2012 3:35 PM, Francis Delsinnes wrote:
> I would like create a new RAP application without use of
> Perspectives/Views (Workbench)
> Just a simple rwt application...
> But I've got a problem with an internal exception from the RWT platform.
>
> To explain the problem, I've created a new fake project with a minimum
> of resources (two classes).
> Try it (if possible).
>
> Here is the exception displayed in the console after each refresh of
> the only one page of this application:
> I think that the problem comes from the ToolItems used by the ToolBar
> into the class "DefaultPage".
> If you remove the ToolItems => Good Refresh of the current page
> (without exception)
> If you let the ToolItems => Bad Refresh (an internal exception is
> displayed into the rwt console)
>
> Note:
> I've tried with an EntryPoint (to replace the Application.class) and
> launch this application like a RWT Application (I've got the same
> problem with the refresh)
>
>
> 2012-09-07 14:12:07.132:INFO:oejs.Server:jetty-8.1.3.v20120416
> 2012-09-07 14:12:07.195:INFO:oejs.AbstractConnector:Started
> SelectChannelConnector@0.0.0.0:65244
> osgi> 2012-09-07 14:12:10.607:WARN:/:ERROR: Exception while disposing
> shell: Shell {}
> java.lang.UnsupportedOperationException
> at
> org.eclipse.rwt.internal.lifecycle.FakeContextUtil$RequestInvocationHandler.invoke(FakeContextUtil.java:119)
> at $Proxy2.getParameter(Unknown Source)
> at
> org.eclipse.rwt.internal.textsize.MeasurementOperator.requestContainsMeasurementResult(MeasurementOperator.java:154)
> at
> org.eclipse.rwt.internal.textsize.MeasurementOperator.addItemToMeasure(MeasurementOperator.java:87)
> at
> org.eclipse.rwt.internal.textsize.MeasurementUtil.addItemToMeasure(MeasurementUtil.java:65)
> at
> org.eclipse.rwt.internal.textsize.TextSizeUtil.addItemToMeasure(TextSizeUtil.java:147)
> at
> org.eclipse.rwt.internal.textsize.TextSizeUtil.determineTextSize(TextSizeUtil.java:98)
> at
> org.eclipse.rwt.internal.textsize.TextSizeUtil.stringExtent(TextSizeUtil.java:36)
> at org.eclipse.rwt.graphics.Graphics.stringExtent(Graphics.java:289)
> at
> org.eclipse.swt.widgets.ToolItem.getPreferredWidth(ToolItem.java:575)
> at org.eclipse.swt.widgets.ToolItem.getWidth(ToolItem.java:544)
> at org.eclipse.swt.widgets.ToolItem.getBounds(ToolItem.java:468)
> at org.eclipse.swt.widgets.ToolBar.layoutItems(ToolBar.java:380)
> at org.eclipse.swt.widgets.ToolBar.destroyItem(ToolBar.java:374)
> at org.eclipse.swt.widgets.ToolItem.releaseParent(ToolItem.java:755)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:792)
> at org.eclipse.swt.widgets.ToolBar.releaseChildren(ToolBar.java:349)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:788)
> at
> org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:788)
> at
> org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:830)
> at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1113)
> at org.eclipse.swt.widgets.Widget.dispose(Widget.java:788)
> at org.eclipse.swt.widgets.Display.disposeShells(Display.java:723)
> at org.eclipse.swt.widgets.Display.release(Display.java:686)
> at org.eclipse.swt.graphics.Device.dispose(Device.java:287)
> at
> org.eclipse.rwt.internal.lifecycle.UIThread.processShutdown(UIThread.java:166)
> at
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:308)
> at java.lang.Thread.run(Unknown Source)
> at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)
>
>
> /* -------------------*/
>
> Here is the code of my classes
>
>
> package refreshpagebug;
>
> import org.eclipse.equinox.app.IApplication;
> import org.eclipse.equinox.app.IApplicationContext;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> import org.eclipse.ui.PlatformUI;
>
>
>
> public final class Application
> implements IApplication {
>
>
> @Override public Object start(IApplicationContext context)
> throws Exception {
>
> final Display display = PlatformUI.createDisplay();
> final Shell shell = new Shell(display, SWT.APPLICATION_MODAL);
>
> shell.setLayout(new GridLayout());
>
> final DefaultPage defaultPage = new DefaultPage(shell, SWT.NONE);
> defaultPage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
> true));
>
> shell.setMaximized(true);
> shell.open();
>
> return display;
>
> }
>
>
> @Override public void stop() {
> // nothing
>
> }
>
> }
>
>
>
> package refreshpagebug;
>
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.GridData;
> import org.eclipse.swt.layout.GridLayout;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Label;
> import org.eclipse.swt.widgets.ToolBar;
> import org.eclipse.swt.widgets.ToolItem;
>
>
> public final class DefaultPage
> extends Composite {
>
>
> public DefaultPage(Composite parent,
> int style) {
>
> super(parent, style);
> initGUI();
>
> }
>
>
> private void initGUI() {
>
> GridLayout gridLayout = new GridLayout();
> gridLayout.numColumns = 2;
> setLayout(gridLayout);
>
> {
>
> this.label = new Label(this, SWT.NONE);
> this.label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
> false, 1, 1));
> this.label.setText("Hello World");
>
> }
>
> {
>
> this.toolBar = new ToolBar(this, SWT.FLAT | SWT.RIGHT);
>
> {
>
> this.loginItem = new ToolItem(this.toolBar, SWT.NONE);
> this.loginItem.setText("Login");
>
> }
>
> {
>
> this.logoutItem = new ToolItem(this.toolBar, SWT.NONE);
> this.logoutItem.setText("Logout");
>
> }
>
> }
>
> }
>
>
> private static final long serialVersionUID = -4953708325934782254L;
>
> /** A field. */
> private Label label;
>
> /** A field. */
> private ToolItem loginItem;
>
> /** A field. */
> private ToolItem logoutItem;
>
> /** A field. */
> private ToolBar toolBar;
>
> }
>
>
> Here is the content of my plugin.xml
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.4"?>
> <plugin>
> <extension
> id="refreshpagebug"
> point="org.eclipse.core.runtime.applications">
> <application
> cardinality="singleton-global"
> thread="main"
> visible="true">
> <run
> class="refreshpagebug.Application">
> </run>
> </application>
> </extension>
> <extension
> point="org.eclipse.rap.ui.branding">
> <branding
> id="refreshpagebug.branding"
> servletName="rwtBug">
> </branding>
> </extension>
> </plugin>
>
>
> And the content of my MANIFEST.MF
>
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: RefreshPageBug
> Bundle-SymbolicName: RefreshPageBug;singleton:=true
> Bundle-Version: 1.0.0.qualifier
> Require-Bundle: org.eclipse.rap.ui
> Bundle-ActivationPolicy: lazy
> Bundle-RequiredExecutionEnvironment: JavaSE-1.7
> Import-Package: javax.servlet;version="2.4.0",
> javax.servlet.http;version="2.4.0"
>
>
> Note:
> My current config is:
> Windows 7 64bits,
> Java JRE 7,
> Indigo 32bits For RAP & RCP Developers + Plugins like Window Builder
> Pro from Google (GUI Designer),
> RAP Target 1.5.0-M7

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Virtual tree viewer refresh bug
Next Topic:Setting Composite Background color
Goto Forum:
  


Current Time: Sat Sep 20 20:09:46 GMT 2014

Powered by FUDForum. Page generated in 0.01871 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software