You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2006/02/25 23:45:51 UTC

DO NOT REPLY [Bug 38784] New: - LoadBundle basename property is not set

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38784>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38784

           Summary: LoadBundle basename property is not set
           Product: Struts
           Version: Nightly Build
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Shale
        AssignedTo: dev@struts.apache.org
        ReportedBy: hlubek@networkteam.com


If the utility class LoadBundle is used with Myfaces (1.1.1) the basename
property will not be setted before a call to LoadBundle.getMap() which causes a
IllegalStateException.

The problem might be in the ShalePropertyResolver code below, which gets called
during the initialization(!) of the managed bean, before the basename property
gets set:

----------------------------------------------
public Class getType(Object base, Object property)
...
else if (base instanceof LoadBundle) {
            LoadBundle lb = (LoadBundle) base;
            if ("map".equals(property)) {
                return Map.class;
            } else if (Beans.isDesignTime()) {
                return Object.class;
            } else {
                Object value = lb.getMap().get(property);  <--------
                if (value != null) {
                    return value.getClass();
                } else {
                    return null;
                }
            }

        }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38784] - LoadBundle basename property is not set

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38784>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38784


gvanmatre@comcast.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From gvanmatre@comcast.net  2006-03-13 02:01 -------
The custom logic in the ShalePropertyResolver flattened out the wrapped 
resource bundle so that accessing the LoadBundle as a managed bean would 
automatically invoke the getMap() method.  The logic was not excluding the 
handling of the basename property.


Fix will be in the 20060312 shale nightly builds.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38784] - LoadBundle basename property is not set

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38784>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38784





------- Additional Comments From craig.mcclanahan@sun.com  2006-03-09 02:08 -------
How is your LoadBundle instance actually getting configured?  The expectation of
the property resolver is that the LoadBundle instance will have been configured
already before it is referenced in an expression.  The easiest way to do that is
to make it a managed bean that includes initialization of the basename property
in the managed bean definition, as described in the javadocs.

http://struts.apache.org/struts-shale/shale-core/apidocs/org/apache/shale/util/LoadBundle.html


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38784] - LoadBundle basename property is not set

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38784>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38784





------- Additional Comments From hlubek@networkteam.com  2006-03-09 10:45 -------
It was exactly configured like the example in the Javadocs. I debugged the
application and installed a breakpoint at the line where the exception was
thrown. The stacktrace showed, that the bean was initialized lazily by myfaces.
The Problem is that the managed bean initialization calls the getType function
of the ShalePropertyResolver to resolve the type of the basename property.

Because the property is not named "map" and Beans.isDesignTime() is false, the
code in the ShalePropertyResolver (posted in my first description) tries to
resolve the type of the property from the map of the LoadBundle, which itself
complains about having a null basename :)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 38784] - LoadBundle basename property is not set

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38784>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38784





------- Additional Comments From hlubek@networkteam.com  2006-02-25 23:47 -------
I think in the case of a LoadBundle instance and something other than the map or
basename property, one could always return a type of "String"...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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