0

I have preinstalled Jboss Eap 6.1.1 When I run following line:

EJBContainer container = EJBContainer.createEJBContainer();

I get exception: javax.ejb.EJBException: Neither JBOSS_HOME nor jboss.home is set

When I add:

System.setProperty("jboss.home", "/usr/local/share/jboss-eap-6.1/");

I face exception:

javax.ejb.EJBException: Can't find directory /usr/local/share/jboss-eap-6.1/lib

Edited:

JBossStandaloneEJBContainerProvider.createEJBContainer() contains such code:

addClassPath(cp, jbossHome + "/lib");
addClassPath(cp, jbossHome + "/common/lib");
addClassPath(cp, jbossHome + "/server/" + serverConfig + "/lib")
addClassPath(cp, jbossHome + "/client");

I don't have such directories in my Jboss Eap 6.1.1. Which jboss.home does EJBContainer need?

Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
  • The exception seems to come from [JBossStandaloneEJBContainerProvider.java](https://github.com/jbossejb3/jboss-ejb3-embedded/blob/master/standalone/src/main/java/org/jboss/ejb3/embedded/impl/standalone/JBossStandaloneEJBContainerProvider.java). Which libraries are in the class path when you run your code? Maybe this post could help [getting-started-with-embeddable-jboss-eap-6-as-7](https://stackoverflow.com/questions/15032303/getting-started-with-embeddable-jboss-eap-6-as-7) – SubOptimal Sep 26 '16 at 11:55
  • @SubOptimal, you are right. The exception comes from:`JBossStandaloneEJBContainerProvider` And there is lines in this class: `addClassPath(cp, jbossHome + "/lib"); addClassPath(cp, jbossHome + "/common/lib"); addClassPath(cp, jbossHome + "/server/" + serverConfig + "/lib"); addClassPath(cp, jbossHome + "/client");` I don't have this directories in my `Jboss Eap 6.1.1` – Rudziankoŭ Sep 26 '16 at 12:13

0 Answers0