0

Which Dependency Injection framework I can use with WebSphere 7 app-server (Java EE 5 compatible)? I want to inject some classes (for example DAO classes) inside stateless EJBs (marked as bold, because I think it main problem to inject something into EJB, because by default it must be done by EJB containers).

After some research I found that Weld (Java EE 6 RI of CDI) is hard to configure on WAS, also very little information about using Guice with WAS.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
WelcomeTo
  • 19,843
  • 53
  • 170
  • 286
  • What is hard in configuration of CDI? You even need not know if it is Weld or some other. You should create beans.xml and after that you can include your DAO to EJB as simple as placing one annotation on it. – yatul Dec 28 '12 at 07:09
  • @yatul I found some forum discussions where wrote that it impossible. For example: https://community.jboss.org/thread/179438 and this (we can't use Weld even in WAS 8!!!): http://stackoverflow.com/questions/10056600/weld-on-websphere-8 – WelcomeTo Dec 28 '12 at 07:24
  • May be this will help http://wasdynacache.blogspot.ru/2011/11/how-to-get-cdi-running-on-websphere.html – Konstantin V. Salikhov Dec 28 '12 at 07:35
  • @KonstantinV.Salikhov Methods described in post you provide seems as hacks) Thanks anyway – WelcomeTo Dec 28 '12 at 07:42
  • FWIW I've used Guice to great success on WebSphere. Ditched the EJBs altogether. Just used guice and guice-servlet. The app worked the same on Tomcat as it did on Jetty as it did on WebSphere. Used JNDI and Service Loader for environment specific additions. – Alen Vrečko Dec 29 '12 at 12:00

0 Answers0