Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.3 final
-
Fix Version/s: 1.3.5
-
Component/s: None
-
Labels:None
Description
I am using the convential proxy support and after upgrading from 1.2 to 1.3 it gave this error:
"bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'"
When setting service scope back to singleton and uncommenting proxy support in resources.groovy it works again.
I think this might be related to:
http://markmail.org/message/4elaxmnsikprsmhb#query:cxf%20%22object%20is%20not%20an%20instance%20of%20declaring%20class%22+page:1+mid:rtmqxvudjse5ccbm+state:results
...but trying to prefix targetBeanName with # doesnt work.
testService(TestService) {
authenticateService = ref("authenticateService")
}
testServiceProxy(ScopedProxyFactoryBean) {
targetBeanName = 'testService'
proxyTargetClass = true
}
within the testService i was using session scope
-
Hide
- servicetest-bug-report-17052010.zip
- 17/May/10 5:42 AM
- 22 kB
- Graeme Rocher
-
- grails-app/conf/BootStrap.groovy 0.1 kB
- grails-app/conf/BuildConfig.groovy 1 kB
- grails-app/conf/Config.groovy 3 kB
- grails-app/conf/DataSource.groovy 0.6 kB
- grails-app/conf/UrlMappings.groovy 0.2 kB
- grails-app/conf/spring/resources.groovy 0.3 kB
- grails-app/.../TestController.groovy 0.1 kB
- grails-app/i18n/messages.properties 3 kB
- grails-app/i18n/messages_da.properties 3 kB
- grails-app/i18n/messages_de.properties 4 kB
- grails-app/i18n/messages_es.properties 3 kB
- grails-app/i18n/messages_fr.properties 2 kB
- grails-app/i18n/messages_it.properties 2 kB
- grails-app/i18n/messages_ja.properties 2 kB
- grails-app/i18n/messages_nl.properties 3 kB
- grails-app/.../messages_pt_BR.properties 3 kB
- grails-app/.../messages_pt_PT.properties 3 kB
- grails-app/i18n/messages_ru.properties 4 kB
- grails-app/i18n/messages_th.properties 5 kB
- grails-app/.../messages_zh_CN.properties 2 kB
- grails-app/.../AuthenticateService.groovy 0.1 kB
- grails-app/.../AuthenticationService.groovy 0.1 kB
- grails-app/services/.../TestService.groovy 0.1 kB
- grails-app/views/error.gsp 2 kB
- grails-app/views/index.gsp 3 kB
- grails-app/views/layouts/main.gsp 0.7 kB
- test/.../AuthenticateServiceTests.groovy 0.3 kB
- test/.../AuthenticationServiceTests.groovy 0.3 kB
- test/unit/.../TestControllerTests.groovy 0.3 kB
- test/unit/.../TestServiceTests.groovy 0.2 kB
-
Hide
- test.zip
- 30/Jun/10 10:19 AM
- 191 kB
- Steve Shucker
-
- test/test.iws 30 kB
- test/.../messages_zh_CN.properties 2 kB
- test/grails-app/.../messages_th.properties 5 kB
- test/grails-app/.../messages_de.properties 4 kB
- test/grails-app/.../messages_nl.properties 3 kB
- test/grails-app/.../messages_ja.properties 2 kB
- test/grails-app/.../messages_es.properties 3 kB
- test/grails-app/.../messages_da.properties 3 kB
- test/grails-app/.../messages_ru.properties 4 kB
- test/grails-app/.../messages_it.properties 2 kB
- test/.../messages_pt_PT.properties 3 kB
- test/grails-app/.../messages_fr.properties 2 kB
- test/grails-app/i18n/messages.properties 3 kB
- test/.../messages_pt_BR.properties 3 kB
- test/grails-app/.../test/TestService.groovy 0.2 kB
- test/grails-app/views/error.gsp 2 kB
- test/grails-app/views/layouts/main.gsp 0.7 kB
- test/grails-app/views/index.gsp 4 kB
- test/grails-app/conf/UrlMappings.groovy 0.2 kB
- test/grails-app/.../spring/resources.groovy 0.2 kB
- test/grails-app/.../spring/resources.xml 0.6 kB
- test/grails-app/conf/BuildConfig.groovy 1 kB
- test/grails-app/conf/BootStrap.groovy 0.1 kB
- test/grails-app/conf/Config.groovy 3 kB
- test/grails-app/conf/DataSource.groovy 0.8 kB
- test/projectFilesBackup/test.iws 3 kB
- test/projectFilesBackup/test.iml 2 kB
- test/projectFilesBackup/test.ipr 7 kB
- test/application.properties 0.2 kB
- test/.classpath 0.7 kB
Issue Links
- depends on
-
GRAILS-6737
Upgrade to Groovy 1.7.5
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Please try the Grails scoped proxy plugin and see if that works for you.
I also got problems related to this when upgrading from 1.2.2 to 1.3.1
Exception:
com.mycompany.TargetService cannot be cast to com.mycompany.TargetService$$EnhancerByCGLIB$$6363d510
resources.groovy:
targetService(com.mycompany.TargetService)
targetScopeProxy(org.springframework.aop.scope.ScopedProxyFactoryBean){
targetBeanName="targetService"
proxyTargetClass=true
}
But I guess the above configuration was added back when I used grails 1.0.3/1.0.4 and wanted to call services from taglib code. I removed it now and the application still works ok. So it's not a problem for me anymore.
I've been able to reproduce this since upgrading from 1.2.1 to 1.3.2. I'm attaching an app with a test case demonstrating the problem. The problem manifests itself differently depending on whether the service is marked as a scoped proxy in an xml or groovy bean definition (per http://jira.codehaus.org/browse/GRAILS-1697). I've included both contexts in my example, but commented out the beanbuilder version.
A workaround is to specify a custom getMetaClass() implementation in the TestService of the attached application:
MetaClass getMetaClass() { GroovySystem.metaClassRegistry.getMetaClass(TestService)}
I cannot reproduce this. Attached is an app that uses the configuration described. Please attach an example that does reproduce this issue.