How can I inject this class (It's inside the war part of the project):
@Named("user")
@SessionScoped
public class User implements Serializable
{....}
Into this EJB session bean:
@Stateless
@LocalBean
public class testSB
{ inject User here... }
I tried using @Inject
but it does not work. It seems that it does not recognize User
class.
I tried looking for an example of injecting CDI into EJB, but could not find anything that worked.
Is that even possible? What is the right way to do this? I would like to get data from the User
class directly instead of passing the values inside the methods.