title: EJB testing with TomEE embedded EJBContainer api: java.lang.ClassFormatError exception
body: <p>I would test my EJB with TomEE embedded EJBContainer.</p>
  
  <p>This is my JUnit test case skeleton:</p>
  
  <pre><code>package com.xxx.indexer.scheduler.service;
  
  import java.util.Properties;
  
  import javax.ejb.embeddable.EJBContainer;
  import javax.naming.NamingException;
  
  import org.junit.AfterClass;
  import org.junit.Before;
  import org.junit.BeforeClass;
  import org.junit.Test;
  
  import com.xxx.indexer.scheduler.AbstractTest;
  
  public class BookingAuditServiceImplTest extends AbstractTest {
  
      private static EJBContainer container;
  
      @BeforeClass
      public static void start() {
          final Properties props = new Properties();
          props.setProperty(EJBContainer.PROVIDER, "tomee-embedded");
          container = EJBContainer.createEJBContainer(props);
      }
  
      @AfterClass
      public static void stop() {
          container.close();
      }
  
      @Before
      public void inject() throws NamingException {
          container.getContext().bind("inject", this);
      }
  
      @Test
      public void test() {
          // TODO
      }
  
  }
  </code></pre>
  
  <p>And these are my maven dependecies:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;4.10&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;javax&lt;/groupId&gt;
    &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
    &lt;version&gt;6.0&lt;/version&gt;
    &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.openejb&lt;/groupId&gt;
    &lt;artifactId&gt;tomee-embedded&lt;/artifactId&gt;
    &lt;version&gt;1.0.0&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>When I start the test class, the EJBContainer.createEJBContainer() method throws a java.lang.ClassFormatError exception:</p>
  
  <pre><code>java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ejb/embeddable/EJBContainer
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
  at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
  at java.lang.Class.getDeclaredFields0(Native Method)
  at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
  at java.lang.Class.getDeclaredFields(Class.java:1760)
  at org.junit.runners.model.TestClass.&lt;init&gt;(TestClass.java:44)
  at org.junit.runners.ParentRunner.&lt;init&gt;(ParentRunner.java:73)
  at org.junit.runners.BlockJUnit4ClassRunner.&lt;init&gt;(BlockJUnit4ClassRunner.java:55)
  at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:13)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
  at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
  at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
  at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.&lt;init&gt;(JUnit4TestReference.java:33)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.&lt;init&gt;(JUnit4TestClassReference.java:25)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>
  
  <p>How can I do?</p>