Answer the question
In order to leave comments, you need to log in
Why won't the test run using the EJBContainer?
When I try to run the test using EJBContainer.createEJBContainer(properties) I get the error: "jakarta.ejb.EJBException: No EJBContainer provider available: no provider names had been found."
What is the reason for this error?
pom.xml
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>6.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
public class ItemServiceIT {
private static Context ctx;
private static EJBContainer ejbContainer;
@BeforeClass
public static void setUpClass() {
Map<String, Object> properties = new HashMap<>();
properties.put("org.glassfish.ejb.embedded.glassfish.instance.root",
"./src/test/domain");
ejbContainer = EJBContainer.createEJBContainer(properties);
ctx = ejbContainer.getContext();
}
@AfterClass
public static void closeConn() {
if (ejbContainer != null) {
ejbContainer.close();
}
}
@Test
public void itemPersistTest() {
//
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question