tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Greggory (JIRA)" <j...@apache.org>
Subject [jira] Created: (TAP5-892) Use of Injection to provide Locale instances to components breaks when multiple Locales are configured as Spring Beans in AppContext
Date Wed, 14 Oct 2009 15:22:31 GMT
Use of Injection to provide Locale instances to components breaks when multiple Locales are
configured as Spring Beans in AppContext
------------------------------------------------------------------------------------------------------------------------------------

                 Key: TAP5-892
                 URL: https://issues.apache.org/jira/browse/TAP5-892
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-spring
    Affects Versions: 5.1.0.5
            Reporter: Dave Greggory


Certain components such as Select  have java.util.Locale injected into it. With tapestry-spring-5.1.0.5,
this creates a problem if you have Locale beans configured in your Spring application Context
(externally maintained with tapestry.use-external-spring-context) as below.
    <bean id="locale_US" class="java.util.Locale"><constructor-arg index="0" value="en"
/><constructor-arg index="1" value="US" /></bean>
    <bean id="locale_UK" class="java.util.Locale"><constructor-arg index="0" value="en"
/><constructor-arg index="1" value="GB" /></bean>

This worked fine in Tapestry 5.0.18, but became a problem in 5.1. Currently, I managed to
get 5.1.0.5 of Tapestry running with tapestry-spring-5.0.18, but this problem persists in
tapestry-spring-5.1.0.5

Shouldn't tapestry be looking at the request to see which Locale it is for? Why is it going
into Spring's application context?

Render queue error in
SetupRender[LayoutBlocks:hbflayout]: Exception
assembling root component of page ComponentBlocks:
Exception assembling embedded component 'signupFormComponent' (of type
com.example.components.form.SignupFormComponent, within ComponentBlocks): Failure creating
embedded component
'layoutSelectField' of
com.example.components.ComponentEditorPanel:
java.lang.ClassNotFoundException: caught an exception while obtaining a
class file for org.apache.tapestry5.corelib.components.Select

    * java.lang.ClassNotFoundException
caught an exception while obtaining a class file for org.apache.tapestry5.corelib.components.Select
exception
org.apache.tapestry5.internal.services.TransformationException:
Error obtaining injected value for field
org.apache.tapestry5.corelib.components.Select.locale: Spring context
contains 4 beans assignable to type java.util.Locale: locale_DE,
locale_FR, locale_UK, locale_US.
    * org.apache.tapestry5.internal.spring.SpringModuleDef$4$1.provide(SpringModuleDef.java:258)
    * org.apache.tapestry5.internal.spring.SpringModuleDef$4$2$1.invoke(SpringModuleDef.java:274)
    * org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
    * org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
    * org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:941)
    * org.apache.tapestry5.internal.spring.SpringModuleDef$4$2.provide(SpringModuleDef.java:268)
    * org.apache.tapestry5.internal.spring.SpringModuleDef$4$3.provide(SpringModuleDef.java:290)
    * org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl$1.invoke(MasterObjectProviderImpl.java:48)
    * org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:68)
    * org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
    * org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:941)
    * org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:41)
    * $MasterObjectProvider_1244929e11f.provide($MasterObjectProvider_1244929e11f.java)
    * org.apache.tapestry5.internal.services.DefaultInjectionProvider.provideInjection(DefaultInjectionProvider.java:58)
    * $InjectionProvider_1244929e193.provideInjection($InjectionProvider_1244929e193.java)
    * $InjectionProvider_1244929e18b.provideInjection($InjectionProvider_1244929e18b.java)
    * org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:57)
    * $ComponentClassTransformWorker_1244929e191.transform($ComponentClassTransformWorker_1244929e191.java)
    * $ComponentClassTransformWorker_1244929e187.transform($ComponentClassTransformWorker_1244929e187.java)
    * org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:170)
    * $ComponentClassTransformer_1244929e13e.transformComponentClass($ComponentClassTransformer_1244929e13e.java)
    * org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:205)
    * javassist.Loader.findClass(Loader.java:340)
    * org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:94)
    * javassist.Loader.loadClass(Loader.java:311)
    * java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    * org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:296)



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message