Hesam Talebi created CXF-6003:
---------------------------------
Summary: 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
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)