2 Replies Latest reply on Jun 18, 2010 9:45 AM by shyam HP

    Testing ejb components with SeamTest

    Adrian Mitev Master

      Hi all! I've set up a test project using jboss tools with JBoss MC and when running a test for EJB component it throws the following exception:


      org.jboss.seam.InstantiationException: Could not instantiate Seam component: testSerivce
           at org.jboss.seam.Component.newInstance(Component.java:2144)
           at org.jboss.seam.Component.getInstance(Component.java:2021)
           at org.jboss.seam.Component.getInstance(Component.java:1983)
           at org.jboss.seam.Component.getInstance(Component.java:1977)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
           at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
           at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
           at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
           at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
           at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
           at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
           at org.jboss.seam.mock.AbstractSeamTest$ComponentTest.invokeMethod(AbstractSeamTest.java:136)
           at test.Tst$1.testComponents(Tst.java:17)
           at org.jboss.seam.mock.AbstractSeamTest$ComponentTest.run(AbstractSeamTest.java:162)
           at test.Tst.test(Tst.java:19)
      Caused by: javax.naming.NameNotFoundException: TestServiceBean not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
           at javax.naming.InitialContext.lookup(InitialContext.java:392)
           at org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)
           at org.jboss.seam.Component.instantiate(Component.java:1364)
           at org.jboss.seam.Component.newInstance(Component.java:2122)
           ... 39 more
      ... Removed 22 stack frames
      



      When starting the microcontainer doesn't even print that it reads the ejb's and persistence.xml from the ejb project. Idea what i'm doing wrong?