[
http://www.stripesframework.org/jira/browse/STS-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11613#action_11613
]
Chris Herron commented on STS-642:
----------------------------------
This is not a bug. @SpringBean doesn't promise anything more than retrieving a
Spring bean by its name. Is purpose is to allow Stripes ActionBeans to be
clients of Spring beans. Others have commented on @SpringBean not being able to
handle Spring autowiring/component/security/transaction annotations - but to do
this would be duplicating Spring's own capabilities.
I suggest that you create a DAO that is a Spring bean, place the
@PersistenceContext annotation within that bean, and then use @SpringBean to
retrieve that bean for use within your ActionBean.
There is also the SpringObjectFactory at stripes-stuff.org. This allows Stripes
ActionBeans to become Spring Beans, however it is beta quality.
> SpringInterceptorSupport doesn't wire JPA @ PersistenceContext annotation
> --------------------------------------------------------------------------
>
> Key: STS-642
> URL: http://www.stripesframework.org/jira/browse/STS-642
> Project: Stripes
> Issue Type: Bug
> Reporter: Jarek Robakiewicz
> Priority: Minor
>
> Spring interceptor uses SpringHelper#injectBeans method which has custom
> implementation of bean injection. This implementation ignores standard JPA
> annoation supported by Spring.
> Using only Spring, this annotation works fine:
> AutowireCapableBeanFactory beanFactory =
> springContext.getAutowireCapableBeanFactory();
> beanFactory.autowireBeanProperties(bean,
> AutowireCapableBeanFactory.AUTOWIRE_NO, false);
> and is implemented by Spring Post processor
> PersistenceAnnotationBeanPostProcessor#private InjectionMetadata
> findPersistenceMetadata(final Class clazz)
> @SpringBean seems to be duplicate responsibility of @java.annotation.Resource
> supported also by Spring. It provides capabiltiy of bean injection for
> private fields (BTW not very useful during unit tests)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development