ejb-3.2

Are activation specs required for message-driven beans?

流过昼夜 提交于 2021-01-27 18:56:24
问题 I have a non-JMS MDB that I'm installing into a Websphere Liberty server. package mdb.test; import javax.ejb.MessageDriven; @MessageDriven() public class TheMDB implements MyOwnListener { public TheMDB() {} @Override public void onMyOwnMessage(MyOwnMessage message) {} } Without further configuration, the server gives the following message: [WARNING ] CNTR4015W : The message endpoint for the TheMDB message-driven bean cannot be activated because the mdb.test/TheMDB activation specification is

How to react on a EJB3 transaction commit or rolleback?

雨燕双飞 提交于 2019-12-13 03:48:40
问题 I have implemented a Service as a stateless session EJB (3.2) to store data via JPA. In addition the EJB also updates a Lucene Index each time data is updated. The session bean is container managed. The code of the ejb looks like this: @Stateless @LocalBean public class DataService { .... public Data save(Data myData) { // JPA work.... ... // update Lucene index .... } .... } I have different other BusinessService-EJBs calling this DataService EJB to insert or update data. I have no control

Stateless Session Beans Identity with @EJB and @Inject

做~自己de王妃 提交于 2019-12-12 09:07:05
问题 I have been looking into section 3.4.7.2 of the EJB3.2 specifications lately und done some tests. The specifications: @EJB Cart cart 1 ; @EJB Cart cart 2 ; … if (cart1.equals(cart1)) { // this test must return true ...} … if (cart 1 .equals(cart 2 )) { // this test must also return true ...} The equals method always returns true when used to compare references to the same business interface type of the same stateless session bean. The specifications cite explicitly the @EJB Annotation so I

EJB3: Right way to insert initial data when application starts like Grails Bootstrap?

本秂侑毒 提交于 2019-12-12 01:59:43
问题 Similar to Bootstrap.groovy in Grails, how to add some initial data when an app starts? Since in @PostContstruct method, the EntityManager is not available in Stateless session beans (or am I doing something wrong?), so what should be the right way to insert some initial data? E.g. I want to add one Admin account in my system when the application starts. 回答1: Since in @PostContstruct method, the EntityManager is not available This is not true, @PostConstruct is usually the right place where

“Unexpected invocation state 0” error in Wildfly

大憨熊 提交于 2019-12-11 06:15:42
问题 I created a small example that demonstrates the error. A stateful bean holds a list as its state and injects a stateless bean: @Stateful @RequestScoped public class StatefulBean { @Inject StatelessBean slsb; @Getter // public list getter private List<String> list = new ArrayList<>(); public List<String> sfAdd() { slsb.slAdd(); System.out.println(list); list.add("Z"); return list; } } The stateless bean manipulates the state of the stateful bean by injection: @Stateless public class

WildFly: EJB invocations from a remote client

余生颓废 提交于 2019-12-11 03:17:38
问题 I was trying to lookup and call an EJB deployed as EAR in WildFly. I have tried different ways. Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); properties.put(Context.PROVIDER_URL, "remote://localhost:4447"); properties.put(Context.SECURITY_PRINCIPAL, myUser); properties.put(Context.SECURITY_CREDENTIALS, myPassword); properties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

Stateless Session Beans Identity with @EJB and @Inject

巧了我就是萌 提交于 2019-12-04 15:33:32
I have been looking into section 3.4.7.2 of the EJB3.2 specifications lately und done some tests. The specifications: @EJB Cart cart 1 ; @EJB Cart cart 2 ; … if (cart1.equals(cart1)) { // this test must return true ...} … if (cart 1 .equals(cart 2 )) { // this test must also return true ...} The equals method always returns true when used to compare references to the same business interface type of the same stateless session bean. The specifications cite explicitly the @EJB Annotation so I did some tests and I could confirm - if (cart1.equals(cart2)) return always true - the identities

Create Three Tier Application using Maven

前提是你 提交于 2019-12-03 23:09:41
问题 I want to create a multi-layer java project using maven as follows: PresentationLayer-GUIModule (top most layer for jsp/jsf pages) PresentationLayer-GatewayModule (topmost layer for web services) BusinessLayer-ServiceModule (middle layer) DataAccessLayer (lowermost layer) CommonLayer (vertical layer which is accessible from all layers) Maven Module Structure: root pom EAR pom GUIModule pom GatewaModule pom ServiceModule pom DataAccessLayer pom CommonLayer pom I have create a project called

Create Three Tier Application using Maven

∥☆過路亽.° 提交于 2019-12-01 01:48:04
I want to create a multi-layer java project using maven as follows: PresentationLayer-GUIModule (top most layer for jsp/jsf pages) PresentationLayer-GatewayModule (topmost layer for web services) BusinessLayer-ServiceModule (middle layer) DataAccessLayer (lowermost layer) CommonLayer (vertical layer which is accessible from all layers) Maven Module Structure: root pom EAR pom GUIModule pom GatewaModule pom ServiceModule pom DataAccessLayer pom CommonLayer pom I have create a project called flashcard with the following pom configurations: root pom: <project xmlns:xsi="http://www.w3.org/2001