J Aaron Farr wrote:
Hello again.
[Bug Alert] I think there's more to this than my typos:
Okay, Shash pointed some out to me some problems, but I think I've fixed them
all and I'm still having issues:
New "SwingContainer.xconf":
<fortress-example>
<translator id="translator2" logger="translator">
<dictionary>
<translation key="hello-world">
<value language="Deutsch">Hallo Welt</value>
<value language="English">Hello World</value>
<value language="Français">Bonjour la monde</value>
<value language="Indonesia">Apa kabar Dunia</value>
<value language="Espanõl">Hola Mundo</value>
<value language="Italiano">Ciao Mondo</value>
</translation>
</dictionary>
</translator>
<translator id="translator1" logger="translator">
<dictionary>
<translation key="hello-world">
<value language="Deutsch">Hallo Welt</value>
<value language="English">Hello World :)</value>
<value language="Français">Bonjour la monde</value>
<value language="Indonesia">Apa kabar Dunia</value>
<value language="Espanõl">Hola Mundo</value>
<value language="Italiano">Ciao Mondo</value>
</translation>
</dictionary>
</translator>
</fortress-example>
New bit of code in SwingContainer.java (replaces line 98):
---------------------------------------------------------------------------------
Object o = m_serviceManager.lookup(
org.apache.avalon.fortress.examples.components.Translator.ROLE);
if (o instanceof ServiceSelector)
{
m_translator = (Translator) ((ServiceSelector)o).select("translator1");
}
else
{
m_translator = (Translator)o;
}
---------------------------------------------------------------------------------
So, notice that in SwingContainer.xconf, "translator2" comes before
"translator1". If you run this with select("translator1") it works. Try
selecting translator2 and it crashes. Swap the order in the config file and
the same thing happens to translator1. In other words, it only works if you
select the _second_ translator as defined in the xconf file. The _first_ one
never works.
Ok. This is a bug. Thank you for finding it before we got to a
release.
I believe the problem stems from the default component mapping logic.
I will fix it ASAP.
I tried this on another bit of code and had the exact same results. The second
definition works, the first doesn't. This is a completely different code base,
so either I'm making the same mistakes twice (which is very possible) or
there's a bug in Fortress somewhere so that components are not properly
initialized.
I have meetings this afternoon and evening, so I won't get back to this until
late tonight. Could someone confirm this? I hope it's just me, but I want to
be sure.
I will post back with the resolution.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]