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

JPA: check whether an entity object has been persisted or not

Is there a general method that can if(entity is persisted before){ entity = entity.merge(); }else{ entity.persist(); } So the method contain above logic is safe everywhere?
Dreamer
  • 7,333
  • 24
  • 99
  • 179
14
votes
3 answers

Interceptor method not called with interceptor binding

I'm using Java EE 6 & Jboss AS7.1 and try to use interceptor binding (Example from jboss site). I have an InterceptorBinding annotation: @InterceptorBinding @Target({ ElementType.METHOD, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) public…
Philippe Gonday
  • 1,747
  • 5
  • 21
  • 32
14
votes
2 answers

hooking into @EJB or @PersistenceContext injection in JAX-RS unit tests

I'm enjoying learning JAX-RS and Jersey, but I've hit a roadblock trying to test a simple resource that needs a DAO injected, something like this: @Stateless @Path("simple") public class SimpleResource { @PersistenceContext private…
Matthew Cornell
  • 4,114
  • 3
  • 27
  • 40
14
votes
1 answer

JSF on Tomcat - why is that possible?

I have a simple question (and silly - shame on me :) As far as I understand, Tomcat is a web container which implements Servlet/JSP specifications. Tomcat is not a full-powered Java EE app server - therefore, I cannot deploy and run a EJB-based…
user1348997
14
votes
3 answers

How to enable Kerberos authentication for remote EJB call on WebSphere?

My application is a stand-alone Swing client invoking EJB Stateless Session beans thanks to classical JNDI lookup and RMI-IIOP method calls. It is started as a Java WebStart application. My aim is to retrieve the client user's identity from…
Yves Martin
  • 10,217
  • 2
  • 38
  • 77
14
votes
7 answers

ThreadLocal usage in enterprise application

If my web application and ejb application are on the same machine (on same JVM) and all the ejb calls are local calls , will the use of ThreadLocal create any issue while passing information from web to ejb? Any workaround if the ejb calls are…
Snake Eye
  • 535
  • 3
  • 13
13
votes
7 answers

Get hold of a JDBC Connection object from a Stateless Bean

In a Stateless Session Bean an EntityManager is injected but I would like to get hold of a Connection object in order to invoke a DB Procedure. Is there any solution to this ?
Radu Stoenescu
  • 3,187
  • 9
  • 28
  • 45
13
votes
1 answer

Effect of enable-call-by-reference

I get the messages
stracktracer
  • 1,862
  • 5
  • 24
  • 37
13
votes
1 answer

OSGI runtime inside traditional Java EE server

I understand it should probably be other way round (OSGI runtime hosting Java EE servers), as it is apparently already possible with glassfish. However, our clients have extensive experience in administering traditional Java EE servers and…
Dan
  • 11,077
  • 20
  • 84
  • 119
13
votes
2 answers

ContextNotActiveException while calling @Asynchronous method of @Stateless bean

I am injecting a @Stateless bean in a Asynchronous Servlet and calling @Asynchronous method from the Serrvlet. In the server logs of the jboss i am not able to see any of the Exception but whhile starting the Java Mission Control ,Flight Recorder i…
13
votes
3 answers

Java: Tracking a user login session - Session EJBs vs HTTPSession

If I want to keep track of a conversational state with each client using my web application, which is the better alternative - a Session Bean or a HTTP Session - to use? Using HTTP Session: //request is a variable of the class…
bguiz
  • 27,371
  • 47
  • 154
  • 243
13
votes
1 answer

Differences : @SessionScoped vs @Stateful and @ApplicationScoped vs @Singleton

I would like to know, what are the principal differences between : javax.enterprise.context.SessionScoped and javax.ejb.Stateful javax.enterprise.context.ApplicationScoped and javax.ejb.Singleton I know that a @SessionScoped and a @Stateful allows…
gokan
  • 1,028
  • 1
  • 14
  • 30
13
votes
4 answers

EJB 3.1 @EJB Injection into POJO

With the new EJB 3.1 spec is it possible to inject an EJB into a pojo? I know in EJB 3.0 the @EJB annotation could be used to inject an EJB but this did not work on simple pojos. If it is not do I have to look the bean up in JNDI as I know you…
Karl
  • 2,927
  • 8
  • 31
  • 39
13
votes
5 answers

Invalid ejb jar: it contains zero ejb.

I have 2 modules: ejb and war, and ear module, that contains them. Modules build successfully, but when I try to deploy ear to glassfish, I recieve this…
Mary Ryllo
  • 2,321
  • 7
  • 34
  • 53
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