We need to change some Tapestry symbols based on values from the database,
e.g. the SUPPORTED_LOCALES. We have a SettingsService that reads the values
- this service uses Hibernate, so it needs Tapestry IoC to be configured.

We use something like this to add the symbol:
public static void contributeApplicationDefaults(MappedConfiguration<String,
String> configuration, SettingsService settings) {
  configuration.add(SymbolConstants.SUPPORTED_LOCALES,
settings.getString(UISymbolConstants.SUPPORTED_LOCALES, "de,en"));
}

This worked fine in Tapestry 5.2.x - now we upgraded to 5.3.x and we get an
ERROR during IoC initialization: "Construction of service 'ServiceOverride'
has failed due to recursion".

The reason behind this is the new TapestryModule#productionModeOverrides -
this method makes ServiceOverride dependent on symbols (hence SymbolSource).

We also tried another approach with contributing to SymbolSource:
@Contribute(SymbolSource.class)
public static void
addSettingsSymbolSource(OrderedConfiguration<SymbolProvider> configuration,
final SettingsService settings) {
        configuration.add("settings", new SymbolProvider()
        {
            public String valueForSymbol(String symbolName)
            {
                return settings.getString(symbolName, null);
            }
        }, "after:*");
}
with the same result.

There was already a bug filed (closed without solution):
https://issues.apache.org/jira/browse/TAP5-1823

Has anyone an idea how to solve this problem?





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-3-makes-it-impossible-to-load-symbols-from-DB-TAP5-1823-tp5719752.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to