Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 292944

Summary: Cannot create a gravatar image in RAP 1.3
Product: [RT] RAP Reporter: Ian Bull <irbull>
Component: JFaceAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 1.3 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Snippet to reproduce none

Description Ian Bull CLA 2009-10-21 15:02:19 EDT
I am trying to create an image from a gravatar image using RAP 1.3 M2.  The image object is successfully created, but the image does not appear.  The URL I'm using is:

http://www.gravatar.com/avatar/77e02a3c8c665155ad1acaac8c2742e0?d=404

If I change my target to RAP 1.2 it works. Also, I don't have any problems with images stored locally on my machine (file:/ URIs).

I'm running Linux if it matters.
Comment 1 Ivan Furnadjiev CLA 2009-10-22 07:01:18 EDT
Ian, can you provide a snippet to reproduce it?
Comment 2 Ivan Furnadjiev CLA 2009-10-23 05:11:36 EDT
Created attachment 150353 [details]
Snippet to reproduce

On Windows Vista this snippet throws exception:
org.eclipse.rwt.internal.resources.ResourceRegistrationException: Failed to register resource 'http://www.gravatar.com/avatar/77e02a3c8c665155ad1acaac8c2742e0?d=404'.
	at org.eclipse.rwt.internal.resources.ResourceManagerImpl.register(ResourceManagerImpl.java:239)
	at org.eclipse.rap.ui.internal.servlet.ResourceManagerFactory$ResourceManagerWrapper.register(ResourceManagerFactory.java:130)
	at org.eclipse.swt.internal.graphics.ResourceFactory.createImage(ResourceFactory.java:352)
	at org.eclipse.swt.internal.graphics.ResourceFactory.findImage(ResourceFactory.java:166)
	at org.eclipse.rwt.graphics.Graphics.getImage(Graphics.java:146)
	at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:124)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:222)
	at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:200)
	at rap.bugs.entrypoint.Bug292944Snippet.createContents(Bug292944Snippet.java:23)
	at rap.bugs.entrypoint.Bug292944Snippet.createUI(Bug292944Snippet.java:36)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:227)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:115)
	at java.lang.Thread.run(Thread.java:619)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:80)
Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
	at java.io.WinNTFileSystem.createFileExclusively(Native Method)
	at java.io.File.createNewFile(File.java:883)
	at org.eclipse.rwt.internal.resources.ResourceManagerImpl.createFile(ResourceManagerImpl.java:451)
	at org.eclipse.rwt.internal.resources.ResourceManagerImpl.doRegister(ResourceManagerImpl.java:430)
	at org.eclipse.rwt.internal.resources.ResourceManagerImpl.register(ResourceManagerImpl.java:235)
	... 14 more
Comment 3 Ivan Furnadjiev CLA 2009-10-23 05:27:28 EDT
Fixed by escaping the "?" character in ResourceManagerImpl#escapeFilename. On Windows Vista the attached snippet works. Ian, please reopen if the bug persist or you have a different scenario to reproduce it.