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

NullPointerException when injecting EJB in Java Class

I think this problem raises because I didn't get something with EJBs. I have a service class for my entity, which is @Stateless. When I use it by injecting with @EJB in my session scoped presentation model, all is ok. But now I wanted to use this…
timmornYE
  • 708
  • 2
  • 8
  • 22
15
votes
2 answers

Injecting datasource in EJB

When you inject a datasource in your application and get a connection by invoking getConnection() on it, are you supposed to close the connection?
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
15
votes
1 answer

No EJB receiver available for handling

I'm using EJB 3.0 with JBoss AS 7.1.1 Final. I am getting this error when I try to connect my client to the server: Aug 15, 2012 12:05:00 PM org.jboss.ejb.client.EJBClient INFO: JBoss EJB Client version 1.0.5.Final Exception in thread…
Graham
  • 5,488
  • 13
  • 57
  • 92
14
votes
2 answers

java EJB: The import javax.ejb cannot be resolved

I am reading the book Getting Started with WebSphere Application Server Community Edition. I created an EJB project with Eclipse EE. import javax.ejb.Local; Error: The import javax.ejb cannot be resolved I don't know why I cannot import this…
Eric Francis
  • 23,039
  • 31
  • 88
  • 122
14
votes
2 answers

What's the alternative for Spring RMI? (since it's deprecated)

Spring seems to be deprecating its RMI: As of Spring Framework 5.3, support for several remoting technologies is now deprecated for security reasons and broader industry support. Supporting infrastructure will be removed from Spring Framework for…
Arturas M
  • 4,120
  • 18
  • 50
  • 80
14
votes
1 answer

NamedQuery: IllegalArgumentException (Query not found) after externalizing entities

I have successfully used javax.persistence.NamedQuery in combination with JPA2. The named queries are defined at the top of the entity class files, and are used from Stateless EJBs (entity facade). Now I had to extract the entity class files into a…
Hank
  • 4,597
  • 5
  • 42
  • 84
14
votes
3 answers

Why use Facade pattern for EJB session bean

I want to ask what is the reason to use Facade Pattern when access EJB Session Bean. In my Netbeans 6.9.1, if I do New > Sessions Bean for Entity Classes, and let say that I select User entity, then Netbeans would generate this…
Thang Pham
  • 38,125
  • 75
  • 201
  • 285
14
votes
6 answers

@Schedule methods in EJBs aren't executing after Exceptions

I've got a method in a Java EE6 Singleton Session Bean which is called by a @Schedule(...) timer every 30 seconds. This works as expected until an exception is thrown and catched in the method (exception is throw and catched in a try-catch block).…
t3chris
  • 1,390
  • 1
  • 15
  • 25
14
votes
2 answers

How to change slf4j logging level

I'm using the org.slf4j.Logger in a Java EJB-Project running on a glassfish 3.1.2 server. import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class main { private static final Logger LOGGER =…
user5845413
14
votes
3 answers

Running application with Java 9, module java.base does not "opens java.io"

I tried to run my application (front-end developed in Java Swing, server developed with EJB deployed on Wildfly 8) with Java 9. When the client tries to establish an EJB connection got the following exception: 09:53:42,358 INFO [xnio] XNIO…
Andrea Biasillo
  • 241
  • 1
  • 3
  • 6
14
votes
2 answers

Hibernate session.close() not returning connection to pool

My application has long running transactions and hence I tried the option session.close() at the end of every method to ensure that the connection objects are not held indefinitely for long time. When session.close() option is used, I could see…
Perfuser123
  • 141
  • 1
  • 1
  • 3
14
votes
5 answers

How to mock InitialContext constructor in unit testing

when I try to mock following method(Method is using remote EJB call for business logic) for the Junit test, it gives javax.naming.NoInitialContextException private void someMethod(int id1, int id2, HashMap map){ ......some code........ …
Anushka Senarathna
  • 159
  • 1
  • 1
  • 5
14
votes
3 answers

Is it possible to inject EJB implementation and not its interface using CDI?

My configuration is: Wildfly 8.2.0, Weld Is it possible to inject in bean and not in its interface in CDI ? @Stateless class Bean implements IBean { ... } interface IBean { ... } @SessionScoped class Scoped { @Inject Bean bean; //Fail …
Tony
  • 2,266
  • 4
  • 33
  • 54
14
votes
3 answers

Default Attributes in EJB Transactions

I ma reading the java ee docs and I would like to ask a couple of question to be sure I have understood well what is going on with EJB-Transactions. 1) The docs state that the defaalt TransactionManagement value is CONTAINER and the the default…
arjacsoh
  • 8,932
  • 28
  • 106
  • 166
14
votes
6 answers

How can an EJB parallelize a long, CPU intensive process?

The application has a CPU intensive long process that currently runs on one server (an EJB method) serially when the client requests it. It’s theoretically possible (from a conceptual point of view) to split that process in N chunks and execute them…
b.roth
  • 9,421
  • 8
  • 37
  • 50