You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Aruna Kalagnanam <ka...@gmail.com> on 2017/09/05 07:44:53 UTC

@Provider scan not working

Hi,

I have a JAX-RS service running on TomEE with an empty Application
subclass. The WAR doesnt have any Providers, but the TomEE runtime library
has a custom jar that has filters and exception mappers annotated with
@Provider.

My expectation is that those @Provider classes will be scanned
automatically and will be invoked on the request-response path. But, they
are not recognized as provider classes.

cxf.jaxrs.skip-provider-scanning is not set.
cxf.jaxrs.providers is set to JohnzonProvider.

Are those @Provider classes not being scanned because they are not part of
the application WAR file ? If no, then why are the @Provider classes not
being recognized.
As a workaround, I have listed all of the provider classes in the value for
cxf.jaxrs.providers, but I really want them to auto scanned.

Please help me resolve this.

Thanks,
Aruna.

Re: @Provider scan not working

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

if you put it in tomee/lib then it is not scanned by default for backward
compatibility reasons

you can try to set -Dopenejb.scan.webapp.container=true


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-09-05 9:44 GMT+02:00 Aruna Kalagnanam <ka...@gmail.com>:

> Hi,
>
> I have a JAX-RS service running on TomEE with an empty Application
> subclass. The WAR doesnt have any Providers, but the TomEE runtime library
> has a custom jar that has filters and exception mappers annotated with
> @Provider.
>
> My expectation is that those @Provider classes will be scanned
> automatically and will be invoked on the request-response path. But, they
> are not recognized as provider classes.
>
> cxf.jaxrs.skip-provider-scanning is not set.
> cxf.jaxrs.providers is set to JohnzonProvider.
>
> Are those @Provider classes not being scanned because they are not part of
> the application WAR file ? If no, then why are the @Provider classes not
> being recognized.
> As a workaround, I have listed all of the provider classes in the value for
> cxf.jaxrs.providers, but I really want them to auto scanned.
>
> Please help me resolve this.
>
> Thanks,
> Aruna.
>