Questions tagged [ejb]

Enterprise JavaBeans (EJB) is a managed, server-side component architecture for modular construction of enterprise applications. The EJB specification is one of several [Java] APIs in the [Java EE] specification.

Enterprise JavaBeans (EJB) is a managed, component architecture for modular construction of enterprise applications which runs on an . The EJB specification is one of several APIs in the specification.

See also and

Tutorials

JBoss 4 EJB 3 Tutorial

JBoss 5 EJB 3 Tutorial

Video Tutorials

EJB Video Training

Reference :

Wikipedia

Oracle

6693 questions
190
votes
6 answers

What exactly is Java EE?

I have been doing Java SE for some years now and moving on to Java EE. However, I have some trouble understanding some aspects of Java EE. Is Java EE just a specification? What I mean is: Is EJB Java EE? Are EJB/Spring different implementations…
Frank Zimmer
  • 1,919
  • 3
  • 12
  • 3
189
votes
4 answers

EJB's - when to use Remote and/or local interfaces?

I'm very new to Java EE and I'm trying to understand the concept of Local interfaces and Remote interfaces. I've been told that one of the big advantages of Java EE is that it is easy to scale (which I believe means you can deploy different…
Brian DiCasa
  • 9,369
  • 18
  • 65
  • 97
167
votes
9 answers

Should I use @EJB or @Inject

I have found this question: What is the difference between @Inject and @EJB but I did not get any wiser. I have not done Java EE before nor do I have experience with dependency injection so I do not understand what I should use? Is @EJB an old way…
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
163
votes
5 answers

What is an EJB, and what does it do?

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…
jacktrades
  • 7,224
  • 13
  • 56
  • 83
154
votes
11 answers

Why are data transfer objects (DTOs) an anti-pattern?

I've recently overheard people saying that data transfer objects (DTOs) are an anti-pattern. Why? What are the alternatives?
ntownsend
  • 7,462
  • 9
  • 38
  • 35
136
votes
3 answers

Where to use EJB 3.1 and CDI?

I am making a Java EE based product in which I'm using GlassFish 3 and EJB 3.1. My application has session beans, a scheduler and uses web services. I recently came to know about Apache TomEE, which supports Contexts and Dependency Injection (CDI).…
Dhrumil Shah
  • 2,128
  • 5
  • 23
  • 37
121
votes
5 answers

Cannot instantiate the type List

I have the following code: List product = new List(); The error: Cannot instantiate the type List Product is an Entity in my EJB project. Why I'm getting this error?
Emanuel
  • 6,622
  • 20
  • 58
  • 78
111
votes
3 answers

How do CDI and EJB compare? interact?

I'm having a tough time understanding how the two interact and where the boundary between them lies. Do they overlap? Are there redundancies between them? I know there are annotations associated with both, but I haven't been able to find a complete…
Tim
  • 6,851
  • 11
  • 42
  • 46
98
votes
7 answers

Stateless and Stateful Enterprise Java Beans

I am going through the Java EE 6 tutorial and I am trying to understand the difference between stateless and stateful session beans. If stateless session beans do not retain their state in between method calls, why is my program acting the way it…
Stanley kelly
  • 1,088
  • 1
  • 8
  • 9
89
votes
2 answers

When to use Stateful session bean over Stateless session bean?

A stateful session bean is defined as follows: Stateful Session Beans The state of an object consists of the values of its instance variables. In a stateful session bean, the instance variables represent the state of a unique client-bean…
sheidaei
  • 9,842
  • 20
  • 63
  • 86
86
votes
2 answers

What is local/remote and no-interface view in EJB?

I am trying to understand what the purpose and why we need the different client views in EJB. Could someone try to explain?
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
80
votes
3 answers

EJB 3.1 @LocalBean vs no annotation

I understand the difference between local view, remote view and no-interface view. I just don't understand what is the difference between "no view" (no annotation) and no-interface view. And also why should I annotate my interface with @Local? What…
VaclavDedik
  • 1,960
  • 4
  • 20
  • 27
73
votes
7 answers

Inject an EJB into JAX-RS (RESTful service)

I'm trying to inject a Stateless EJB into my JAX-RS webservice via annotations. Unfortunately the EJB is just null and I get a NullPointerException when I try to use it. @Path("book") public class BookResource { @EJB private BookEJB…
Zeck
  • 6,433
  • 21
  • 71
  • 111
59
votes
3 answers

Web Services vs EJB vs RMI, advantages and disadvantages?

My web server would be overloaded quickly if all the work were done there. I'm going to stand up a second server behind it, to process data. What's the advantage of EJB over RMI, or vice versa? What about web services (SOAP, REST)?
Dean J
  • 39,360
  • 16
  • 67
  • 93
50
votes
6 answers

Java EE Containers vs Web Containers

I'm relatively new to Java EE/EJB, and I've been reading a lot regarding Java EE containers. I've had experience working with a web container (WAR file in JBoss). I am also aware that JBoss can also be used as a Java EE container. What is the…
mel3kings
  • 8,857
  • 3
  • 60
  • 68
1
2 3
99 100