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?
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.
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.
thanks again for your suggestions!
Maybe you are right and I have to give up. I found this
but it seems that there are no real instructions there.
It seems impossible.