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] [Resolved] (CXF-6003) jaxrs:server "basePackages" attribute doesn't initialize REST services properly
Date Mon, 15 Sep 2014 17:11:34 GMT

     [ https://issues.apache.org/jira/browse/CXF-6003?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergey Beryozkin resolved CXF-6003.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 3.1.0
                   3.0.2
         Assignee: Sergey Beryozkin

I applied the proposed change, thanks

> jaxrs:server "basePackages" attribute doesn't initialize REST services properly
> -------------------------------------------------------------------------------
>
>                 Key: CXF-6003
>                 URL: https://issues.apache.org/jira/browse/CXF-6003
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.0
>            Reporter: Hesam Talebi
>            Assignee: Sergey Beryozkin
>             Fix For: 3.0.2, 3.1.0
>
>
> As I see, there is a feature to let cxf detect REST services automatically through "basePackages"
attribute of "jaxrs:server" tag.
> it supposed to scan classpath and create beans for classes with @Path(and @Provider)
annotation. the problem is Spring Autowiring doesn't work for these beans, so there is no
way to initialize REST services properly.
> I saw the code and think found the problem. in JAXRSServerFactoryBeanDefinitionParser
if you change
> {code:xml}
> providers.add(context.getAutowireCapableBeanFactory().createBean(clazz));
> {code}
> to:
> {code:xml}
> providers.add(context.getAutowireCapableBeanFactory().createBean(clazz, 2, true));
> {code}
> everything works fine. it simply tells spring to enable autowiring in bean creation.



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

Mime
View raw message