ejb-3.1

Can an EJB bean implement multiple interfaces?

瘦欲@ 提交于 2019-12-29 07:40:07
问题 Can an EJB bean implement multiple user defined interfaces, except business interfaces (@Local, @Remote) or No-Interface view (@LocalBean)? For example define two interfaces UserInterface1 , UserInterface2 , with no annotation. Is this legal to implement: @Stateless public class MyBean implements UserInterface1, UserInterface2 { ... Then I have another confusion: @Stateless public class MyBean implements Runnable { ... //inside I won't try to manage thread } Is this legal or illegal, I found

Inject a stateless EJB with @Inject into CDI Weld ManagedBean (JSF 1.2 EJB Application on jboss 6 AS)

↘锁芯ラ 提交于 2019-12-29 04:51:12
问题 Currently I am trying to inject a stateless EJB into a CDI managed controller on Jboss 6 AS Final. The controller is managed in the context an accessible from the JSF pages. If I inject the stateless bean with @EJB it is working. If I inject the stateless EJB with @Inject I get the following Exception: My controller: @Named("TestController") public class TestController { @Inject private TestManagerLocal myTestManager; ... } } My stateless bean: @SuppressWarnings("unchecked") @Stateless public

How to make EJB3 remote interface available to client?

五迷三道 提交于 2019-12-25 09:40:35
问题 I am trying to access a remote EJB3 bean from a client which runs on a separate JVM using JNDI lookup. Following are my bean classes: @Path("/payment/") @Consumes({ "application/xml", "application/json" }) @Produces({ "application/xml", "application/json" }) @Local({ PaymentWebServiceLocal.class }) @Remote({ PaymentWebServiceRemote.class }) @Stateless(mappedName = "ejb/PaymentWebService") public class PaymentWebServiceImpl implements PaymentWebServiceLocal,PaymentWebServiceRemote { private

Problems loading remote Interface with context.lookup

眉间皱痕 提交于 2019-12-25 01:00:22
问题 I used to work with jboss 4.2.3 GA and there everything worked fine (at least calling the remote interface from the client side). Now I try to deploy that with Jboss 7.0.1 FINAL I have (on the server project) this class: @Remote(ConfigurationHelperRemote.class) @Local(ConfigurationHelperLocal.class) @Stateless public class ConfigurationHelper implements ConfigurationHelperRemote, ConfigurationHelperLocal { ... } and I have the remote Interface @Remote public interface

Injecting @Stateful bean into another @Stateful bean

非 Y 不嫁゛ 提交于 2019-12-24 12:17:44
问题 On a glassfish 3.1 server, I have a @Stateful session bean which is injected into another stateful session bean. The stateful session bean which is injected presents my entity access layer, it itself has it's EntityManager injected with @PersistenceContext and it looks like this. @Stateful MyEAO { @PersistenceContext EntityManager em; MyEAO() { // default constructor } .... } This access layer is injected into another stateful bean: @Stateful public class ShopAdmin implements

How to dependecy inject an EJB3 constructor?

回眸只為那壹抹淺笑 提交于 2019-12-24 12:02:19
问题 According to EJB3 DI documentation it is possible to inject fields and setters. But how to inject a bean constructor ? 回答1: The EJB specification does not support constructor injection. The EJB programming model only uses the no-arg constructor, and can then perform field or setter method injection after the instance has been constructed. That said, EJB 3.1 is part of EE 6, which includes CDI. If your EJB module is a CDI BDA (bean deployment archive) because it includes beans.xml, then you

EJB3 - Inject a MDB into another MDB?

天大地大妈咪最大 提交于 2019-12-24 11:04:52
问题 Since a message driven bean is a type of EJB, I would expect that I would be able to inject one into another, but I am having issues. I have to MDBs and need to inject one into the other something like this: @MessageDriven(mappedName = "jms/QueueOne") public class MessageBeanOne { @EJB private EntityService service; @EJB private MessageBeanTwo mdbTwo; public void onMessage(Message message) { log.info("Received message from jms/QueueOne: " + message); String entityId= null; try { if (message

Does ejb stateless class has to be public?

拜拜、爱过 提交于 2019-12-24 05:30:04
问题 Can @Stateless class have different modifiers than public? In documentation I have only found constraints of constructor/methods visibility, but nothing interesting about class level access. 回答1: According to ejb3-1 specification: 4.9.2 Session Bean Class The following are the requirements for the session bean class: • The class must be defined as public, must not be final, and must not be abstract. The class must be a top level class 来源: https://stackoverflow.com/questions/25867608/does-ejb

Does ejb stateless class has to be public?

半城伤御伤魂 提交于 2019-12-24 05:29:06
问题 Can @Stateless class have different modifiers than public? In documentation I have only found constraints of constructor/methods visibility, but nothing interesting about class level access. 回答1: According to ejb3-1 specification: 4.9.2 Session Bean Class The following are the requirements for the session bean class: • The class must be defined as public, must not be final, and must not be abstract. The class must be a top level class 来源: https://stackoverflow.com/questions/25867608/does-ejb

EJB creating using SessionBean EJBObject and EJBHome interfaces

时光总嘲笑我的痴心妄想 提交于 2019-12-24 03:32:13
问题 I am confused about creating EJB I have seen many samples of EJB on the internet and also sample project in which an EJB is developed using SessionBean , EJBObject and the EJBHome interfaces. In some other examples EJB is created without these interfaces and using only one or two interfaces e.g. if its locally accessible, javax.ejb.Local interface is used while for remotely access javax.ejb.Remote is used. So i am confused about creating EJB. What is the difference between these two type? I