[ 
https://issues.apache.org/jira/browse/TAP5-1788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169762#comment-13169762
 ] 

Matt Raible commented on TAP5-1788:
-----------------------------------

As suggested in the Nabble thread, changing SpringModuleDef.java from:

    private void addServiceDefsForSpringBeans(ApplicationContext context)
    {
        for (final String beanName : 
BeanFactoryUtils.beanNamesIncludingAncestors(context))
        {
            String trueName = beanName.startsWith("&") ? beanName.substring(1) 
: beanName;

            services.put(trueName, new SpringBeanServiceDef(trueName, context));
        }
    }

To:

    private void addServiceDefsForSpringBeans(ApplicationContext context)
    {
        for (final String beanName : context.getBeanDefinitionNames())
        {
            String trueName = beanName.startsWith("&") ? beanName.substring(1) 
: beanName;

            services.put(trueName, new SpringBeanServiceDef(trueName, context));
        }
    }

Does solve the problem.
                
> Service id 'environment' has already been defined by 
> org.apache.tapestry5.services.TapestryModule with Spring 3.1
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1788
>                 URL: https://issues.apache.org/jira/browse/TAP5-1788
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-spring
>    Affects Versions: 5.2.4
>            Reporter: Matt Raible
>
> After upgrading to Spring 3.1, started seeing the following error with 
> Tapestry 5.2.4.
> java.lang.RuntimeException: Service id 'environment' has already been defined 
> by 
> org.apache.tapestry5.services.TapestryModule.buildEnvironment(PerthreadManager)
>  
> More information at 
> http://tapestry.1045711.n5.nabble.com/tapestry-5-2-4-and-spring-3-1M1-td4462226.html#a4742011

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to