[ http://issues.apache.org/struts/browse/STR-1125?page=all ]
Don Brown reopened STR-1125:
----------------------------
Assign To: (was: Struts Developer Mailing List)
> PropertyMessageResources should load resourcs via
> Thread.currentThread().getContextClassLoader().getResourceAsStream() or
> ServletContext.getResourceAsStream()
> --------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: STR-1125
> URL: http://issues.apache.org/struts/browse/STR-1125
> Project: Struts Action 1
> Type: Improvement
> Components: Action
> Versions: 1.0.2
> Environment: Operating System: other
> Platform: All
> Reporter: Mark Griffith
> Priority: Minor
> Fix For: 1.1 Family
>
> Imagine an EAR with 3 web-apps.
> Each web-app has specific ApplicationResources.properties in WEB-INF/classes
> Rather than put struts.jar (and all corresponding jar's) in WEB-INF/lib, you
> put them in the EAR's manifest classpath.
> Imagine that the EAR has hierarchical classloaders so that EAR/manifest
> Classloader is parent of each individual webapp classloader. This way you
> can
> reload the web-app's classes without reloading the entire EAR.
> So a call initiates to a webapp with a struts action, this to the servlet
> ends
> up in PropertyMessageResources trying to load these resources via:
> is = this.getClass().getClassLoader().getResourceAsStream(name);
> and you end up with the error:
> javax.servlet.jsp.JspException: Missing message for key title.MedRec
> at org.apache.struts.taglib.bean.MessageTag.doStartTag()I
> (MessageTag.java:298)
> at jsp_servlet.__start._jspService
> (Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;
> )V(__start.java:273)
> at weblogic.servlet.jsp.JspBase.service
> (Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V
> (JspBase.java:33)
> at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> ()Ljava.lang.Object;(ServletStubImpl.java:1047)
> The problem is that since PropertyMessageResources lives in the parent
> classloader it can't "see" the child webapp classloader. However if:
> PropertyMessageResources loaded esourcs via Thread.currentThread
> ().getContextClassLoader().getResourceAsStream() it would get be able to
> resolve fine.
> The work around is to copy struts and all its jars to each webapp/WEB-INF/lib
> but this makes one feel dirty and unclean.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]