[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-726) Log interpolation throws exception when toString() uses braces
by Luke Maurer (JIRA)
Log interpolation throws exception when toString() uses braces
--------------------------------------------------------------
Key: JBSEAM-726
URL: http://jira.jboss.com/jira/browse/JBSEAM-726
Project: JBoss Seam
Issue Type: Bug
Affects Versions: 1.1.1.GA
Reporter: Luke Maurer
For example, if you write:
Map<String, String> map = new HashMap<String, String>();
map.put("apple", "orange");
map.put("pear", "banana");
log.debug("A map: #0", map);
and map is a HashMap or any Map implementation that formats itself similarly, and debug logging is enabled, you get an IllegalArgumentException saying "can't parse argument number apple=orange,pear=banana". The problem appears to be in Interpolator:
public String interpolate(String string, Object... params) {
// ...
if ( string.indexOf('#')>=0 )
{
string = interpolateExpressions(string, params);
}
if (params.length>0 && string.indexOf('{')>=0 )
{
string = new MessageFormat(string, Locale.instance()).format(params);
}
return string;
}
The first if test passes and interpolateExpressions() interpolates the Map object into the string. Since this particular object's toString() method happens to format it using braces (e.g. "{apple=orange,pear=banana}" above), the second if test also passes, and the same parameters get interpolated *again*. When the part of the toString() representation between the braces fails to parse as a MessageFormat argument specifier, the IAE gets thrown.
My guess is that an "else" is intended before the second "if" above, since it must be rare that one wants the same parameters interpolated twice. Otherwise, either the IAE should be caught and the log message left alone if it doesn't parse as a format string, or the documentation should state clearly that logging an object that represents itself using braces will throw an exception at run time.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-661) s:selectDate dynamic for-id in facelets
by Bram Biesbrouck (JIRA)
s:selectDate dynamic for-id in facelets
---------------------------------------
Key: JBSEAM-661
URL: http://jira.jboss.com/jira/browse/JBSEAM-661
Project: JBoss Seam
Issue Type: Bug
Components: JSF
Affects Versions: 1.1.0.GA
Reporter: Bram Biesbrouck
If I use s:selectDate in a facelets-template, with a "dynamic" component-id in the "for" attribute (set by <ui:param name="id" value="theComponenetId" />), I get an exception:
java.lang.NullPointerException: expr
at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:387)
at org.jboss.seam.ui.SelectDate.encodeBegin(SelectDate.java:63)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:222)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 9 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-724) test failure due to PojoCache
by Gavin King (JIRA)
test failure due to PojoCache
-----------------------------
Key: JBSEAM-724
URL: http://jira.jboss.com/jira/browse/JBSEAM-724
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.1.5.GA
Reporter: Gavin King
Assigned To: Norman Richards
Fix For: 1.2.0.BETA1
Due to the recent change in the PojoCache component, I now get this failure in the test suite:
Caused by: javax.management.InstanceNotFoundException: jboss.system:service=ServiceController at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:804) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:194) at org.jboss.seam.core.PojoCache.start(PojoCache.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0
It's caused by PostAction.post() in the blog example.
Anyway to make PojoCache work in the test suite?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
18 years, 9 months