-
1. Re: CDI @Inject in a JAX-WS service impl?
asoldano Feb 15, 2012 5:28 AM (in response to paul.robinson)Hi Paul,
just to clarify, are you using AS7 here?
-
2. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 15, 2012 5:38 AM (in response to asoldano)Alessio,
Yes, I'm using AS 7.1.0.CR1b. I can try it on today's master, if you think it may have ben fixed in the meen time.
Paul.
-
3. Re: CDI @Inject in a JAX-WS service impl?
asoldano Feb 15, 2012 5:43 AM (in response to paul.robinson)I believe this should have already be working, but checking with AS7 master might be a good idea in any case. If it still does not work, we'll try debugging to see what's happening...
-
4. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 18, 2012 5:27 AM (in response to asoldano)Thanks Alessio,
Yes it does work. I was doing something stupid. When I converted from an EJB jar archive to a JAX-WS war archive, I forgot to move the beans.xml from META-INF to WEB-INF .
Off the top of your head, should I be able to use CDI interceptors on @WebMethod annotated methods? I have that working on EJBs exposed as JAX-WS services, but not for plain JAX-WS services deployed in a war. Again, it's probably something silly I've done when converting my service. But if you know of any issues, off the top of your head, then it might save me some time.
Paul.
-
5. Re: CDI @Inject in a JAX-WS service impl?
ropalka Feb 20, 2012 6:41 AM (in response to paul.robinson)Paul Robinson wrote:
Off the top of your head, should I be able to use CDI interceptors on @WebMethod annotated methods? I have that working on EJBs exposed as JAX-WS services, but not for plain JAX-WS services deployed in a war.
It won't work on POJO endpoints AFAIK.
But if you'll provide us sample app (reproducer)
and will give us some pointers in CDI spec
where this is mandatory EE feature,
then it's definitely a bug we need to fix.
-
6. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 20, 2012 8:12 AM (in response to ropalka)Richard,
Thanks for the reply,
Are you saying that you don't think it works for JAX-WS endpoints that are implemented as POJOs, or that you don't think it work on POJOs full stop? I have it working for POJOs that are neither EJBs or JAX-WS services and also for JAX-WS services that are also EJBs.
Also, you ask me to point to something in the CDI spec that says this should work. I can find something that says a POJO must support interceptors. But the spec does not mention JAX-WS for any CDI feature, so the behavior of interceptors on a JAX-WS service implemented as a POJO is not specified.
Paul.
-
7. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 20, 2012 10:08 AM (in response to paul.robinson)Richard,
I've also been talking to Ales on IRC about this issue. He asked for a failing Arquillian test in the Weld suite. I'm including it here as it may explain better, what I'm trying to get working:
You can run the test by:
Boot AS7.1.0.Final git clone git@github.com:paulrobinson/core.git cd core git checkout JAXWS_POJO_with_CDI_interceptor cd tests-arquillian/ mvn install -Pincontainer-remote -Dtest=org.jboss.weld.tests.interceptors.jaxws.InterceptorTest
Observe that the test fails with message:
junit.framework.AssertionFailedError: Interceptor not invoked
-
8. Re: CDI @Inject in a JAX-WS service impl?
ropalka Feb 21, 2012 4:10 AM (in response to paul.robinson)Hi Paul,
I reviewed your test and I confirm it won't work.
Aren't interceptors intended for EJBs only?
Rio
-
9. Re: CDI @Inject in a JAX-WS service impl?
ropalka Feb 21, 2012 4:49 AM (in response to paul.robinson)Paul Robinson wrote:
Are you saying that you don't think it works for JAX-WS endpoints that are implemented as POJOs, or that you don't think it work on POJOs full stop?
I'm saying it won't work for JAXWS POJO endpoints.
Paul Robinson wrote:
I have it working for POJOs that are neither EJBs or JAX-WS services and also for JAX-WS services that are also EJBs.
This seems to be generic requirement and probably should work also on JAXWS POJOs.
Paul Robinson wrote:
But the spec does not mention JAX-WS for any CDI feature, so the behavior of interceptors on a JAX-WS service implemented as a POJO is not specified.
It should be clarified IMO because it seems it should work also for JAXWS POJOs.
This is against our current design and thus won't work for you
-
10. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 21, 2012 4:41 AM (in response to ropalka)Rio,
These are CDI interceptors, not EJB interceptors. CDI interceptors work on POJOs and EJBs. I would have expected CDI to have seen the JAX-WS impl as a POJO and setup the interceptors accordingly.
Are you able to comment on my pull request? Two Weld guys (Ales Justin and Stuart Douglas) think this should work.
https://github.com/weld/core/pull/154
Thanks,
Paul.
-
11. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 21, 2012 4:44 AM (in response to ropalka)Rio,
I just saw your second post. So you are saying you think this should work, but it is not supported by JBossWS?
It sounds like I should be creating a feature request / bug report for this, in JBossWS?
Paul.
-
12. Re: CDI @Inject in a JAX-WS service impl?
ropalka Feb 21, 2012 4:54 AM (in response to paul.robinson)Hi Paul,
Paul Robinson wrote:
So you are saying you think this should work, but it is not supported by JBossWS?
Exactly.
Paul Robinson wrote:
It sounds like I should be creating a feature request / bug report for this, in JBossWS?
Yes, please. Ideally with the spec requirements/pointers so we can understand how this is exactly supposed to work.
Please note that fix of this issue won't be trivial and might take time It requires non trivial architecture changes/review.
Rio
-
13. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 21, 2012 4:58 AM (in response to ropalka)Thanks Rio,
I'll cretae the Jira issue soon. I can use EJBs during development, so I can wait.
Paul.
-
14. Re: CDI @Inject in a JAX-WS service impl?
paul.robinson Feb 21, 2012 6:47 AM (in response to paul.robinson)