ejb-3.0

Not able to deploy EAR file

梦想的初衷 提交于 2019-12-02 15:55:57
问题 I am developing a web module in struts2 framework and ejb module in eclipse with hibernate as ORM framework. Every time when I modify my ejb module I have to package it into jar and include it in my web module /WEB-INF/lib folder in order to run my whole application. Though the application worked fine in this way but it was really time consuming. So I tried to map them in a EAR module. But when I try to run EAR module. It gives below exceptions 2016-12-24 13:23:43,992 ERROR [org.apache

Why should we use EJB? [closed]

≡放荡痞女 提交于 2019-12-02 15:32:21
What is EJB, and why we should use it? Please explain in simple language. Thank you. Ernesto Campohermoso The EJB or Enterprise Java Beans are plain java classes (since version 3.0) with annotations that enable to you write the business logic of your applications and later deploy it (or install) on a Java Enterprise Edition Server. You must consider use EJB if you wish to take advantage of the following services provided by the Java Enterprise Edition (Java EE) server: Clustering. You can deploy your EJB on a cluster environment (dependent of Java EE Application Server), this provides to you

Configuring an MDB in JBOSS

南楼画角 提交于 2019-12-02 14:30:54
问题 How maxMessages property affects the MDB? For example: @ActivationConfigProperty(propertyName = "maxMessages", propertyValue="5"). How would this value affect if maxSessions is 10? 回答1: The JBoss docs are a bit wooly on this, they say MaxMessages is defined as The number of messages to wait for before attempting delivery of the session, each message is still delivered in a separate transaction (default 1) I think you were wondering if it affects the number of threads or concurrent sessions

Websphere 7 EntityManagerFactory creation problem

柔情痞子 提交于 2019-12-02 09:58:31
问题 I'm working on a maven project which uses seam 2.2.0, hibernate 3.5.0-CR-2 as JPA provider, DB2 as database server and Websphere 7 as application server. Now I'm facing de following problem: In my EJBs that are seen also as SEAM components I want to use the EntityManager from EJB container (@PersistenceContext private EntityManager em) not Seam's EntityManager (@In private EntityManager em). But this is the problem, I cannot obtain an EntityManager using @PersistenceContext. On server logs it

EJB3.0 Serializing a handle to a Stateful Bean

感情迁移 提交于 2019-12-02 08:23:03
问题 I'm attempting to persist the remote handle to a Stateful EJB3.0 bean. This bean's interface is defined: @Remote public interface Hello extends Serializable { Handle getHandle(); void sayHello(); } The implementation is: @Stateful @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class HelloBean implements Hello { @Resource private SessionContext ctx; @Override public Handle getHandle() { try { return ctx.getEJBObject().getHandle(); } catch (Exception e) { throw new

java.lang.ClassCastException with the same class object

不问归期 提交于 2019-12-02 07:36:05
问题 This piece of code irritates me, sometimes it working and some other times it doesn't ! The NamedQuery : (name = "User.findByLogin", query = "SELECT u FROM User u WHERE u.login = :login") public User findByLogin(String login) { Query query = em.createNamedQuery("User.findByLogin"); query.setParameter("login", login); try { return (User) query.getSingleResult(); } catch (javax.persistence.NoResultException ex) { return null; } } The error make me crazy ! Avertissement: EJB5184: A system

Difference between Entity bean and Entity class?

时光毁灭记忆、已成空白 提交于 2019-12-02 07:25:50
问题 What are the differences between entity beans which are in the EJB 2.0 specification and entity classes which in the 3.0 specification? 回答1: In EJB 2, entity was a bean meaning that it had to live in a container and need to be managed (similar to other beans, say stateful, stateless, message driven beans). However in EBJ 3.x, entity is a POJO class - meaning that it can live outside container also.. plain java application can make use of entities as ORM layer with any providers supporting it.

Websphere 7 EntityManagerFactory creation problem

爷,独闯天下 提交于 2019-12-02 04:49:30
I'm working on a maven project which uses seam 2.2.0, hibernate 3.5.0-CR-2 as JPA provider, DB2 as database server and Websphere 7 as application server. Now I'm facing de following problem: In my EJBs that are seen also as SEAM components I want to use the EntityManager from EJB container (@PersistenceContext private EntityManager em) not Seam's EntityManager (@In private EntityManager em). But this is the problem, I cannot obtain an EntityManager using @PersistenceContext. On server logs it sais that it cannot create an EntityManagerFactory and gets a ClassCastException: java.lang

EJB3.0 Serializing a handle to a Stateful Bean

北战南征 提交于 2019-12-02 04:30:01
I'm attempting to persist the remote handle to a Stateful EJB3.0 bean. This bean's interface is defined: @Remote public interface Hello extends Serializable { Handle getHandle(); void sayHello(); } The implementation is: @Stateful @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class HelloBean implements Hello { @Resource private SessionContext ctx; @Override public Handle getHandle() { try { return ctx.getEJBObject().getHandle(); } catch (Exception e) { throw new RuntimeException(e); } } @Override public Handle sayHello() { System.out.println("hello"); } } According to

java.lang.ClassCastException with the same class object

核能气质少年 提交于 2019-12-02 03:58:37
This piece of code irritates me, sometimes it working and some other times it doesn't ! The NamedQuery : (name = "User.findByLogin", query = "SELECT u FROM User u WHERE u.login = :login") public User findByLogin(String login) { Query query = em.createNamedQuery("User.findByLogin"); query.setParameter("login", login); try { return (User) query.getSingleResult(); } catch (javax.persistence.NoResultException ex) { return null; } } The error make me crazy ! Avertissement: EJB5184: A system exception occurred during an invocation on EJB UserFacade , method: public dz.admin.entity.User dz.admin