Bugs item #841136, was opened at 2003-11-12 21:29
Message generated for change (Comment added) made by geraldthewes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=841136&group_id=22866

Category: JBossWeb
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Elias Ross (genman)
Assigned to: Scott M Stark (starksm)
Summary: ResourceBundle classloader errors

Initial Comment:

Deployment information:

java version "1.4.2_02"
Java(TM) 2 Runtime Environment, 
   Standard Edition (build 1.4.2_02-b03)
Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)
JBoss 3.2.2 (release)
Linux Redhat 8

I cannot reproduce this problem when I use Java
1.4.1-01 Blackdown for Linux, though again it might be
a timing issue.

There is a resource bundle located in an exploded .war
file with a ResourceBundle at top-level:

xyz.war
  WEB-INF
     classes
        AppResources.properties

Struts 1.1 (periodically) cannot locate this bundle.

javax.servlet.jsp.JspException: Missing message for key
label.product.name
        at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:298)
        at Home_jsp._jspx_meth_bean_message_0(Home_jsp.java:170)
        at Home_jsp._jspService(Home_jsp.java:107)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

The weird part is that it found the bundle, but is
MISSING the key.  (We have seen this problem when
loading from other resource bundles.)


I constructed a test JSP  The JSP always works fine. 
It spits  out the key "label.product.name"

<%@ page contentType="text/plain" %>
<%@ page import="java.util.*"%>

<%
  ResourceBundle rb = null;
  for (int i = 0; i < 100; i++) {
    rb  = ResourceBundle.getBundle("AppResources",
Locale.getDefault());
    // rb = ResourceBundle.getBundle("AppResources");
  }
  Enumeration e = rb.getKeys();
  while (e.hasMoreElements())
    out.println(e.nextElement());
  out.println(rb.getString("label.product.name"));
%>



----------------------------------------------------------------------

Comment By: Gerald Hewes (geraldthewes)
Date: 2003-11-13 14:30

Message:
Logged In: YES 
user_id=908642

I originally reported the problem to genman, I
tried the suggestion of setting

<attribute name="UseJBossWebLoader">false</att
ribute>

And that solved all the problems as far as I can tell
for now. The property files (loaded as resources)
I had indeed existed (with different content) in different
WAR and EAR deployments.



----------------------------------------------------------------------

Comment By: Elias Ross (genman)
Date: 2003-11-13 00:32

Message:
Logged In: YES 
user_id=556458


This same property file appears in a .jar in a (scoped) .ear
file.  Actually, the property files that we're having
trouble with appear in scoped .ear files.

I tried disabling the UCL, just to see what would happen
before I filed this bug.  I end up with this exception instead:

java.lang.ClassCastException
        at
org.apache.struts.tiles.TilesRequestProcessor.initDefinitionsMapping(TilesRequestProcessor.java:126)
        at
org.apache.struts.tiles.TilesRequestProcessor.init(TilesRequestProcessor.java:116)
        at
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:872)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

The source code looks like this:

  protected void initDefinitionsMapping() throws
ServletException
    {
      // Retrieve and set factory for this modules
    definitionsFactory =
((TilesUtilStrutsImpl)TilesUtil.getTilesUtil()).getDefinitionsFactory(getServletContext(),
moduleConfig);

I don't know if Struts is messed up under JBoss with this
sort of configuration, but doing a quick google search
turned up some junk on some mailing lists.

I am wondering how a resource bundle could be found, but
have no entries in it...

We haven't had any trouble with our Solaris installations so
far.  Since the problem is erratic, I wonder if somehow the
directory ordering has had some effect.


----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2003-11-12 22:04

Message:
Logged In: YES 
user_id=175228

Are there multiple AppResources.properties deployed? If so
then it is probably related to the use of the UCL in the web
container. You can disable this by editing the 
jbossweb-tomcat41.sar/META-INF/jboss-service.xml and setting
the UseJBossWebLoader attribute to false:

<attribute name="UseJBossWebLoader">false</attribute>

----------------------------------------------------------------------

Comment By: Elias Ross (genman)
Date: 2003-11-12 21:49

Message:
Logged In: YES 
user_id=556458

More info:

Doesn't happen with JBoss 3.2.1.

If you visit another web context, such as /jmx-console or
another .war file deployed on the system, the resource
bundle gets picked up correctly.

I also said it depended on JVM, but changing the JVM doesn't
seem to fix this errant behavior.

Struts 1.1 is deployed under WEB-INF/lib.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=841136&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to