[
https://issues.apache.org/jira/browse/TAP5-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763900#action_12763900
]
Neeme Praks commented on TAP5-223:
----------------------------------
some code from my side:
{code:java}
public static void contributeSymbolSource(
OrderedConfiguration<SymbolProvider> configuration,
�...@applicationdefaults
SymbolProvider applicationDefaults,
�...@factorydefaults
SymbolProvider factoryDefaults,
�...@injectservice("Context") Context context)
{
configuration.add("ZpsSymbols",
new ContextResourceSymbolProvider(context,
"WEB-INF/conf/zps-web.properties"));
}
{code}
Gives error:
Caused by: java.lang.RuntimeException: Exception constructing service
'Context': The constructor for module class org.apache.tapestry5.services.Tapest
ryModule is recursive: it depends on itself in some way. The constructor,
public org.apache.tapestry5.services.TapestryModule(org.apache.tapestry5.ioc
.services.PipelineBuilder,org.apache.tapestry5.ioc.services.PropertyShadowBuilder,org.apache.tapestry5.services.RequestGlobals,org.apache.tapestry5.se
rvices.ApplicationGlobals,org.apache.tapestry5.ioc.services.ChainBuilder,org.apache.tapestry5.services.Environment,org.apache.tapestry5.ioc.services.S
trategyBuilder,org.apache.tapestry5.ioc.services.PropertyAccess,org.apache.tapestry5.services.Request,org.apache.tapestry5.services.Response,org.apach
e.tapestry5.services.EnvironmentalShadowBuilder,org.apache.tapestry5.internal.services.EndOfRequestEventHub),
is in some way is triggering a service b
uilder, decorator or contribution method within the class.
And in this case, the context is null:
{code:java}
public static void contributeSymbolSource(
OrderedConfiguration<SymbolProvider> configuration,
@ApplicationDefaults
SymbolProvider applicationDefaults,
@FactoryDefaults
SymbolProvider factoryDefaults,
@InjectService("ApplicationGlobals") ApplicationGlobals globals)
{
configuration.add("ZpsSymbols",
new ContextResourceSymbolProvider(globals.getContext(),
"WEB-INF/conf/zps-web.properties"));
}
{code}
Any other ideas are highly appreciated.
> Allow properties files (on classpath or in the context) to be used as
> SymbolProviders
> -------------------------------------------------------------------------------------
>
> Key: TAP5-223
> URL: https://issues.apache.org/jira/browse/TAP5-223
> Project: Tapestry 5
> Issue Type: New Feature
> Components: tapestry-ioc
> Affects Versions: 5.0.15
> Reporter: Neeme Praks
> Assignee: Howard M. Lewis Ship
> Priority: Minor
> Fix For: 5.1.0.5
>
> Attachments: PropertiesFileSymbolProvider.patch.txt, TAP5-223.txt
>
>
> add a possibility to resolve symbols from properties file
> (PropertiesFileSymbolProvider).
> For reference, see:
> http://thread.gmane.org/gmane.comp.java.tapestry.user/65656
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.