This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Junit with EJB - EJBException: Unable to instantiate container with factories []

 
Jack Tower
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
I'm newbie in EJB.

I'm trying to test a simple EJB project with JBoss 7.1. But test throws Exception:
javax.ejb.EJBException: Unable to instantiate container with factories [] at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBCont ainer.java:97) at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBCont ainer.java:75) at
com.pack.HelloTest.test(HelloTest.java:17) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( FrameworkMethod.java:47) at
org.junit.internal.runners.model.ReflectiveCallable.run(Refl ectiveCallable.java:12) at
org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr ameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate( InvokeMethod.java:17) at
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271 ) at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit 4ClassRunner.java:70) at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit 4ClassRunner.java:50) at
org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java: 63) at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java :236) at
org.junit.runners.ParentRunner.access$000(ParentRunner.java: 53) at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java: 229) at
org.junit.runners.ParentRunner.run(ParentRunner.java:309) at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:50) at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38) at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:467) at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:683) at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:390) at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:197)


It's the test:


My project has got a bean "HelloBean":


And the bean implements interface "Hello":


Why the test throws this exception?
Could you tell me how to fix the error?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic