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

Bug 294579

Summary: Too long path length for images in RAP 1.2.1 can not dissolved under Tomcat 6.0.16
Product: [RT] RAP Reporter: Nikolai Raitsev <nikolai.raitsev>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: drpadawan
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Nikolai Raitsev CLA 2009-11-09 05:27:09 EST
See newsgroup http://www.eclipse.org/forums/index.php?t=tree&th=42686&S=236b40ba1a810fe7dd42c77414a80533#page_top from message #495598

After upgrade from 1.2.0 to 1.2.1 images with long path are not copied into the <tomcat installation>/work/Catalina/localhost/<app>/eclipse/workspace/.metadata/.plugins/org.eclipse.rap.ui/context


-----------

here is little peace of log and code:
first, code:

try
{
logger.debug("* * * * * getting image");
logger.debug("* * * * * loading resource as stream");
InputStream inputStream =
getClass().getResourceAsStream("/images/screenshot_jterms_600.png ");

logger.debug("* * * * * inputstream is " + inputStream + " and has " +
inputStream.available() + " bytes");

logger.debug("* * * * * getting image RAP.Graphics and InputStream");
Image image = Graphics.getImage("images/title" + inputStream.toString(),
inputStream); //$NON-NLS-1$
logger.debug("* * * * * image is " + image);

Label labelImage = getFormToolkit().createLabel(parent, "");

logger.debug("* * * * * setting image on label ");
labelImage.setImage(image);

}catch(Exception e){
logger.error("* * * * * some error on getting image and setting it on
label", e);
}

and log:

[UIThread DEBUG XXX.LoginView - * * * * * getting image
[UIThread DEBUG XXX.LoginView - * * * * * loading resource as stream
[UIThread DEBUG XXX.LoginView - * * * * * inputstream is
org.eclipse.osgi.baseadaptor.bundlefile.ZipBundleEntry$ZipBundleEntryInputStream@5b13ed
and has 149531 bytes
[UIThread DEBUG XXX.LoginView - * * * * * getting image RAP.Graphics
and InputStream
[UIThread DEBUG XXX.LoginView - * * * * * image is
org.eclipse.swt.graphics.Image@134accc
[UIThread DEBUG XXX.LoginView - * * * * * setting image on label


You can see, no error occured! Image gets from InputStream and is
setting to the Label!

But, I cannot find that image
(" titleorg.eclipse.osgi.baseadaptor.bundlefile.ZipBundleEntry$ZipBundleEntryInputStream@5b13ed")
file in
tomcat/current/work/Catalina/localhost/mynewapp/eclipse/work space/.metadata/.plugins/org.eclipse.rap.ui/context/images

-----------

Using inputStream.hashCode() instead inputStream.toString in Graphics.getImage solved the problem in 1.2.1, but its work with the same path length with inputStream.toString in 1.2.0
Comment 1 Ivan Furnadjiev CLA 2009-11-11 03:57:20 EST
I did some tests with a long (longer than 255 characters) paths on Windows Vista/JDK 1.6.0_17/Tomcat 6.0.18/RAP CVS HEAD and everything is working as expected - file from the example above is created and image is shown too. It seems that this problem is OS/JDK specific and how OS/JDK versions handle longer than 255 characters paths/filenames. I think that we can't do anything about it, just use shorter filenames (in the example above filename is 93 characters!!!). In 1.2.1 we escape some characters like '$' (see bug 280582), which in addition increases the path length.
Comment 2 RĂ¼diger Herrmann CLA 2009-11-11 16:36:54 EST
According to comment #1, this is a WONTFIX
Please re-open if you find the source of the problem lies within RAP.