ejb-3.1

javax.ejb.NoSuchEJBException after redeploying EJBs

蹲街弑〆低调 提交于 2019-12-12 08:10:35
问题 Using Glassfish 3.0.1 ... If I have a web application accessing EJBs in another application remotely, and the remote application containing the EJBs is redeployed, I get a javax.ejb.NoSuchEJBException (see stacktrace below). Shouldn't this work? I can see that the EJB in question was successfully deployed, using the exact same JNDI name. Is there any other way to fix this than to restart the web application? It should be noted that in this particular example that the stacktrace is from, I'm

What is an EJB, and what does it do?

南笙酒味 提交于 2019-12-12 07:29:22
问题 Been trying to learn what EJB beans are, what does it mean their instances are managed in a pool, blah blah. Really can't get a good grip of them. Can you explain me what they really are (practically for a Java Programmer)? What do they do? Which are their purposes? Why really use them? (Why not just stick to POJO ?) Perhaps an example application? Please refer only to updated information, that is EJB 3.1 . Dated information about EJB can be misleading. For EJB learning beginners please note:

WebSphere embeddable EJB container with Hibernate throws java.lang.ClassNotFoundException: com.ibm.websphere.jtaextensions.SynchronizationCallback

我们两清 提交于 2019-12-12 04:57:50
问题 I am using the embeddable EJB container of WebSphere 8 to write some unit tests for my EJBs with JUnit4. I have a simple java project in MyEclipse where I reference the EJB project. The EJB project uses Hibernate 3.5 for persistence and the datasource JNDI in hibernate.cfg.xml is jdbc/connectionname which is defined in the properties of the embeddable container. The embeddable container starts successfully, the EJBs can be found successfully and the datasource is also found successfully.

Passing parameters between Request Scoped Managed Beans in JSF + EJB 3.1

依然范特西╮ 提交于 2019-12-12 03:48:29
问题 Our problem is a very basic, simple implementation of editing the database using JSF + EJB. Keeping things short: two separate XHTML views, use two separate Managed Beans @RequestScope. WebuserListBean and EditWebuserBean, and with @ManagedProperty we inject WebuserListBean, so we could obtain selected user data. So far no problems. Views are filled with data succesfully! BUT! We want to be able to edit the user! And here (to my surprise) we cannot overcome the problem. 1st try: Because the

Programming BMT - UserTransaction

ε祈祈猫儿з 提交于 2019-12-12 03:06:03
问题 Is the complete programming of BMT based on UserTransaction interface? In other words, if I want to use BMT, is there any scenario when I would require more services than those provided by the UserTransaction interface. Why this question? If I use a different implementation of the transaction manager (such as Bitronix TM or Atomikos) and not the default provided by the container, is it just enough to inject the new TM into UserTransaction object? -Thanks 回答1: This is really limited to what

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

(AS7) Error calling remote EJB method with proxified CDI bean in parameter

心不动则不痛 提交于 2019-12-12 00:05:22
问题 Can I call a remote EJB method with CDI bean in parameter method? Like this: I have a LoggedUserProducer.java thats produces a User from the database. public class LoggedUserProducer { @Produces @SessionScoped @LoggedUser public User produceLoggedUser() throws Exception { ... //load user from database with a request token return user; } } And I have a JSF Bean thats make the EJB call: CarController.java @Named @ViewScoped public class CarController implements Serializable { @Inject //I have a

Waiting at most X seconds for Async EJBs

ぃ、小莉子 提交于 2019-12-11 18:53:13
问题 I have a "client" EJB that invokes 4 Asynchronous EJB s and should give them all 5 seconds to run. After 5 seconds the "client" EJB collects the ready results from Future object that finished running, and returns output. I have a problem with the "waiting" in client part. I tried to invoke future.get(5, TimeUnit.MILLISECONDS) It seems like sometimes async EJB s start to run after the timeout. Is there a correct way to do it? 1) Collect Future objects in Map : Map<String, Future> futureMap =

WildFly - EJB invocations from a remote client - Operation failed with status WAITING

Deadly 提交于 2019-12-11 11:29:18
问题 Following is my code to invoke an ejb, but it wait for the connection and get failed. I changed the port to 4447 but no luck. private DataGridService lookupRemoteEJB() throws NamingException { Context context = null; try { Properties clientProperties = new Properties(); clientProperties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false"); clientProperties.put("remote.connections", "default"); clientProperties.put("remote.connection.default.port", "4447");

Within JTA transaction (using container managed transaction), executeUpdate mehtod for explicit Query does immediate commit

做~自己de王妃 提交于 2019-12-11 11:16:48
问题 Within JBOSS 7.1 AS, I'm using container managed transaction. For each request, I do several entity updates. Most of the entities use "insert, merge, refresh" methods from EntityManager to manage the updates. However, there is one entity that uses explicit Query to do "executeUpdate" on the DB (see below for the code snippet). This sql update is immediately commited to the DB and it is not aligned with container managed transaction (like other entity updates). Is there anyway align explicit