Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Throws unexpected "Graphic is diposed" exception
Throws unexpected "Graphic is diposed" exception [message #988253] Thu, 29 November 2012 01:37 Go to next message
ocean xue is currently offline ocean xue
Messages: 105
Registered: November 2011
Senior Member
Project use WAR Product Configuration deploy to tomcat6, not fixed Throws unexpected "Graphic is diposed" exception
Re: Throws unexpected "Graphic is diposed" exception [message #988255 is a reply to message #988253] Thu, 29 November 2012 01:49 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1773
Registered: July 2009
Senior Member
Hi,
in order to help at least RAP version and the stack trace of the
exception is needed.
Best,
Ivan

On 11/29/2012 8:37 AM, ocean xue wrote:
> Project use WAR Product Configuration deploy to tomcat6, not fixed
> Throws unexpected "Graphic is diposed" exception

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Throws unexpected "Graphic is diposed" exception [message #988272 is a reply to message #988255] Thu, 29 November 2012 04:14 Go to previous messageGo to next message
ocean xue is currently offline ocean xue
Messages: 105
Registered: November 2011
Senior Member
RAP version: RAP2.0M1

exception reference attachment.

thanks a lot.
  • Attachment: stack.png
    (Size: 999.51KB, Downloaded 61 times)

[Updated on: Thu, 29 November 2012 04:17]

Report message to a moderator

Re: Throws unexpected "Graphic is diposed" exception [message #988443 is a reply to message #988272] Thu, 29 November 2012 17:00 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris Fairhall
Messages: 99
Registered: February 2011
Member
This can happen if the same image is used in two sessions and gets disposed in one of the sessions. Check you're creating new images for each session when setting the column header image.
Re: Throws unexpected "Graphic is diposed" exception [message #988460 is a reply to message #988443] Thu, 29 November 2012 19:29 Go to previous messageGo to next message
ocean xue is currently offline ocean xue
Messages: 105
Registered: November 2011
Senior Member
action and control icons is used the image tools class set

Snippet:
-------------------------------------------------------------
public class ImageUtil {
private static ImageRegistry registry = new ImageRegistry();

/**
* get image
*
* @param fileName file path
* @return
*/
public static Image getImage(String fileName) {
Image image = registry.get(fileName);
if (image == null) {
image = Activator.getImageDescriptor(fileName).createImage();
registry.put(fileName, Activator.getImageDescriptor(fileName));
}
return image;
}
}
Re: Throws unexpected "Graphic is diposed" exception [message #988492 is a reply to message #988460] Fri, 30 November 2012 03:52 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris Fairhall
Messages: 99
Registered: February 2011
Member
That's the problem. Your ImageRegistry is stored in a static variable, so it, and all the images inside it are shared between sessions.
Re: Throws unexpected "Graphic is diposed" exception [message #988517 is a reply to message #988492] Fri, 30 November 2012 05:41 Go to previous messageGo to next message
ocean xue is currently offline ocean xue
Messages: 105
Registered: November 2011
Senior Member
Modified create the image, but also Throws unexpected "Graphic is diposed" exception.
What other methods?

Snippet:
-------------------------------------------------------------
public class ImageUtil {

/**
* get image
*
* @param fileName
* @return
*/
public static Image getImage(String fileName) {
return Activator.getImageDescriptor(fileName).createImage();
}

/**
* get ImageDescriptor
*
* @param fileName
* @return
*/
public static ImageDescriptor getImageDescriptor(String fileName) {
return Activator.getImageDescriptor(fileName);
}
}

[Updated on: Thu, 06 December 2012 00:34]

Report message to a moderator

Re: Throws unexpected "Graphic is diposed" exception [message #989402 is a reply to message #988517] Thu, 06 December 2012 00:38 Go to previous message
ocean xue is currently offline ocean xue
Messages: 105
Registered: November 2011
Senior Member
Different client access.
This is what is the reason? What solutions?

thanks
Previous Topic:how to set the icon of rap action
Next Topic:Hide Empty Submenus
Goto Forum:
  


Current Time: Wed Jul 23 04:02:24 EDT 2014

Powered by FUDForum. Page generated in 0.13281 seconds