-
1. Re: Arquillian Websphere 7 injection does not work
manovotn Oct 24, 2016 9:40 AM (in response to schullerer)Hi there
I am not an Arquillian expert but here is what I think is the problem.
Arquillian uses CDI to inject the dependencies, be it CDI or EJB dependency (e.g. @Inject or @EJB). In order to achieve that, it will use BeanManager (which is part of CDI).
However CDI is part of Java EE since EE 6, while you are using EE 5. Therefore, I suppose the server does not provide CDI impl and it cannot resolve BeanManager.
Frank Schullerer wrote:
The problem is that the EJB instance variables are null at test time.
CDI does lazy injection, the injection points are null until you first try to use them. Anyway the test you pointed at does make null assertions so I guess it is failing, right?
-
2. Re: Arquillian Websphere 7 injection does not work
schullerer Oct 25, 2016 2:21 AM (in response to manovotn)Hi Matej,
thank you for your response!
this is maybe the problem but like I wrote " Because of the fact that the test for Websphere 7 (J2EE 5) exists I assume that it should work."
Maybe only the author of the test can verify that.
-
3. Re: Arquillian Websphere 7 injection does not work
manovotn Oct 25, 2016 6:06 AM (in response to schullerer)Well, appratently Arq. wants to use CDI (BeanManager) and unless you modify Websphere 7 and add CDI there, it cannot work. Meaning the test might be correct, but has some prerequisites.
That being said, I have no clue how to enable CDI in WAS 7, if its at all possible. Maybe you can get Seam (predecessor of Weld/CDI) there only? Not sure that would suffice though, I am only guessing. I guess the authors or WAS would have more experience with that.
Then again, trying all this might be an overkill unless you really strive to enable CDI features in your app.
-
4. Re: Arquillian Websphere 7 injection does not work
schullerer Oct 26, 2016 5:36 AM (in response to manovotn)Hi Matej,
thanks again for your suggestions!
Maybe you are right and I have to give up. I found this
seam-dev - seam-booking from CR3 preliminary testing results on WebSphere v8 beta
but it seems that there are no real instructions there.
It seems impossible.