2

I've deployed an ear on websphere 8.5.

the application is composed of an ejb jar and a webapp ( Spring MVC ).

Here is my ejb :

    @Stateless
    public class DiscrepanciesServiceImpl implements DiscrepanciesService {

@Inject
private DiscrepancyDao discrepancyDao;

public DiscrepanciesServiceImpl(){};

public List<Discrepancy> viewDiscrepancies() {

            return discrepancyDao.findAll();
}

}

discrepancyDao is an interface that extends a generics interface as follows:

   public interface DiscrepancyDao extends _GenericDao<Discrepancy> {

}

implemented by DiscrepancyDaoImpl as follow:

        @Named("discrepancyDao")
        public class DiscrepancyDaoImpl extends _GenericDaoImpl<Discrepancy> implements  DiscrepancyDao {  }

and when I invoke viewDiscrepancies() i get nullpointerexception on discrepancyDao ( injected by CDI )

I've deployed on WAS 8.5 and my empty beans.xml is in the META-INF folder. During the deployment the was's console works fine with no errors. Thanks in advance for your answers. Regards Fabio

Fabio_M
  • 879
  • 7
  • 21

1 Answers1

1

In a WAR, beans.xml goes in WEB-INF.

LightGuard
  • 5,298
  • 19
  • 19
  • Are all of the classes in question in the EJB jar, or is one of them in the WAR? IIRC the Bean Archive setup in WAS is a little tricky and you'll probably need to include a beans.xml in both places to get everything to work. – LightGuard Jun 15 '13 at 05:02