ejb

Thread creation in JavaEE EJB/Web containers

痴心易碎 提交于 2019-12-21 22:01:49
问题 I read in Adam Bien's JavaEE night hacks book that while thread creation is prohibited on EJB containers, this is not the case for web containers. He actually creates a thread pool executor in his x-ray probe which runs on Tomcat. I'm a little confused now. While I faced situations in which I had to do manual thread-pool management in an EE app, I can somehow understand why it would be a bad idea to manually create threads in a JavaEE container. However, I don't understand the difference

Thread creation in JavaEE EJB/Web containers

故事扮演 提交于 2019-12-21 21:51:03
问题 I read in Adam Bien's JavaEE night hacks book that while thread creation is prohibited on EJB containers, this is not the case for web containers. He actually creates a thread pool executor in his x-ray probe which runs on Tomcat. I'm a little confused now. While I faced situations in which I had to do manual thread-pool management in an EE app, I can somehow understand why it would be a bad idea to manually create threads in a JavaEE container. However, I don't understand the difference

How JTA/JTS handle transaction time out issue?

[亡魂溺海] 提交于 2019-12-21 20:49:07
问题 Below is my understand that JTA/ JTS handle transaction time out issue. But I cannot find my document or material to back my understand. Is my understand right? Do u know any material is refer to this issue? Application Server iterates through all the transactions to check timeout. If a transaction timeout occurs, application server marks roll back for the transaction, and log down the detail. But Application Server neither throws exception nor interrupts the transaction this moment. When the

java.lang.NullPointerException upon EntityManager injection in Spring repository

一笑奈何 提交于 2019-12-21 20:35:08
问题 I am new to Spring MVC. I've been searching for few days for a solution to my problem, without any success. Here is my stack: jBoss 4.2.3GA server I know it's a very old version, but that is what I am limited to right now. jBoss 7.1 will be approved for use in my organization within the next few months, but I would like to make my R&D application work in the 4.2.3GA server. That means I have added all required jars in my /lib folder. Spring MVC 4.0.2 EJB3.0 / JPA for persistence DBMS is

Using @Transactional with EJBs

房东的猫 提交于 2019-12-21 20:04:38
问题 Is it ok to use @Transactional with EJBs? Is there any difference between using @TransactionAttribute ? I found already here Difference between @Transactional and @TransactionAttribute that @Transactional is for POJO. I've used it accidently for EJB in Wildfly and there were no errors. I wonder whether the behaviour would be the same or if there are some differences. Or maybe @Transactional would be just ignored and default level of @TransactionAttribute would be used? I've search in the spec

EJB 3.1 Dependency Injection Failed

二次信任 提交于 2019-12-21 17:52:47
问题 i have created a stateless session bean like this : @WebServlet(name = "ProductController", urlPatterns = {"/ProductController"}) public class ProductController extends HttpServlet { @EJB private ProductFacadeBean productBean; } @Stateless public class ProductFacadeBean extends AbstractFacade<Product> implements ProductFacadeLocalInterface { @PersistenceContext(unitName = "OnlineStorePU") private EntityManager em; protected EntityManager getEntityManager() { return em; } public

EJB2 on different JBoss versions

我们两清 提交于 2019-12-21 17:36:50
问题 I need to use some EJBs which are deployed on JBoss version 4.x from another EJB deployed on JBoss version 3.2.x. Is this possible? I ask because I have a third party application which uses some strange bridge's to do that and don't know why (though I haven't try to do this on my own). 回答1: This is unfortunately not possible. One of the major drawbacks of remote EJBs is that there is nothing in the specification that guarantees or even suggests any kind of interoperability between different

“Unable to convert ejbRef for ejb” on CDI (Weld) injection of @Stateless EJB into @SessionScoped JSF2 bean in Glassfish

99封情书 提交于 2019-12-21 12:33:10
问题 [ UPDATE : After discussion on the Glassfish forums/ML at http://forums.java.net/jive/thread.jspa?messageID=480532 a bug was filed against Glassfish https://glassfish.dev.java.net/issues/show_bug.cgi?id=13040 for this issue.] I'm trying to inject a local no-interface view of a @Stateless EJB into a JSF2 @Named @javax.enterprise.context.SessionScoped backing bean. The EJB is one of several that extend an abstract generic base class. Injection of "@Inject TheEJBClass varName" fails with "Unable

Threading in an Application Server

僤鯓⒐⒋嵵緔 提交于 2019-12-21 07:35:49
问题 I have a Java program/thread that I want to deploy into an Application Server (GlassFish). The thread should run as a "service" that starts when the Application Server starts and stops when the Application Server closes. How would I go about doing this? It's not really a Session Bean or MDB. It's just a thread. 回答1: Check out the LifecycleListener interface: http://glassfish.java.net/nonav/docs/v3/api/index.html?com/sun/appserv/server/LifecycleListener.html http://docs.oracle.com/cd/E18930_01

Exposing EJB method as REST service

孤者浪人 提交于 2019-12-21 04:55:08
问题 In J2EE 6 you can expose your EJB session bean as a REST web service as below @Stateless @Path("/test") public class TestSessionBean { @GET @Produces("application/xml") public String getTest() { return "<?xml version='1.0' encoding='UTF-8'?><val>test session bean</val>"; } } This works when I packaged the EJB in the .war, however, when I try to package my project into separate web and ejb modules inside an EAR I get an HTML 404 not found error. Can someone please explain? I'm using Glassfish