You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Joe Germuska <Jo...@Germuska.com> on 2006/05/11 20:18:53 UTC

[OT] reading resources from nested JARs (Re: [VOTE] Struts Action Framework v1.3.4 Quality)

At 10:50 AM -0700 5/11/06, Michael Jouravlev wrote:
>I think it is much cleaner to have DTDs and other default XML files in
>the JAR, but sometimes it might not work.
>
>The hosting that I use for the samples, uses Tomcat 4.x, which
>supposedly should support SRV 2.3 and therefore it should be able to
>pull DTDs from classpath. Yet, this does not work, I don't know
>exactly why. But if I put DTD files into lib directory and configure
>them in web.xml then everything works fine.

Do you deploy your webapps as WARs?  We often find ourselves bumping 
up against something when we need to read classpath resources from a 
JAR within another JAR; in fact, this is why we don't deploy webapps 
as WARs, and we've also had similar problems with the classworlds 
"uberjar" mechanism which makes JARs for standalone execution along a 
model similar to WARs.

Has anyone ever seen formal documentation of this issue?  We've 
always just worked around it.

>The bottom line, it is better to hide DTDs in the JAR, but in case it
>does not work a readily available HOW-TO should be provided.

Indeed.
-- 
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com    

"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed.  Try something new."
	-- Robert Moog

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: [OT] reading resources from nested JARs (Re: [VOTE] Struts Action Framework v1.3.4 Quality)

Posted by Craig McClanahan <cr...@apache.org>.
On 5/11/06, Joe Germuska <Jo...@germuska.com> wrote:
>
> At 10:50 AM -0700 5/11/06, Michael Jouravlev wrote:
> >I think it is much cleaner to have DTDs and other default XML files in
> >the JAR, but sometimes it might not work.
> >
> >The hosting that I use for the samples, uses Tomcat 4.x, which
> >supposedly should support SRV 2.3 and therefore it should be able to
> >pull DTDs from classpath. Yet, this does not work, I don't know
> >exactly why. But if I put DTD files into lib directory and configure
> >them in web.xml then everything works fine.
>
> Do you deploy your webapps as WARs?  We often find ourselves bumping
> up against something when we need to read classpath resources from a
> JAR within another JAR; in fact, this is why we don't deploy webapps
> as WARs, and we've also had similar problems with the classworlds
> "uberjar" mechanism which makes JARs for standalone execution along a
> model similar to WARs.
>
> Has anyone ever seen formal documentation of this issue?  We've
> always just worked around it.


The particular version of Tomcat used by this hosting provider is broken (
i.e. it has bugs) with reference to this issue -- it is supposed to work.
And I know from experience it works correctly on 5.0.x versions.

Craig


>The bottom line, it is better to hide DTDs in the JAR, but in case it
> >does not work a readily available HOW-TO should be provided.
>
> Indeed.
> --
> Joe Germuska
> Joe@Germuska.com * http://blog.germuska.com
>
> "You really can't burn anything out by trying something new, and
> even if you can burn it out, it can be fixed.  Try something new."
>         -- Robert Moog
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>