cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CXF-6694) SpringResourceFactory does not work with constructor-autowired beans
Date Thu, 03 Dec 2015 10:27:11 GMT

    [ https://issues.apache.org/jira/browse/CXF-6694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15037615#comment-15037615
] 

Sergey Beryozkin edited comment on CXF-6694 at 12/3/15 10:26 AM:
-----------------------------------------------------------------

The problem is the factory is not injected with an instance and itself it does not know how
to ask the application context to create a constructor-autowired bean.
Perhaps the fix should not go to SpringResourceFactory but to AbstractSpringComponentScanServer
which will do something special about such beans and register them directly as service resource
beans ?


was (Author: sergey_beryozkin):
The problem is the factory is not injected with an instance and itself it does not know how
to ask the application context to create a constructor-autowired bean.
Perhaps the fix should not go to SpringResourceFactory but to AbstractSpringComponentScanServer
which will do something special about such beans ?

> SpringResourceFactory does not work with constructor-autowired beans
> --------------------------------------------------------------------
>
>                 Key: CXF-6694
>                 URL: https://issues.apache.org/jira/browse/CXF-6694
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.4
>            Reporter: Vladimir Kulev
>              Labels: spring
>
> When used with constructor-autowired bean, it fails with "Resource class ... has no valid
constructor" exception. We don't need constructor at all when we already have a singleton
instance from Spring.
> Also it looks like {{isSingleton()}} is called for the first time before correct value
is calculated a few lines below: {{isSingleton = ac.isSingleton(beanId)}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message