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
11
votes
2 answers

Use Arquillian to test secure EJB

I am using JBoss 6.1 and I got a secure EJB having methods annotated with @RolesAllowed("Admin"). I am trying to test this method with Arquillian. I have done the EJB log in successfully in the @Before of the test, however, it failed to invoke the…
Linh
  • 535
  • 1
  • 6
  • 13
11
votes
4 answers

collection vs list vs arrays as return type for EJB method

I was recently told that collection should be preferred to List as the return value of an EJB method. The argument is that in general collection is more generic i.e. gives you to change the underlying data structure without impacting the clients.…
Kiran Mohan
  • 2,696
  • 6
  • 36
  • 62
11
votes
3 answers

Persistence.xml where to put in eclipse project

Simple question... I have a few projects in Eclipse enviroment MainApp(Enterprise Application Project) which "includes" WebController (EJB Project) WebModel (JPA Project) WebView(Dynamic Web Project) Problem is where to put persistance.xml…
Marcin Petrów
  • 1,447
  • 5
  • 24
  • 39
11
votes
1 answer

what are java middleware technologies

What technologies can we name as 'Java Middleware'? If I say JMS, WS is that correct?
user668943
  • 535
  • 1
  • 5
  • 8
11
votes
3 answers

JPA: question about merging an entity before removing it

I know I have to merge the entity before removing it, but I never thought I have to do it inside EJB. First I have these: e = (Event) scholarBean.merge(e); scholarBean.remove(e); in my managed bean. It give me this…
Thang Pham
  • 38,125
  • 75
  • 201
  • 285
11
votes
3 answers

Why not use Session Beans instead of Message Driven Beans?

I'm wondering, why not use Session Beans instead of Message Driven Beans ? If you can call remote methods from EJBs, so why bother sending/receiving messages with Message Driven Beans (which is more difficult to develop than session beans) ? In…
mohamida
  • 804
  • 2
  • 11
  • 25
11
votes
1 answer

Cannot inject bean of non-serializable type into bean of passivating scope

I'm learning Java EE 7. I'm trying to store the user session in a @SessionScoped Backing Bean but my IDE is telling me that I have an error because "Cannot inject bean of non-serializable type into bean of passivating scope". The @SessionScoped…
Pepe Fernandez
  • 145
  • 1
  • 8
11
votes
1 answer

When using @EJB, does each managed bean get its own @EJB instance?

I am using JSF 2.2 for a web project and I am implementing the login page now. I have a login.xhtml that serves as the view, and a backing bean called UserLoginView. This bean has an EJB property bean private UserService userService (as shown…
Chris
  • 3,619
  • 8
  • 44
  • 64
11
votes
5 answers

Extensible/adaptable Java EE application: interfaces vs interceptors and decorators

We are currently in the process of analyzing the technical requirements for a new version of a Java EE application. It's Java EE 6, but moving onto 7 is an option. Until now this was a single application, one EAR, offering well-defined…
G_H
  • 11,739
  • 3
  • 38
  • 82
11
votes
3 answers

How to get SessionContext in JBOSS

I tried several ways in the session bean, like: @Resource private SessionContext ctx; OR private SessionContext ctx; @Resource private void setSessionContext(SessionContext ctx) { this.sctx = ctx; } OR InitialContext ic = new…
Ryan
  • 1,963
  • 3
  • 25
  • 35
11
votes
2 answers

java.lang.ClassFormatError: Duplicate method name&signature in class file

We are in the process of upgrading our application from Weblogic 10.3.0 to 10.3.6. When we try to deploy it we get the error: java.lang.ClassFormatError: Duplicate method name&signature in class file... Upon further investigation we discovered…
Pavel Rozenblioum
  • 144
  • 1
  • 2
  • 5
11
votes
3 answers

Why throwing an EJBException is a "recommended" practice?

I keep getting this "suggestion" from many fellow developers over and over again. In my experience I've found that EJBExceptions are well-suited for "end of the world" from the bean instance perspective (like when something is so wrong that the bean…
vinny_g
  • 133
  • 1
  • 2
  • 7
11
votes
2 answers

New to Java - What's JPA and DAO?

I'm new to Java and i'm trying to make a web project with servlets. I'd like to query my database but I think I don't understand everything about JPA and DAO. I've been taught to do things this way : Create class com.package.entity.User (generated…
mimipc
  • 1,354
  • 2
  • 14
  • 28
11
votes
3 answers

ejb lookup failing with NamingException

I've added the following in my web.xml: ejb/userManagerBean Session gha.ywk.name.entry.ejb.usermanager.UserManagerHome what…
Drake
  • 2,331
  • 3
  • 19
  • 17
11
votes
6 answers

Is EJB still alive?

Do you still use session or entity EJBs in your project? Why?
Mikael Mechoulam
  • 195
  • 6
  • 15