title: Glassfish embedded can't deploy EJB modules
body: <p>I have searched through Stackoverflow to find an answer for my problem, found some very similar problems, but no answer.</p>
  
  <p>What I am trying to do:
  Create a simple junit test, where a Glassfish 4.1 embedded container is started, and a simple operation of an EJB is tested.</p>
  
  <p>Sample EJB:</p>
  
  <pre><code>@Stateless
  @LocalBean
  public class ExampleBean {
  
      public int meaningOfLife() {
          return 42;
      }
  }
  </code></pre>
  
  <p>Pretty simple.
  Here is my unit test:</p>
  
  <pre><code>public class BasicTest {
      @EJB
      private ExampleBean examplebean;
  
      private static Context context;
  
      private static EJBContainer container;
  
      @BeforeClass
      public static void init() {
  
          Map&lt;String,Object&gt; props = new HashMap&lt;String,Object&gt;();
          //props.put(EJBContainer.MODULES, new File("target/classes"));
          props.put(EJBContainer.MODULES, new File("D:\\Development\\IDE\\workspace-templates\\jee7-template\\template-service\\target"));
  
          try {
              container = EJBContainer.createEJBContainer(props);//.getContext().bind("inject", this);
              context = container.getContext();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>My pom.xml dependencies:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.main.extras&lt;/groupId&gt;
          &lt;artifactId&gt;glassfish-embedded-static-shell&lt;/artifactId&gt;
          &lt;version&gt;4.1&lt;/version&gt;
          &lt;scope&gt;system&lt;/scope&gt;
          &lt;systemPath&gt;D:\\Development\\Servers\\glassfish4.1-activiti\\glassfish\\lib\\embedded\\glassfish-embedded-static-shell.jar&lt;/systemPath&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I have also tried with adding the following dependencies:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.main.ejb&lt;/groupId&gt;
          &lt;artifactId&gt;ejb-container&lt;/artifactId&gt;
          &lt;version&gt;4.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.ejb&lt;/groupId&gt;
          &lt;artifactId&gt;javax.ejb-api&lt;/artifactId&gt;
          &lt;version&gt;3.2&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>And the results:
  The embedded GF 4.1 container couldn't load that simple EJB (it is there in the target/classes folder, after a maven compile).</p>
  
  <p>I get the following errors, based on the different code changes (like using properties to pass to the container or not):</p>
  
  <p><a href="http://pastebin.com/LdyjS4Zi" rel="nofollow">GF 4.1 Embedded UnsatisfiedDependencyException</a></p>
  
  <p><a href="http://pastebin.com/WvUgtasB" rel="nofollow">GF 4.1 Embedded Can't deploy</a></p>
  
  <p><a href="http://pastebin.com/wfL7bd36" rel="nofollow">GF 4.1 Embedded Can't deploy EJB classes</a></p>
  
  <p>The code I have pasted is giving the last error message linked.</p>
  
  <p>And I don't understand. Everywhere I look for information, says this should work. </p>
  
  <p>Also, if I try this, with OpenEJB container (sadly it is just jee6), it works fine.</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.openejb&lt;/groupId&gt;
      &lt;artifactId&gt;openejb-core&lt;/artifactId&gt;
      &lt;version&gt;4.7.3&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
      &lt;groupId&gt;org.apache.openejb&lt;/groupId&gt;
      &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
      &lt;version&gt;6.0-6&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Thanks for the help!</p>