Apache OpenEJB is an embeddable and lightweight EJB 3.0 implementation that can be used as a standalone server or embedded into Tomcat, JUnit, TestNG, Eclipse, IntelliJ, Maven, Ant, and any IDE or application. OpenEJB is included in Apache Geronimo, IBM WebSphere Application Server CE, Apache TomEE and Apple's WebObjects.
Questions tagged [openejb]
286 questions
6
votes
3 answers
openejb embedded container cannot find persistence.xml
I am using openEjb in embedded mode to test a stateless session bean, which has an injected EntityManager. However, when I run the test, it fails because it could not initialize the application. When I see the console I can also see an error related…

Parag
- 12,093
- 16
- 57
- 75
5
votes
1 answer
Choosing embedded EJB 3.x container to run Java EE 5 app on Tomcat
I am sorry in advance if my question sounds too generic - I am doing all preliminary research myself but nothing substitutes real experience...
My goal is to port a legacy Java EE application (pre-EJB 3.x) to Tomcat with embedded EJB container. My…

topchef
- 19,091
- 9
- 63
- 102
5
votes
3 answers
Tomcat / "Application cannot be deployed as it contains deployment-ids" error
I am facing a problem connected with deploying two application on Tomcat 5 server.
When deploying and running the server I receive an error message, which also prevents the second application to be properly run.
Unable to deploy collapsed ear in war…

redbull
- 735
- 3
- 12
- 21
5
votes
1 answer
How to configure embedded OpenEJB container for tests properly?
This is my SLSB:
@Stateless
public class MyService {
PersistenceContext(unitName = "abc")
EntityManager em;
public boolean exists(int id) {
return this.em.find(Employee.class, id) != null;
}
}
This is my persistence.xml (I'm using…

yegor256
- 102,010
- 123
- 446
- 597
5
votes
1 answer
OpenEJB with Tomcat and Hibernate and JPA
I'm using OpenEJB 3.1.3 embedded in Tomcat 5.5.26 and I use hibernate 3.6 as a JPA provider.
Here's my persistence.xml:

Will Sumekar
- 1,249
- 5
- 16
- 25
5
votes
2 answers
OpenEJB 4.6.0 does not start with jdk8
I'm using OpenEJB in my JUnit tests. It worked fine with jdk7. Unfortunately, it does not start with jdk1.8.0. Any ideas?
C:\javaapps\jdk1.8.0\bin\java
...
10:31:11 SEVERE org.apache.openejb.util.OpenEJBErrorHandler handleUnknownError FATAL…

Daniel Bieri
- 51
- 4
4
votes
2 answers
Can an EJB server side send an event to an EJB client side?
I wonder if it is possible to do something along these lines:
1) Server side (EJB class)
@Statefull
public class SomeEJB implements SomeEJBRemote {
@Resource
private SessionContext sessionContext;
//(...)
public void someMethod(Record record){
…

Luis Soeiro
- 4,262
- 6
- 35
- 45
4
votes
2 answers
How to programatically specify my user/role in OpenEJB?
In the project I'm working on, we are using OpenEJB as a framework to test our EJB. We construct an InitialContext programatically, and use it to get the transaction manager and the various EJB.
However, the EJB I have to test now has the…

Valentin Rocher
- 11,667
- 45
- 59
4
votes
5 answers
How to build a auto reply JMS listener in JUnit (in OpenEJB)
I have a EJB to send a message to JMS queue and wait the reply from it. I want to test the EJB, it's easy to use OpenEJB to do the JUnit test of the EJB. But the problem is this EJB will wait the JMS response to continue process.
Although I can send…

Dennys
- 587
- 2
- 13
- 33
4
votes
2 answers
OpenEJB Local Client Injection Fails
Note that I'm mirroring the example given here very closely.
In fact, my situation is somewhat simpler as I'm not even testing with a persistence unit at this point. My test project provides a simple MDB and a session bean; both the MDB and the…

Joseph Weissman
- 5,697
- 5
- 46
- 75
4
votes
2 answers
What about OpenEJB? Is it worth it? Any opinions?
I whould like to know some opinions about OpenEJB: we are considering to use it on a new project, but really didn't found many opinions about it.
So, here is my question: how about it? Does it perform well? Is it stable enough for a production…

Kico Lobo
- 4,374
- 4
- 35
- 48
4
votes
2 answers
Unit testing an EJB with Mockito, TestNG and OpenEJB
I have the following EJB's:
PersonService.java
@Local
public interface PersonService {
long countPersons();
}
PersonServiceImpl.java
@Stateless
public class PersonServiceImpl implements PersonService {
@EJB
private RemotePersonService…

Yotus
- 264
- 1
- 4
- 17
4
votes
1 answer
How do I access TomEE's JTA transaction manager?
I have an application that uses Spring's declarative transaction management. How can I deploy this in a TomEE+ container so that the application uses TomEE's JTA transaction manager?
More specifically, how can I refer to the built-in transaction…

Chris Owens
- 1,107
- 1
- 10
- 15
4
votes
0 answers
Set user credentials for test methods in junit test with OpenEJB @ApplicationComposer
When I configure test with @ApplicationComposer It doesn't create SessionContext inside my enterprise beans with proper properties. It always uses PropertiesLogin no matter what I put in configuration.
I am allways getting …

vinga
- 1,912
- 20
- 33
4
votes
1 answer
OpenEJB - configuring datasource for JUnit
I have problem with proper configuration of datasource for OpenEJB 3.1.3. I try to configure connection to postgres db, but hen I debug test I get default hsql connection parameters.
Here is my test class:
@RunWith(ApplicationComposer.class)
public…

vinga
- 1,912
- 20
- 33