Home » Eclipse Projects » Remote Application Platform (RAP) » Images in Tomcat
Images in Tomcat [message #138751] |
Tue, 30 June 2009 05:13  |
Eclipse User |
|
|
|
Hi,
Does anybody can explain me why I do not see any images in my deployed
application (on Tomcat) since my last update of RAP...
I have not changed the way the image is got:
public Image getImage(String name){
String path = "resources/images/"+name;
return
Graphics.getImage(path,NSFWWebApplication.class.getClassLoad er());
}
bin.includes = (...) src/resources/,\ (...)
All the images have disapeared, including images of RWT dialog (warning,
error, ...). So this let me think that the problem is not in my code.
Do I have to change something?
Thanks.
|
|
| |
Re: Images in Tomcat [message #139755 is a reply to message #139142] |
Wed, 08 July 2009 09:53   |
Eclipse User |
|
|
|
Hi Benjamin,
I do not see any errors related to the images.
Maybe a clue: to test the war export with the last version, I have checked
out the CVS version of RAP.
... and I have an error org.eclipse.rap.rwt about graphics package:
Package 'org.eclipse.rwt.graphics' does not exist in this
plug-in MANIFEST.MF /org.eclipse.rap.rwt/META-INF line 17 Plug-in Problem
I saw that Graphics class (inside this package) contains the getImage
method with seems to do not work correctly...
Does that help you to find my problem ?
Emmanuel
Benjamin Muskalla wrote:
> Hi Emmanuel,
> Emmanuel Marchal wrote:
>> Hi,
>> Does anybody can explain me why I do not see any images in my deployed
>> application (on Tomcat) since my last update of RAP...
>> I have not changed the way the image is got:
> We neither ;-)
>>
>> public Image getImage(String name){
>> String path = "resources/images/"+name;
>> return
>> Graphics.getImage(path,NSFWWebApplication.class.getClassLoad er());
>> }
>>
>> bin.includes = (...) src/resources/, (...)
>>
>> All the images have disapeared, including images of RWT dialog (warning,
>> error, ...). So this let me think that the problem is not in my code.
> You should check the error logs of your tomcat to see if the requests
> get rejected in any way. Maybe some server configuration problem.
> You could also check with FireBug or similar tools what happens to the
> requests.
> Just some ideas - don't have a clue what could be wrong here. But maybe
> we can find out :)
> Greets
> Ben
>> Thanks.
|
|
| | | | | | | | | | | |
Re: Images in Tomcat [message #495330 is a reply to message #138751] |
Wed, 04 November 2009 10:17   |
Eclipse User |
|
|
|
Hi Emmanuel,
do you have solved you problem? I have the same after upgrade from RAP
Target 1.2.0 to 1.2.1
The problem is: I cannot see the images, that must be loaded from bundle
resource, (the resources are all exported on pde build), icons and so
on. But the images, that are loaded from database blobs are displayed. I
cannot see any errors in logs!
Only what we have done: we have changed the target. If we go back to
1.2.0, we have no problems!
Any suggestions from RAP-Team?
Many Thanks in advance and best regards,
Nikolai
Emmanuel Marchal schrieb:
> Hi,
> Does anybody can explain me why I do not see any images in my deployed
> application (on Tomcat) since my last update of RAP...
> I have not changed the way the image is got:
>
> public Image getImage(String name){
> String path = "resources/images/"+name;
> return
> Graphics.getImage(path,NSFWWebApplication.class.getClassLoad er());
> }
>
> bin.includes = (...) src/resources/,\ (...)
>
> All the images have disapeared, including images of RWT dialog (warning,
> error, ...). So this let me think that the problem is not in my code.
>
> Do I have to change something?
>
> Thanks.
|
|
| | |
Re: Images in Tomcat [message #495598 is a reply to message #495549] |
Thu, 05 November 2009 08:11   |
Eclipse User |
|
|
|
Hi Ralf, thank you for replying!
Ralf Sternberg schrieb:
> Hi Nikolai,
>
>
> Regarding your original problem: did you make sure that the images are
> included in your build.properties?
yes, the folders are included in build.properties and I see they in
exported jars and I see the images in it. Btw, the build process except
the target path has been don't changed. If I go back to 1.2.0 target,
run pde build, make war package and deploy it on tomcat (undeploying
before the old wars and cleaning the work-direktory under
catalina/localhost) I can't see any problem...
> Do they show up when you start from Eclipse?
yes, with the same target (1.2.1), no problem
> Do you see theming images like the x in dialog titlebars?
Yes, I see x in dialogs.
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
I'm baffled
have you any suggestions?
The OS is linux, ubuntu 9.04, tomcat version 6.0.16, RAP target 1.2.1
Best regards,
Nikolai
|
|
|
Re: Images in Tomcat [message #495886 is a reply to message #495598] |
Fri, 06 November 2009 09:16   |
Eclipse User |
|
|
|
Hi Nikolai,
one thing you could you try is to use a simpler path in
Graphics.getImage( path, inputStream )
e.g. use the input stream's hashCode() instead of toString() - does that
change anything?
However I do not see how this problem could be caused by changing from
1.2.0 to 1.2.1. Just to make sure that your configuration is sane - what
does your list of bundles look like?
Could you also check if you can see images in the RAP demo, deployed as
described in the RAP help?
Ralf
Nikolai Raitsev wrote:
> Hi Ralf, thank you for replying!
>
> Ralf Sternberg schrieb:
>> Hi Nikolai,
>>
>>
>> Regarding your original problem: did you make sure that the images are
>> included in your build.properties?
>
> yes, the folders are included in build.properties and I see they in
> exported jars and I see the images in it. Btw, the build process except
> the target path has been don't changed. If I go back to 1.2.0 target,
> run pde build, make war package and deploy it on tomcat (undeploying
> before the old wars and cleaning the work-direktory under
> catalina/localhost) I can't see any problem...
>
>> Do they show up when you start from Eclipse?
>
> yes, with the same target (1.2.1), no problem
>
>> Do you see theming images like the x in dialog titlebars?
>
> Yes, I see x in dialogs.
>
> 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
>
>
>
> I'm baffled
>
> have you any suggestions?
>
> The OS is linux, ubuntu 9.04, tomcat version 6.0.16, RAP target 1.2.1
>
> Best regards,
>
> Nikolai
|
|
| | |
Re: Images in Tomcat [message #496193 is a reply to message #496096] |
Mon, 09 November 2009 05:32   |
Eclipse User |
|
|
|
Hi,
bug 294579 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=294579) submitted.
Best Regards,
Nikolai
Ralf Sternberg schrieb:
> Hi Nikolai,
>
> Nikolai Raitsev wrote:
>>> one thing you could you try is to use a simpler path in
>>> Graphics.getImage( path, inputStream )
>>> e.g. use the input stream's hashCode() instead of toString() - does that
>>> change anything?
>> yes! It solved the problem! So this is the length of the path, that was
>> "wrong". But in 1.2.0, this problem do not exist. Should I open an issue
>> for this "behavior" in 1.2.1?
>
> yes, please do so! Please also add your server OS version and an example
> path that fails, in case we can't reproduce it.
>
> Thanks, Ralf
|
|
|
Re: Images in Tomcat [message #501132 is a reply to message #496193] |
Tue, 01 December 2009 03:38  |
Eclipse User |
|
|
|
Originally posted by: m.schnelle.msit-solutions.com
Hello,
i have the same problem indeed in eclipse jetty.
I have an inputstream of the Image and using the
Image img = Graphics.getImage("image"+is.hashCode(),is);
preview.setImage(img);
But the image won't be showed.
If i'm writing the inputstream to the hd the image is ok.
The code works for weeks but since yesterday the image are broken.
Have anybody an advice?
best regards, Markus
Nikolai Raitsev schrieb:
> Hi,
>
> bug 294579 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=294579)
> submitted.
>
> Best Regards,
>
> Nikolai
>
> Ralf Sternberg schrieb:
>> Hi Nikolai,
>>
>> Nikolai Raitsev wrote:
>>>> one thing you could you try is to use a simpler path in
>>>> Graphics.getImage( path, inputStream )
>>>> e.g. use the input stream's hashCode() instead of toString() - does
>>>> that
>>>> change anything?
>>> yes! It solved the problem! So this is the length of the path, that was
>>> "wrong". But in 1.2.0, this problem do not exist. Should I open an issue
>>> for this "behavior" in 1.2.1?
>>
>> yes, please do so! Please also add your server OS version and an example
>> path that fails, in case we can't reproduce it.
>>
>> Thanks, Ralf
|
|
|
Goto Forum:
Current Time: Fri May 23 17:04:24 EDT 2025
Powered by FUDForum. Page generated in 0.07114 seconds
|