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
26
votes
3 answers

No entity found for query Exception

I am executing the following lines: String queString = "some query string" Query q1 = em.createNativeQuery(queString, T03CallsLog.class); T03CallsLog newCall; newCall = (T03CallsLog) q1.getSingleResult(); //this line cause the exception…
rayman
  • 20,786
  • 45
  • 148
  • 246
25
votes
3 answers

JavaEE6 DAO: Should it be @Stateless or @ApplicationScoped?

I'm currently creating an EJB3 Data Access Class to handle all database operations in my Java EE 6-application. Now, since Java EE 6 provides the new ApplicationScoped annotation, I wonder what state my EJB should have, or if it should be stateless.…
Wolkenarchitekt
  • 20,170
  • 29
  • 111
  • 174
24
votes
2 answers

EJB: Avoid Transaction rollback

When a (transactional) method of an EJB calls another (transactional) method of another EJB, and an exception is thrown in the second, but catched in the first one, it seems that the transaction is automatically rolled back when the second one…
Mr.Eddart
  • 10,050
  • 13
  • 49
  • 77
24
votes
4 answers

.NET - vs EJB

What is the comparable technology of EJB (Enterprise Java Beans) in .net?
user366312
  • 16,949
  • 65
  • 235
  • 452
23
votes
1 answer

What is the relationship between java:comp/env and java:global?

What is the relationship between java:comp/env and java:global (regarding 3.1 spec)? Seems like java:comp/env contains specific to EJB references. What means "specific" in this case?
Yamahar1sp
  • 510
  • 1
  • 6
  • 13
23
votes
3 answers

EJB Transactions in local method-calls

In the following setup, does method B run in a (new) transaction? An EJB, having two methods, method A and method B public class MyEJB implements SessionBean public void methodA() { doImportantStuff(); methodB(); …
Koos Gadellaa
23
votes
5 answers

How do I get the @RolesAllowed annotation to work for my Web application?

I am making a Web application using Backbone.js, Bootstrap, NetBeans IDE 8.0, Java EE 7, JDK 8, WildFly server 8.1.0, JBoss RESTEasy (resteasy-jaxrs-3.0.8), JBoss 2.2.22, JBoss EJB 3. I am (relatively) new to Web development, and as such I have only…
PJvG
  • 1,310
  • 3
  • 16
  • 33
23
votes
3 answers

Best practice for serialization for EJB and CDI beans

I have not yet experienced any serialization-related issues. But PMD and Findbugs detect a bunch of potential problems regarding seriazation. A typical case is an injected logger that is being detected as non-serializable. but there are many more -…
kostja
  • 60,521
  • 48
  • 179
  • 224
23
votes
4 answers

How to catch and wrap exceptions thrown by JTA when a container-managed-tx EJB commits?

I'm struggling with a problem with an EJB3 class that manages a non-trivial data model. I have constraint validation exceptions being thrown when my container-managed transactional methods commit. I want to prevent them from being wrapped in…
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778
21
votes
4 answers

Thread.sleep() in an EJB

I know that messing with threads inside an EJB is a big no-no, but I would just like to ask for advice on how handle this case. My EJB is calling an external Web service which may sometimes return a "busy" status. When that happens, I would like to…
Ariod
  • 5,757
  • 22
  • 73
  • 103
21
votes
6 answers

JPA using alternative "persistence.xml"

I know that with the instruction: Persistence.createEntityManagerFactory("persistence-unit-name"); The JPA persistence mechanism reads the "persistence.xml" file, looks for the persistence unit called "persistence-unit-name", and constructs the…
Mr.Eddart
  • 10,050
  • 13
  • 49
  • 77
21
votes
5 answers

Fetch Logged In Username in a webapp secured with Keycloak

I have secured an enterprise application with Keycloak using standard wildfly based Keycloak adapters. Issue that I am facing is that the rest web services when invoked, needs to know the username that is currently logged in. How do I get the logged…
aksappy
  • 3,400
  • 3
  • 23
  • 49
21
votes
4 answers

Where to find an EJB3 tutorial?

I want to learn EJB3. Anyone could suggest some good tutorial website for it?
Ajaya
21
votes
2 answers

Persistence.xml not correctly configured

I'm not able to get this persistence file correct... I do not find any more information in the book that I use as a guide. I'm using a MySQL database.
mmvie
  • 2,571
  • 7
  • 24
  • 39
20
votes
2 answers

Java EE 6 : @Inject and Instance

I have a question about the @Inject annotation in java ee 6 : What is the difference between : @Inject private TestBean test; @Inject private Instance test2; To have the reference : test2.get(); Some infos about Instance :…
jihedMaster
  • 331
  • 1
  • 3
  • 11