Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPR-7679 - Qualified TransactionManager now also found if declared in parent context #5

Closed
wants to merge 4,839 commits into from

Conversation

odrotbohm
Copy link
Member

In case you have defined a transaction manager inside a parent application context and try to reference this from a bean inside a child context explicitly (through @transactional("txMgr") e.g.) it will be found now.

cbeams and others added 30 commits September 13, 2011 18:53
Previously, #containsBean Javadoc advertised that a true return value
indicates that a call to #getBean for the same name would succeed.

This is actually not the case, and has never been.  The semantics
of #containsBean have always been to indicate whether a bean definition
with the given name is definied or a singleton instance with the given
name has been registered.

The Javadoc now reflects this accurately.

Issue: SPR-8690

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4971 50f2f4bb-b051-0410-bef5-90022cba6387
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4972 50f2f4bb-b051-0410-bef5-90022cba6387
…ween string paths and path segment lists automatically.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4974 50f2f4bb-b051-0410-bef5-90022cba6387
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4980 50f2f4bb-b051-0410-bef5-90022cba6387
1. Consider single-purpose return value types like HttpEntity, Model,
View, and ModelAndView ahead of annotations like @responsebody and
@ModelAttribute. And reversely consider multi-purpose return value 
types like Map, String, and void only after annotations like
@rb and @ma.

2. Order custom argument resolvers and return value handlers after the
built-in ones also clarifying the fact they cannot be used to override
the built-in ones in Javadoc throughout.

3. Provide hooks in RequestMappingHandlerAdapter that subclasses can use
to programmatically modify the list of argument resolvers and return
value handlers, also adding new getters so subclasses can get access
to what they need for the override.

4. Make SessionStatus available through ModelAndViewContainer and 
provide an argument resolver for it.

5. Init test and javadoc improvements.




git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4984 50f2f4bb-b051-0410-bef5-90022cba6387
RequestCondition types keep individual expression types (e.g. the
discrete header or param expressions) package private. Although the 
implementation of these types should remain private, there is no 
reason not to provide access to the underlying expression data --
e.g. for creating a REST endpoint documentation tool, or if you 
want to know which of the "consumes"/"produces" media types
are negated.

This change ensures that all RequestCondition types have a public
getter that makes available the basic expression data. 




git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4985 50f2f4bb-b051-0410-bef5-90022cba6387
Make it possible to hook in custom ServletRequestDataBinderFactory
by overriding RequestMappingHandlerAdapter. 

Create ExtendedServletRequestDataBinder to add URI template vars
to the binding values taking advantage of a new extension hook in
ServletRequestDataBinder to provide additional values to bind.




git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4987 50f2f4bb-b051-0410-bef5-90022cba6387
…nners.model.MultipleFailureException, which has been deprecated in JUnit 4.9.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4988 50f2f4bb-b051-0410-bef5-90022cba6387
… is a super-class of the actual target.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4989 50f2f4bb-b051-0410-bef5-90022cba6387
…rmined why changes to GenericConversionService broke this test.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4990 50f2f4bb-b051-0410-bef5-90022cba6387
…nges to GenericConversionService broke this test.

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4992 50f2f4bb-b051-0410-bef5-90022cba6387
When a @ModelAttribute is instantiated from a URI variable with type
conversion, if conversion fails allow the exception to propagate. 
This is consistent with what happens on type conversion failure with
@PathVariable and other args that rely on type conversion.



git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4997 50f2f4bb-b051-0410-bef5-90022cba6387
jhoeller and others added 16 commits November 28, 2011 17:34
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@5218 50f2f4bb-b051-0410-bef5-90022cba6387
The AbstractHttpMessageConverter was using the requested Content-Type
rather than the actual response Content-Type to determine the length
of the content. This can lead to a problem when a controller returns
a ResponseEntity with a Content-Type header that ignores (overrides)
the requested Content-Type. The fix ensures that actual response 
Content-Type is the one used both to write to the response and to 
determine the length of the content.




git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@5219 50f2f4bb-b051-0410-bef5-90022cba6387
…ers on any access (SPR-8844, SPR-8845)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@5220 50f2f4bb-b051-0410-bef5-90022cba6387
Prior to this change, a @configuration classes that @componentscan
themselves would result in a ConflictingBeanDefinitionException.

For example:

    package com.foo.config;

    @configuration
    @componentscan("com.foo");
    public class AppConfig {
        // ...
    }

This resulted in a ConflictingBeanDefinitionException that users have
typically worked around in the following fashion:

    package com.foo.config;

    @configuration
    @componentscan(basePackages="com.foo",
        excludeFilters=@filter(value=ANNOTATION_TYPE, type=Configuration.class);
    public class AppConfig {
        // ...
    }

This is obviously more verbose and cumbersome than would be desirable,
and furthermore potentially too constraining as it prohibits the ability
to include other legitimate @configuration classes via scanning.

The exception was being thrown because of a logic problem in
ClassPathBeanDefinitionScanner.  The bean definition for AppConfig gets
registered once by the user (e.g. when constructing an
AnnotationConfigApplicationContext), then again when performing the
component scan for 'com.foo'. Prior to this change,
ClassPathBeanDefinitionScanner's #isCompatible returned false if the new
bean definition was anything other than an AnnotatedBeanDefinition.  The
intention of this check is really to see whether the new bean definition
is a *scanned* bean definition, i.e. the result of a component-scanning
operation.  If so, then it becomes safe to assume that the original bean
definition is the one that should be kept, as it is the one explicitly
registered by the user.

Therefore, the fix is as simple as narrowing the instanceof check from
AnnotatedBeanDefinition to its ScannedGenericBeanDefinition subtype.

Note that this commit partially reverts changes introduced in SPR-8307
that explicitly caught ConflictingBeanDefinitionExceptions when
processing recursive @componentscan definitions, and rethrew as a
"CircularComponentScanException.  With the changes in this commit,
such CBDEs will no longer occur, obviating the need for this check and
for this custom exception type altogether.

Issue: SPR-8808, SPR-8307

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@5233 50f2f4bb-b051-0410-bef5-90022cba6387
… parent context

In case you have defined a transaction manager inside a parent application context and try to reference this from a bean inside a child context explicitly (through @transactional("txMgr") e.g.) it will be found now.
@cbeams
Copy link
Contributor

cbeams commented Feb 2, 2012

Closing, as SPR-7679 was resolved some time ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants