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
20
votes
1 answer

JSF managed-bean EJB injection

I have an EJB (PersonManager) in the Enterprise Application modul, which injects another EJB (Person): @Stateful public class PersonManager implements PersonManagerLocal { @EJB private PersonLocal person; @Override public void…
Forty
  • 420
  • 1
  • 5
  • 10
20
votes
4 answers

Relationship between EJB 3.0 and JPA?

That may seem obvious but I've seen contradictory statements: Is JPA part of EJB 3.0? I'm no specialist and it's quite confusing for me. If so, JPA manipulates Entity Beans? These entity beans being the interface between the persistence layer and…
LB40
  • 12,041
  • 17
  • 72
  • 107
20
votes
1 answer

Difference between a managed bean and a session bean

Say I have an Entity class, Car.  @Entity public class Car My IDE lets me automatically generate session beans from entity classes, so I end up with a CarFacade @Stateless public class CarFacade I can also generate JSF Managed beans @ManagedBean …
Laurens
  • 2,078
  • 5
  • 29
  • 46
20
votes
8 answers

javax.persistence.NoResultException: getSingleResult() did not retrieve any entities

i have created a namedquery with ejb to check if the username is used. When the singleResult is null, then i get the following Exception : javax.persistence.NoResultException: getSingleResult() did not retrieve any entities But this exception is…
apple1988
20
votes
2 answers

Java EE 7: How-to inject an EJB into a WebSocket ServerEndpoint?

To sum up my failing project: My @ServerEndpoint class is packaged in a WAR together with the beans.xml file. My WAR in turn is packaged in a EAR and this EAR file is what gets deployed to a GlassFish 4 server that internally use Tyrus. Should it be…
Martin Andersson
  • 18,072
  • 9
  • 87
  • 115
20
votes
2 answers

JEE7: Do EJB and CDI beans support container-managed transactions?

Java EE7 consists of a bunch of "bean" definitions: Managed Beans 1.0 (JSR-316 / JSR-250) Dependency Injection for Java 1.0 (JSR-330) CDI 1.1 (JSR-346) JSF Managed Beans 2.2 (JSR-344) EJB 3.2 (JSR-345) In order to get rid of the chaos in my mind,…
SputNick
  • 1,231
  • 5
  • 15
  • 26
19
votes
8 answers

Hibernate SQL In clause making CPU usage to 100%

In my java application I am using SQL server and Hibernate3 with EJB. When I tried to execute a select query with In clause, the DB server CPU usage reaches to 100%. But when I tried to run the same query in SQL management studio, the query is…
Jaya Ananthram
  • 3,433
  • 1
  • 22
  • 37
19
votes
2 answers

Class bytes found but defineClass()failed for error when deploying EAR

I am trying to deploy and old code base with EJB 1.1 stuff to Weblogic 10.3.6 and keep getting this strange error Class bytes found but defineClass()failed for. The classes are there and being found what is causing this?
user177800
19
votes
2 answers

Cannot import javax.ejb.* packages

I am having trouble in building an EJB session bean. The following packages cannot be found: import javax.ejb.LocalBean; import javax.ejb.Stateful; import javax.ejb.TransactionManagement; import javax.ejb.TransactionManagementType; Some solutions…
Sebi
  • 4,262
  • 13
  • 60
  • 116
19
votes
1 answer

What does adding the @Stateful or @Stateless annotations actually do?

I'm just getting to grips with Java EE. I know that adding @Stateful or @Stateless annotations to a class will make it an EJB bean. But what is actually happening in the background once I do that? I see the following listed on Wikipedia in relation…
sonicboom
  • 4,928
  • 10
  • 42
  • 60
19
votes
2 answers

GlassFish Error: JAX-RS EJB support is disabled

I am trying a simple app using Jersey JAX-RS + EJB 3.1 on GlassFish 3.1.2.2. All seemed to look pretty well with Jersey REST on GlassFish until I added EJB. When deploying the war file, I got this error. SEVERE: Error when configuring to use the EJB…
Adrian M
  • 7,047
  • 7
  • 24
  • 26
18
votes
3 answers

Can I (and how) lookup CDI managed beans using javax.naming.Context#lookup in EJB module?

Can I (and if so, how?) lookup CDI managed beans using javax.naming.Context#lookup in EJB module? I'm using GlassFish v3. I suppose that I can use @Named, but what is JNDI name of CDI managed bean? I want to lookup them from unmanaged POJOs so I…
zacheusz
  • 8,750
  • 3
  • 36
  • 60
18
votes
4 answers

JSF2 - backed by EJB or ManagedBean?

As I am learning JSF2, I realized I am not sure what the backing components should be. From design point of view, what is the difference between EJBs and @ManagedBeans? In the end I am going to use JPA, so EJB is a natural choice for business layer.…
Konrad Garus
  • 53,145
  • 43
  • 157
  • 230
18
votes
1 answer

Error assembling EJB: META-INF/ejb-jar.xml is required for ejbVersion 2.x

Is there a way to build with maven an EJB project that doesn't contain deployment descriptor?
bob-cac
  • 1,272
  • 2
  • 17
  • 35
17
votes
2 answers

Can I use CDI constructor injection for EJBs?

I want to do something like this: @Stateless public class GreeterEjb { private final Greeter greeter; @Inject public GreeterEjb(Greeter greeter) { this.greeter = greeter; } public String greet() { return…
Arend v. Reinersdorff
  • 4,110
  • 2
  • 36
  • 40