Questions tagged [ejb-3.0]

This tag is used for question related to the session bean and message-driven bean component types of the EJB 3.0 programming model. For questions about the persistent entities defined in the document "Java Persistence API" of the EJB 3.0 specification, use the [JPA] tag.

JSR 220: Enterprise JavaBeans 3.0

The Enterprise JavaBeans architecture is a component architecture for the development and deployment of component-based business applications.

The purpose of Enterprise JavaBeans (EJB) 3.0 is to improve the EJB architecture by reducing its complexity from the developer's point of view.

The goal of EJB 3.0 is to target ease of development, the main theme of the Java EE 5 platform release. EJB 3.0 is a major simplification over the APIs defined by the EJB 2.1 and earlier specifications. The simplified EJB 3.0 API allows developers to program EJB components as ordinary Java objects with ordinary Java business interfaces rather than as heavy weight components. Both component and client code are simplified, and the same tasks can be accomplished in a simpler way, with fewer lines of code. Because it is much simpler, EJB 3.0 is also much faster to learn to use than EJB 2.1.

2345 questions
15
votes
2 answers

Embedding images into html email with java mail

I am sending html and images with javamail but for some reason I don't see the images as part of the html, I see them only as an attachment. I don't know why is that. This is how it looks like when one of my users receive an email: I would like to…
javing
  • 12,307
  • 35
  • 138
  • 211
15
votes
2 answers

How to limit the number of MDB instances listening to a Jboss JMS queue

I'm having a problem with the following setup: A Java application send email msg to a JMS queue, then an MDB listening to the queue get the email msg with the onMessage method, it open a connection on the Gmail SMTP, send the email to the SMTP and…
Alain
  • 237
  • 1
  • 4
  • 13
15
votes
1 answer

Stateful EJBs in web application?

I never used stateful EJBs. I understand that a stateful EJB can be useful with a java client. But i wonder: in which case to use them on a web application? And how? Should we put these stateful beans in Session (because of stateless http)? Is it…
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419
15
votes
5 answers

How to receive Email in Java EE application

Obviously it's not so difficult to send out emails from a Java EE application via JavaMail. What I am interested in is the best pattern to receive emails (notification bounces, mostly)? I am not interested in IMAP/POP3-based approaches (polling the…
Hank
  • 4,597
  • 5
  • 42
  • 84
15
votes
7 answers

JBoss transaction timeout setting?

We have a timer service triggered task in JBoss 5.1.0.GA application and the problem is that we cannot change the transaction time out. This long Lucene indexing can take longer than the default 300 second limit. The question is how to change the…
Petteri H
  • 11,779
  • 12
  • 64
  • 94
15
votes
1 answer

No EJB receiver available for handling

I'm using EJB 3.0 with JBoss AS 7.1.1 Final. I am getting this error when I try to connect my client to the server: Aug 15, 2012 12:05:00 PM org.jboss.ejb.client.EJBClient INFO: JBoss EJB Client version 1.0.5.Final Exception in thread…
Graham
  • 5,488
  • 13
  • 57
  • 92
14
votes
2 answers

Mocking Reflection based calls

I am trying to mock some reflection based methods. Below you can see the details, Class Under Test public class TracerLog { @AroundInvoke public Object logCall(InvocationContext context) throws Exception { Logger logger = new…
Bala
  • 1,193
  • 2
  • 12
  • 34
14
votes
5 answers

Can an EJB3 bean "self inject" and call its own methods via EJB container?

Is it possible to "self inject" an EJB in order to call local methods as bean methods? There are some cases where this could be favorable, for example if container managed transactions are used and something should be accomplished in a new…
tputkonen
  • 5,579
  • 16
  • 60
  • 88
14
votes
1 answer

What's the point of using @Scoped with EJBs?

Usually I'm using @RequestScoped or @SessionScoped (from javax.enterprise.context) to inject objects (for instance in faces beans) using @Inject. I am also using EJBs. As I understood, a set of stateless EJB copies (pool) is used to be injected to…
konrad.kruczynski
  • 46,413
  • 6
  • 36
  • 47
14
votes
2 answers

javax.naming.NameNotFoundException

I am running an example of ejb using JBoss5 Container. I am using an example from here(Part one). In the example I deployed bean in JBoss and an application in Tomcat(to acces the bean from JBoss). I am getting the error in the screen of tomcat…
sjain
  • 1,635
  • 9
  • 25
  • 35
13
votes
2 answers

What is the best way to unit test a EJB3 component without having to deploy the component

I would like to have a JUnit (or other) system where the enterprise beans can be tested in a mock environment so that all resources/beans and so on are injected locally. The enterprise beans should not have to accomplish this. All kinds of injection…
Bruno Ranschaert
  • 7,428
  • 5
  • 36
  • 46
13
votes
4 answers

Inject a EJB into a JSF converter with JEE6

I have a stateless EJB that acceses my database. I need this bean in a JSF 2 converter to retreive an entity object from the String value parameter. I'm using JEE6 with Glassfish V3. @EJB annotation does not work and gets a NPE, because it's in the…
Michael Bavin
  • 3,944
  • 6
  • 31
  • 35
13
votes
2 answers

Why use stateful session beans?

I'm learning EJB3 and I'm just curious when it's convenient to use SFSB? I can't find any nice example when SFSB realy solve easily some complex problem. Actually I see that SLSB can be used as web-services and this is convenient. But I don't know…
Roman
  • 64,384
  • 92
  • 238
  • 332
13
votes
2 answers

EJB 3.0 exceptions handling

A quote from the EJB specification: If the bean method encounters a system exception or error, it should simply propagate the error from the bean method to the container (i.e., the bean method does not have to catch the exception). But I don't…
WelcomeTo
  • 19,843
  • 53
  • 170
  • 286
12
votes
5 answers

JavaEE 6: javax.naming.NameAlreadyBoundException: Use rebind to override

I have a business interface being implemented by two EJBs. UserManagementService @Remote public interface UserManagementService { // ... } UserManagementServiceJpaImpl @Stateless(name="userManagementServiceJpaImpl") public class…
skip
  • 12,193
  • 32
  • 113
  • 153