You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Topping <to...@digidemic.com> on 2002/07/08 23:49:26 UTC

MessageResources problem under JBoss 3.0

Hiyas,

I'm looking at a classloader problem with JBoss 3 and Struts 1.1B1.  It would
appear that this is the source of problems in loading properties files for
struts users on JBoss.

If there is anyone out there that is using JBoss 3, can you comment on your
ability to load or not load properties files correctly, for instance in
conjunction with ActionErrors?

My environment:

JBoss 3.0.1RC1_tomcat4.0.4 (same problem with JBoss 3 release)
W2KSP2
JDK 1.3.1_02
Struts 1.1B1

Standard deployment of Struts of course is to have a struts.jar in the deploy
dir, next to the app.war file for the actual application.  app.war has no
problem loading classes or resources out of the struts.jar file.  

I've dug into MessageResources.getMessage(), and it's getting a resource
stream with 'this.getClass().getClassLoader().getResourceAsStream(name)'.
The caller is a utility method inside struts.jar, not the app.jar.  Like I
said, the call works fine for properties files that are in the struts.jar,
but fails for properties that are in the app.war file.  

This is a major issue, since properties files that are listed in
<message-resources/> can't be loaded.  I presume that it works standalone
tomcat just fine, otherwise someone else would have noticed ;)

I'm suspecting incompatibility with JBoss Unified Class Loader -- I believe
different jars mean these are different classloaders, so
'this.getClassLoader()' gets the wrong classloader.  Either there is an
implementation problem with JBoss -- that the UCL isn't following the proper
semantics of getResource(), or Struts is pushing the edge of the semantics.  

Any thoughts on this?

*any* help appreciated...

best,

-b

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>