PQ49203: WHEN SERVLET USES GETRESOURCE AS STREAM IT CAN FIND A IMAGE FILEIN ITS CLASSPATH BUT NOT IF THE IMAGE ISPLACED IN JAR.


APAR

APAR status
Closed as user error.

Error description
A group of servlets a 2.1 compliant with WebSphere on NT & SUN
problems with Classloader.getResource() andClassloader.getResou
rceAsStream(). Specifically we see the following error:
If we have a resource, say MyPic.gif, we can successfully load
the image if the GIF is in our classpath directly, but not if
the GIF is locatedin a JAR file in our classpath.

Keywords: classloader servlet getResourceAsStream JAR
rceAsStream(). Specifically we see the following error:If we have a resource, say MyPic.gif, we can successfully loadthe image if the GIF is in our classpath directly, but not ifthe GIF is locatedin a JAR file in our classpath.Keywords: classloader servlet getResourceAsStream JAR
Local fix
Problem summary
Problem conclusion
Temporary fix
Comments
This is being closed as a usage error.  The application was
attempting to use the following:
String sFile="ibm.test.image.ibm.gif"
When this was changed to:attempting to use the following:String sFile="ibm.test.image.ibm.gif"
String sFile="ibm/test/image/ibm.gif" the image ibm.gif was able to be retrieved and displayed using getResourceAsStream(sFile). The ibm.gif image was in a jar file that was in the classpath of the WebApp A copy of the code can be found in wasdoc0\apars\pq49203.
When this was changed to:String sFile="ibm/test/image/ibm.gif"the image ibm.gif was able to be retrieved and displayed usinggetResourceAsStream(sFile). The ibm.gif image was in a jarfile that was in the classpath of the WebAppA copy of the code can be found in wasdoc0\apars\pq49203.
APAR information
APAR numberPQ49203
Reported component nameWAS ADVANCED SU
Reported component ID5648C8402
Reported release350
StatusCLOSED USE
PENoPE
HIPERNoHIPER
Submitted date2001-05-30
Closed date2001-07-11
Last modified date2001-07-11

APAR is sysrouted FROM one or more of the following:

APAR is sysrouted TO one or more of the following:APAR is sysrouted FROM one or more of the following:


Modules/Macros

Fix information
APAR is sysrouted TO one or more of the following:Modules/Macros

Applicable component levels











Document Information

Product categories: Software, Application Servers, Distributed Application & Web Servers, WebSphere Application Server, General
Software version: 350
Reference #: PQ49203
IBM Group: Software Group
Modified date: 2001-07-11