The attached project, when run with mvn test, demonstrates the problem.
A bean foo is advised by DummyAspect that is configured @Around("bean(foo)").
There is also <jdbc:embedded-database> configured with a <jdbc:script>.
And creation of the database fails because unepectedly the script resource bean is proxied:
Tests in error:
fails(pl.meep.BugTest): Error creating bean with name 'dataSource': Cannot create inner bean '(inner bean)' of type [org.springframework.jdbc.datasource.init.CompositeDatabasePopulator] while setting bean property 'databasePopulator';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.springframework.jdbc.datasource.init.ResourceDatabasePopulator] while setting bean property 'populators' with key [0];
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Initialization of bean failed;
nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'sun.proxy.$Proxy6 implementing java.lang.Cloneable,java.io.Serializable,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.core.io.Resource[]' for property 'scripts';
nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [sun.proxy.$Proxy6 implementing java.lang.Cloneable,java.io.Serializable,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.core.io.Resource] for property 'scripts[0]': PropertyEditor [org.springframework.core.io.ResourceEditor] returned inappropriate value of type [sun.proxy.$Proxy6 implementing java.lang.Cloneable,java.io.Serializable,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised]
Michał Politowski opened SPR-10793 and commented
The attached project, when run with
mvn test
, demonstrates the problem.A bean
foo
is advised byDummyAspect
that is configured@Around("bean(foo)")
.There is also
<jdbc:embedded-database>
configured with a<jdbc:script>
.And creation of the database fails because unepectedly the script resource bean is proxied:
Affects: 3.2.3
Attachments:
1 votes, 4 watchers
The text was updated successfully, but these errors were encountered: