9 Replies Latest reply on Jun 29, 2006 11:20 PM by David Bernstein

    running Eclipse TestNG plugin on a Seam project

    David Bernstein Newbie

      Hi,

      I am new to Seam and TestNG but familiar already with Eclipse, JBoss, and JUnit.I've built the registration example using ant and got it working in JBoss. I also successfully ran its TestNG test using ant. I'm trying to get my first simple code working as an Eclipse project by copying the "registration" example (and just the registration example, because I want just my own project, not the entire Seam project as well). I've got the example and its test compiling fine but when I try to run the TestNG Eclipse plugin on the test, it fails right away at the first assertion:

      public class RegisterTest extends SeamTest
      {
      
       @Test
       public void testLogin() throws Exception
       {
      
       new Script() {
      
       @Override
       protected void updateModelValues() throws Exception
       {
       User user = (User) Component.getInstance("user", true);
       assert user!=null;
       ...


      I notice in the ant output that various configuration files are read:
      [testng] INFO 22-06 17:24:27,082 (Log4JLogger.java:info:94) -reading components.xml
      [testng] INFO 22-06 17:24:27,207 (Log4JLogger.java:info:94) -reading properties from: /seam.properties
      [testng] INFO 22-06 17:24:27,207 (Log4JLogger.java:info:94) -reading properties from: /jndi.properties


      so I'm guessing that I'm missing some magic configuration files in their proper places, which seems reasonable since Seam needs various configuration files to run. Unfortunately, since I'm quite new to Seam and TestNG I'm at a loss to figure out which files go where and I've already flailed around trying to figure that out. :(

      I have seen the testing chapter 12 of the Seam reference, as well as the readme.txt section on running the Eclipse TestNG plugin on the entire Seam download, and googled, but didn't see anything about how to run TestNG tests from the Eclipse plugin on a project separate that uses Seam but is not Seam itself.

      If there's already an explanation (or if I've done something stupid), I will humbly accept an RTFM pointer. :-) If not, could somebody please list what needs to be done to run Seam TestNG tests using the Eclipse plugin.

      Thank you.

        • 1. Re: running Eclipse TestNG plugin on a Seam project
          Gavin King Master

          Did you follow regstration/readme.txt?

          Running the TestNG Tests in Eclipse
          -----------------------------------

          1. Install the TestNG Eclipse plugin from http://beust.com/eclipse

          2. Create the jboss-seam Eclipse project with the following directories
          in your source path:

          src/main/
          examples/registration/src/
          examples/registration/resources/
          embedded-ejb/conf/

          And all jar files from the following directories in your classpath:

          lib/
          embedded-ejb/lib

          3. Run examples/registration/src/org/jboss/seam/example/registration/test/testng.xml
          using the TestNG plugin.


          • 2. Re: running Eclipse TestNG plugin on a Seam project
            Jye Tucker Newbie

            Could be related to the reason I'm proposing a move of components.xml (see the other thread underway at the moment).

            TestNG as an eclipse plugin runs with a different classpath to running with ant so check in the TestNG output that components.xml is being read correctly. I had to create a WEB-INF directory under one of my source folders and include components.xml in that.

            • 3. Re: running Eclipse TestNG plugin on a Seam project
              David Bernstein Newbie

              Gavin and Jye,

              I think I'm really close. Those were good hints, thank you. One thing though is that I'm not really trying to run the registration example, I'm just cloning it and trying to make a minimal Seam project in Eclipse as a starting point, without references to Seam source. I've made a bunch of changes and am now much farther but stuck. I have:

              * put seam.properties in my "src" folder so that the corresponding "bin" folder will get scanned by Seam
              * made sure all configuration files (that I'm aware of) are now in a folder called "resources" that is on the classpath
              * put components.xml, faces-config.xml, and web.xml in WEB-INF under my resource folder
              * added 'unitName="userDatabase"' to the @PersistenceContext annotation in RegisterAction because I was getting an error like:
              @PersistenceUnit in error: EMPTY STRING unitName but there is no deployments in scope. After reading http://trailblazer.demo.jboss.com/EJB3Trail/persistence/config/ is this use case perhaps not using a scoped classloader?
              * moved the test to a separate source folder named test and into the same package as the registration source (my own preference for Java unit testing, doesn't seem significant to me)

              So far as I can tell, the first significant differences in running the test under ant or Eclipse (Seam reverses its log messages about the user and register components) that I can notice are that under Eclipse:

              * there's no message like:
              INFO (Ejb3DescriptorHandler.java:addClassAnnotation:1699) -adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to org.jboss.seam.example.registration.RegisterAction org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@ae4646
              * there's no message like:
              INFO (MCKernelAbstraction.java:install:84) -installing bean: persistence.units:jar=test.jar,unitName=userDatabase with dependencies:
              * it appears that RegisterAction doesn't have a JNDI binding (it gets a NamingException) even though there's a Seam log message that says "JNDI: RegisterAction/local"

              Pointers in getting this right will be gratefully appreciated -- it seems pretty darn close now!

              Thanks,
              Dave

              P.S. I think that having something like this to start from would really help people who are considering trying out Seam to get over the hurdle of creating a small freestanding project to start playing with which they could then morph into their own app. Maybe I could create a Wiki entry once this works right or there could be a little section on this in the reference guide?

              eclipse console output:

              INFO 23-06 12:47:41,519 (Log4JLogger.java:info:94) -reading components.xml
              INFO 23-06 12:47:41,613 (Log4JLogger.java:info:94) -reading properties from: /seam.properties
              INFO 23-06 12:47:41,613 (Log4JLogger.java:info:94) -reading properties from: /jndi.properties
              INFO 23-06 12:47:41,629 (Log4JLogger.java:info:94) -initializing Seam
              INFO 23-06 12:47:41,660 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
              INFO 23-06 12:47:41,832 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.pages, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Pages
              INFO 23-06 12:47:41,847 (Log4JLogger.java:info:94) -Component: events, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Events
              INFO 23-06 12:47:41,863 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Manager
              INFO 23-06 12:47:41,910 (Log4JLogger.java:info:94) -Component: switcher, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.Switcher
              INFO 23-06 12:47:41,910 (Log4JLogger.java:info:94) -Component: redirect, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Redirect
              INFO 23-06 12:47:41,925 (Log4JLogger.java:info:94) -Component: httpError, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.HttpError
              INFO 23-06 12:47:41,925 (Log4JLogger.java:info:94) -Component: userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.UserPrincipal
              INFO 23-06 12:47:41,941 (Log4JLogger.java:info:94) -Component: isUserInRole, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.IsUserInRole
              INFO 23-06 12:47:41,972 (Log4JLogger.java:info:94) -Component: conversation, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Conversation
              INFO 23-06 12:47:41,988 (Log4JLogger.java:info:94) -Component: conversationList, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationList
              INFO 23-06 12:47:41,988 (Log4JLogger.java:info:94) -Component: conversationStack, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationStack
              INFO 23-06 12:47:42,004 (Log4JLogger.java:info:94) -Component: facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesContext
              INFO 23-06 12:47:42,019 (Log4JLogger.java:info:94) -Component: pageContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PageContext
              INFO 23-06 12:47:42,035 (Log4JLogger.java:info:94) -Component: eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.EventContext
              INFO 23-06 12:47:42,050 (Log4JLogger.java:info:94) -Component: sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.SessionContext
              INFO 23-06 12:47:42,050 (Log4JLogger.java:info:94) -Component: statelessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.StatelessContext
              INFO 23-06 12:47:42,066 (Log4JLogger.java:info:94) -Component: applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ApplicationContext
              INFO 23-06 12:47:42,066 (Log4JLogger.java:info:94) -Component: conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationContext
              INFO 23-06 12:47:42,129 (Log4JLogger.java:info:94) -Component: businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.BusinessProcessContext
              INFO 23-06 12:47:42,144 (Log4JLogger.java:info:94) -Component: locale, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Locale
              INFO 23-06 12:47:42,160 (Log4JLogger.java:info:94) -Component: messages, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.Messages
              INFO 23-06 12:47:42,160 (Log4JLogger.java:info:94) -Component: interpolator, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Interpolator
              INFO 23-06 12:47:42,175 (Log4JLogger.java:info:94) -Component: facesMessages, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesMessages
              INFO 23-06 12:47:42,191 (Log4JLogger.java:info:94) -Component: resourceBundle, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.ResourceBundle
              INFO 23-06 12:47:42,207 (Log4JLogger.java:info:94) -Component: localeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.LocaleSelector
              INFO 23-06 12:47:42,222 (Log4JLogger.java:info:94) -Component: uiComponent, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.UiComponent
              INFO 23-06 12:47:42,222 (Log4JLogger.java:info:94) -Component: org.jboss.seam.remoting.messaging.subscriptionRegistry, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.remoting.messaging.SubscriptionRegistry
              INFO 23-06 12:47:42,238 (Log4JLogger.java:info:94) -Component: pojoCache, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PojoCache
              INFO 23-06 12:47:42,285 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.ejb, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Ejb
              INFO 23-06 12:47:42,300 (Log4JLogger.java:info:94) -scanning: C:\eclipse\workspace\seam-play\bin
              INFO 23-06 12:47:42,316 (Log4JLogger.java:info:94) -scanning: C:\eclipse\workspace\seam-play\resource
              INFO 23-06 12:47:42,332 (Log4JLogger.java:info:94) -Component: register, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.jboss.seam.example.registration.RegisterAction, JNDI: RegisterAction/local
              INFO 23-06 12:47:42,379 (Log4JLogger.java:info:94) -Component: user, scope: SESSION, type: ENTITY_BEAN, class: org.jboss.seam.example.registration.User
              INFO 23-06 12:47:42,410 (Log4JLogger.java:info:94) -starting the embedded EJB container
              WARN 23-06 12:47:43,097 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
              INFO 23-06 12:47:43,629 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/DefaultDS'
              INFO 23-06 12:47:44,082 (Ejb3Deployment.java:create:467) -EJB3 deployment time took: 94
              INFO 23-06 12:47:44,207 (Ejb3Deployment.java:create:467) -EJB3 deployment time took: 125
              INFO 23-06 12:47:44,254 (MCKernelAbstraction.java:install:84) -installing bean: jboss.j2ee:jar=bin,name=RegisterAction,service=EJB3 with dependencies:
              INFO 23-06 12:47:44,254 (MCKernelAbstraction.java:install:87) - AbstractDependencyMetaData@c063ad{dependency=persistence.units:unitName=userDatabase}
              INFO 23-06 12:47:44,300 (Log4JLogger.java:info:94) -done initializing Seam
              INFO 23-06 12:47:44,410 (Log4JLogger.java:info:94) -stopping the embedded EJB container
              FAILED: testLogin
              org.jboss.seam.InstantiationException: Could not instantiate Seam component: register
              at org.jboss.seam.Component.newInstance(Component.java:735)
              at org.jboss.seam.Component.newInstance(Component.java:1308)
              at org.jboss.seam.Component.getInstance(Component.java:1263)
              at org.jboss.seam.Component.getInstance(Component.java:1246)
              at org.jboss.seam.example.registration.RegisterTest$1.invokeApplication(RegisterTest.java:32)
              at org.jboss.seam.mock.SeamTest$Script.run(SeamTest.java:242)
              at org.jboss.seam.example.registration.RegisterTest.testLogin(RegisterTest.java:47)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
              at org.testng.internal.Invoker.invokeMethod(Invoker.java:407)
              at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:778)
              at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
              at org.testng.TestRunner.privateRun(TestRunner.java:682)
              at org.testng.TestRunner.run(TestRunner.java:566)
              at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220)
              at org.testng.SuiteRunner.run(SuiteRunner.java:146)
              at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:98)
              at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
              Caused by: javax.naming.NameNotFoundException: RegisterAction not bound
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
              at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
              at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:626)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:588)
              at javax.naming.InitialContext.lookup(InitialContext.java:351)
              at org.jboss.seam.Component.instantiate(Component.java:774)
              at org.jboss.seam.Component.newInstance(Component.java:731)
              ... 20 more


              ===============================================
              Register
              Tests run: 1, Failures: 1, Skips: 0
              ===============================================


              ===============================================
              Registration
              Total tests run: 1, Failures: 1, Skips: 0
              ===============================================



              my project now looks like:

              seam-play
               bin
               org
               jboss
               seam
               example
               registration
               Register.class
               RegisterAction.class
               RegisterTest.class
               RegisterTest$1.class
               testng.xml
               User.class
               seam.properties
               lib (in classpath)
               jboss-seam.jar
               ...
               resource
               WEB-INF
               component.xml
               faces-config.xml
               web.xml
               application.xml
               components.properties
               default.persistence.properties
               ejb3-interceptors-aop.xml
               ejb-jar.xml
               embedded-jboss-beans.xml
               jboss-app.xml
               jboss-jms-beans.xml
               jndi.properties
               log4j.xml
               login-config.xml
               persistence.xml
               seam.properties
               security-beans.xml
               src
               org
               jboss
               seam
               example
               registration
               Register.java
               RegisterAction.java
               User.properties
               seam.properties
               test
               org
               jboss
               seam
               example
               registration
               RegisterTest.java
               testng.xml
               view
               index.html
               register.jsp
               registered.jsp
              
              


              apparently correctly working ant output:

              [testng] INFO 22-06 17:24:27,082 (Log4JLogger.java:info:94) -reading components.xml
              [testng] INFO 22-06 17:24:27,207 (Log4JLogger.java:info:94) -reading properties from: /seam.properties
              [testng] INFO 22-06 17:24:27,207 (Log4JLogger.java:info:94) -reading properties from: /jndi.properties
              [testng] INFO 22-06 17:24:27,207 (Log4JLogger.java:info:94) -initializing Seam
              [testng] INFO 22-06 17:24:27,254 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
              [testng] INFO 22-06 17:24:27,457 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.pages, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Pages
              [testng] INFO 22-06 17:24:27,473 (Log4JLogger.java:info:94) -Component: events, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Events
              [testng] INFO 22-06 17:24:27,489 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Manager
              [testng] INFO 22-06 17:24:27,536 (Log4JLogger.java:info:94) -Component: switcher, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.Switcher
              [testng] INFO 22-06 17:24:27,536 (Log4JLogger.java:info:94) -Component: redirect, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Redirect
              [testng] INFO 22-06 17:24:27,551 (Log4JLogger.java:info:94) -Component: httpError, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.HttpError
              [testng] INFO 22-06 17:24:27,567 (Log4JLogger.java:info:94) -Component: userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.UserPrincipal
              [testng] INFO 22-06 17:24:27,582 (Log4JLogger.java:info:94) -Component: isUserInRole, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.IsUserInRole
              [testng] INFO 22-06 17:24:27,598 (Log4JLogger.java:info:94) -Component: conversation, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Conversation
              [testng] INFO 22-06 17:24:27,614 (Log4JLogger.java:info:94) -Component: conversationList, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationList
              [testng] INFO 22-06 17:24:27,629 (Log4JLogger.java:info:94) -Component: conversationStack, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationStack
              [testng] INFO 22-06 17:24:27,676 (Log4JLogger.java:info:94) -Component: facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesContext
              [testng] INFO 22-06 17:24:27,692 (Log4JLogger.java:info:94) -Component: pageContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PageContext
              [testng] INFO 22-06 17:24:27,723 (Log4JLogger.java:info:94) -Component: eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.EventContext
              [testng] INFO 22-06 17:24:27,723 (Log4JLogger.java:info:94) -Component: sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.SessionContext
              [testng] INFO 22-06 17:24:27,754 (Log4JLogger.java:info:94) -Component: statelessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.StatelessContext
              [testng] INFO 22-06 17:24:27,754 (Log4JLogger.java:info:94) -Component: applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ApplicationContext
              [testng] INFO 22-06 17:24:27,754 (Log4JLogger.java:info:94) -Component: conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationContext
              [testng] INFO 22-06 17:24:27,770 (Log4JLogger.java:info:94) -Component: businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.BusinessProcessContext
              [testng] INFO 22-06 17:24:27,770 (Log4JLogger.java:info:94) -Component: locale, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Locale
              [testng] INFO 22-06 17:24:27,786 (Log4JLogger.java:info:94) -Component: messages, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.Messages
              [testng] INFO 22-06 17:24:27,786 (Log4JLogger.java:info:94) -Component: interpolator, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Interpolator
              [testng] INFO 22-06 17:24:27,801 (Log4JLogger.java:info:94) -Component: facesMessages, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesMessages
              [testng] INFO 22-06 17:24:27,817 (Log4JLogger.java:info:94) -Component: resourceBundle, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.ResourceBundle
              [testng] INFO 22-06 17:24:27,832 (Log4JLogger.java:info:94) -Component: localeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.LocaleSelector
              [testng] INFO 22-06 17:24:27,848 (Log4JLogger.java:info:94) -Component: uiComponent, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.UiComponent
              [testng] INFO 22-06 17:24:27,848 (Log4JLogger.java:info:94) -Component: org.jboss.seam.remoting.messaging.subscriptionRegistry, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.remoting.messaging.SubscriptionRegistry
              [testng] INFO 22-06 17:24:27,864 (Log4JLogger.java:info:94) -Component: pojoCache, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PojoCache
              [testng] INFO 22-06 17:24:27,911 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.ejb, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Ejb
              [testng] INFO 22-06 17:24:27,911 (Log4JLogger.java:info:94) -scanning: C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\build\test
              [testng] INFO 22-06 17:24:27,942 (Log4JLogger.java:info:94) -Component: user, scope: SESSION, type: ENTITY_BEAN, class: org.jboss.seam.example.registration.User
              [testng] INFO 22-06 17:24:27,973 (Log4JLogger.java:info:94) -Component: register, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.jboss.seam.example.registration.RegisterAction, JNDI: RegisterAction/local
              [testng] INFO 22-06 17:24:28,036 (Log4JLogger.java:info:94) -starting the embedded EJB container
              [testng] WARN 22-06 17:24:28,911 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
              [testng] INFO 22-06 17:24:29,504 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/DefaultDS'
              [testng] INFO 22-06 17:24:30,536 (Ejb3DescriptorHandler.java:addClassAnnotation:1699) -adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to org.jboss.seam.example.registration.RegisterAction org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@ae4646
              [testng] INFO 22-06 17:24:30,598 (Ejb3Deployment.java:create:467) -EJB3 deployment time took: 469
              [testng] INFO 22-06 17:24:30,614 (MCKernelAbstraction.java:install:84) -installing bean: persistence.units:jar=test.jar,unitName=userDatabase with dependencies:
              [testng] INFO 22-06 17:24:30,614 (MCKernelAbstraction.java:install:87) - AbstractDependencyMetaData@61f533{dependency=DefaultDS}
              [testng] INFO 22-06 17:24:30,676 (Log4JLogger.java:info:94) -Hibernate EntityManager 3.2.0.CR1
              [testng] INFO 22-06 17:24:30,707 (Log4JLogger.java:info:94) -Hibernate Annotations 3.2.0.CR1
              [testng] INFO 22-06 17:24:30,707 (Log4JLogger.java:info:94) -Hibernate 3.2 cr2
              [testng] INFO 22-06 17:24:30,723 (Log4JLogger.java:info:94) -hibernate.properties not found
              [testng] INFO 22-06 17:24:30,723 (Log4JLogger.java:info:94) -Bytecode provider name : cglib
              [testng] INFO 22-06 17:24:30,754 (Log4JLogger.java:info:94) -using JDK 1.4 java.sql.Timestamp handling
              [testng] INFO 22-06 17:24:30,864 (Log4JLogger.java:info:94) -Processing PersistenceUnitInfo [
              [testng] name: userDatabase
              [testng] ...]
              [testng] INFO 22-06 17:24:30,879 (Log4JLogger.java:info:94) -found EJB3 Entity bean: org.jboss.seam.example.registration.User
              [testng] WARN 22-06 17:24:30,895 (Log4JLogger.java:warn:104) -Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
              [testng] INFO 22-06 17:24:30,973 (Log4JLogger.java:info:94) -Reading mappings from resource: META-INF/orm.xml
              [testng] INFO 22-06 17:24:30,973 (Log4JLogger.java:info:94) -[PersistenceUnit: userDatabase] no META-INF/orm.xml found
              [testng] INFO 22-06 17:24:31,082 (Log4JLogger.java:info:94) -Binding entity from annotated class: org.jboss.seam.example.registration.User
              [testng] INFO 22-06 17:24:31,145 (Log4JLogger.java:info:94) -Bind entity org.jboss.seam.example.registration.User on table users
              [testng] INFO 22-06 17:24:31,317 (Log4JLogger.java:info:94) -Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
              [testng] INFO 22-06 17:24:31,317 (Log4JLogger.java:info:94) -Using provided datasource
              [testng] INFO 22-06 17:24:31,786 (Log4JLogger.java:info:94) -RDBMS: HSQL Database Engine, version: 1.8.0
              [testng] INFO 22-06 17:24:31,786 (Log4JLogger.java:info:94) -JDBC driver: HSQL Database Engine Driver, version: 1.8.0
              [testng] INFO 22-06 17:24:31,911 (Log4JLogger.java:info:94) -Using dialect: org.hibernate.dialect.HSQLDialect
              [testng] INFO 22-06 17:24:31,926 (Log4JLogger.java:info:94) -Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
              [testng] INFO 22-06 17:24:31,926 (Log4JLogger.java:info:94) -instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
              [testng] INFO 22-06 17:24:31,926 (Log4JLogger.java:info:94) -instantiated TransactionManagerLookup
              [testng] INFO 22-06 17:24:31,926 (Log4JLogger.java:info:94) -Automatic flush during beforeCompletion(): disabled
              [testng] INFO 22-06 17:24:31,926 (Log4JLogger.java:info:94) -Automatic session close at end of transaction: disabled
              [testng] INFO 22-06 17:24:31,926 (Log4JLogger.java:info:94) -JDBC batch size: 15
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -JDBC batch updates for versioned data: disabled
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -Scrollable result sets: enabled
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -JDBC3 getGeneratedKeys(): disabled
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -Connection release mode: auto
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -Default batch fetch size: 1
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -Generate SQL with comments: disabled
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -Order SQL updates by primary key: disabled
              [testng] INFO 22-06 17:24:31,942 (Log4JLogger.java:info:94) -Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
              [testng] INFO 22-06 17:24:31,957 (Log4JLogger.java:info:94) -Using ASTQueryTranslatorFactory
              [testng] INFO 22-06 17:24:31,957 (Log4JLogger.java:info:94) -Query language substitutions: {}
              [testng] INFO 22-06 17:24:31,957 (Log4JLogger.java:info:94) -Second-level cache: enabled
              [testng] INFO 22-06 17:24:31,957 (Log4JLogger.java:info:94) -Query cache: disabled
              [testng] INFO 22-06 17:24:31,957 (Log4JLogger.java:info:94) -Cache provider: org.hibernate.cache.HashtableCacheProvider
              [testng] INFO 22-06 17:24:31,957 (Log4JLogger.java:info:94) -Optimize cache for minimal puts: disabled
              [testng] INFO 22-06 17:24:31,957 (Log4JLogger.java:info:94) -Structured second-level cache entries: disabled
              [testng] INFO 22-06 17:24:31,973 (Log4JLogger.java:info:94) -Statistics: disabled
              [testng] INFO 22-06 17:24:31,973 (Log4JLogger.java:info:94) -Deleted entity synthetic identifier rollback: disabled
              [testng] INFO 22-06 17:24:31,973 (Log4JLogger.java:info:94) -Default entity-mode: pojo
              [testng] INFO 22-06 17:24:32,082 (Log4JLogger.java:info:94) -building session factory
              [testng] INFO 22-06 17:24:32,332 (Log4JLogger.java:info:94) -Not binding factory to JNDI, no JNDI name configured
              [testng] INFO 22-06 17:24:32,332 (Log4JLogger.java:info:94) -Running hbm2ddl schema export
              [testng] INFO 22-06 17:24:32,348 (Log4JLogger.java:info:94) -exporting generated schema to database
              [testng] INFO 22-06 17:24:32,348 (Log4JLogger.java:info:94) -schema export complete
              [testng] INFO 22-06 17:24:32,364 (Log4JLogger.java:info:94) -JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              [testng] INFO 22-06 17:24:32,395 (MCKernelAbstraction.java:install:84) -installing bean: jboss.j2ee:jar=test,name=RegisterAction,service=EJB3 with dependencies:
              [testng] INFO 22-06 17:24:32,395 (MCKernelAbstraction.java:install:87) - AbstractDependencyMetaData@1ef3d1b{dependency=persistence.units:jar=test.jar,unitName=userDatabase}
              [testng] INFO 22-06 17:24:32,692 (EJBContainer.java:start:553) -STARTED EJB: org.jboss.seam.example.registration.RegisterAction ejbName: RegisterAction
              [testng] INFO 22-06 17:24:32,723 (Log4JLogger.java:info:94) -done initializing Seam
              [testng] INFO 22-06 17:24:33,254 (Log4JLogger.java:info:94) -Registered new user #{user.username}
              [testng] INFO 22-06 17:24:33,270 (Log4JLogger.java:info:94) -no pages.xml file found
              [testng] INFO 22-06 17:24:33,286 (Log4JLogger.java:info:94) -stopping the embedded EJB container
              [testng] INFO 22-06 17:24:33,286 (Log4JLogger.java:info:94) -closing
              [testng] INFO 22-06 17:24:33,286 (Log4JLogger.java:info:94) -Running hbm2ddl schema export
              [testng] INFO 22-06 17:24:33,286 (Log4JLogger.java:info:94) -exporting generated schema to database
              [testng] INFO 22-06 17:24:33,301 (Log4JLogger.java:info:94) -schema export complete
              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\Register.html
              [testng] PASSED: testLogin

              [testng] ===============================================
              [testng] Register
              [testng] Tests run: 1, Failures: 0, Skips: 0
              [testng] ===============================================


              [testng] ===============================================
              [testng] Registration
              [testng] Total tests run: 1, Failures: 0, Skips: 0
              [testng] ===============================================

              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\toc.html
              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\Register.properties
              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\index.html
              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\main.html
              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\groups.html
              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\methods.html
              [testng] Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\classes.html


              • 4. Re: running Eclipse TestNG plugin on a Seam project
                Jye Tucker Newbie

                Sounds like you are close!

                Hopefully the only thing you are missing now is a META-INF dir in your resources source folder.

                It should contain ejb-jar.xml and persistence.xml.

                • 5. Re: running Eclipse TestNG plugin on a Seam project
                  David Bernstein Newbie

                  Jye,

                  That was a very helpful hint and it's much further along, thanks. I plan to make a Wiki entry to help others get going more quickly once I've gotten it going. I think I'm asymptotically close now. I created a META-INF directory under my resource directory and placed ejb-jar.xml and persistence.xml in it. I'm reading up on EJB3 as fast as I can, but don't yet know how to fix what is going wrong. Compared to the ant session that is linked in will all the Seam source, my Eclipse project is missing the following messages (timestamps removed so I could diff):


                  ...
                  INFO (Ejb3DescriptorHandler.java:addClassAnnotation:1699) -adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to org.jboss.seam.example.registration.RegisterAction org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@ae4646
                  ...
                  INFO (Log4JLogger.java:info:94) -found EJB3 Entity bean: org.jboss.seam.example.registration.User
                  ...
                  INFO (Log4JLogger.java:info:94) -Binding entity from annotated class: org.jboss.seam.example.registration.User
                  INFO (Log4JLogger.java:info:94) -Bind entity org.jboss.seam.example.registration.User on table users
                  ..
                  INFO (Log4JLogger.java:info:94) -Registered new user #{user.username}
                  INFO (Log4JLogger.java:info:94) -no pages.xml file found
                  ...


                  and then instead of

                  Creating C:\java\jboss\jboss-seam-1.0.1.GA\examples\registration\test-output\Register.html

                  I get

                  javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select username from User where username=:username]
                  at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
                  ...
                  Caused by: javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select username from User where username=:username]
                  at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
                  ...
                  Caused by: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select username from User where username=:username]
                  at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)


                  Thanks,
                  Dave

                  The full unedited console output is:

                  INFO 26-06 09:19:00,800 (Log4JLogger.java:info:94) -reading components.xml
                  INFO 26-06 09:19:01,019 (Log4JLogger.java:info:94) -reading properties from: /seam.properties
                  INFO 26-06 09:19:01,050 (Log4JLogger.java:info:94) -reading properties from: /jndi.properties
                  INFO 26-06 09:19:01,050 (Log4JLogger.java:info:94) -initializing Seam
                  INFO 26-06 09:19:01,144 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
                  INFO 26-06 09:19:01,316 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.pages, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Pages
                  INFO 26-06 09:19:01,332 (Log4JLogger.java:info:94) -Component: events, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Events
                  INFO 26-06 09:19:01,347 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Manager
                  INFO 26-06 09:19:01,379 (Log4JLogger.java:info:94) -Component: switcher, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.Switcher
                  INFO 26-06 09:19:01,394 (Log4JLogger.java:info:94) -Component: redirect, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Redirect
                  INFO 26-06 09:19:01,394 (Log4JLogger.java:info:94) -Component: httpError, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.HttpError
                  INFO 26-06 09:19:01,410 (Log4JLogger.java:info:94) -Component: userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.UserPrincipal
                  INFO 26-06 09:19:01,425 (Log4JLogger.java:info:94) -Component: isUserInRole, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.IsUserInRole
                  INFO 26-06 09:19:01,441 (Log4JLogger.java:info:94) -Component: conversation, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Conversation
                  INFO 26-06 09:19:01,457 (Log4JLogger.java:info:94) -Component: conversationList, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationList
                  INFO 26-06 09:19:01,472 (Log4JLogger.java:info:94) -Component: conversationStack, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationStack
                  INFO 26-06 09:19:01,488 (Log4JLogger.java:info:94) -Component: facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesContext
                  INFO 26-06 09:19:01,488 (Log4JLogger.java:info:94) -Component: pageContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PageContext
                  INFO 26-06 09:19:01,519 (Log4JLogger.java:info:94) -Component: eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.EventContext
                  INFO 26-06 09:19:01,519 (Log4JLogger.java:info:94) -Component: sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.SessionContext
                  INFO 26-06 09:19:01,535 (Log4JLogger.java:info:94) -Component: statelessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.StatelessContext
                  INFO 26-06 09:19:01,535 (Log4JLogger.java:info:94) -Component: applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ApplicationContext
                  INFO 26-06 09:19:01,535 (Log4JLogger.java:info:94) -Component: conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationContext
                  INFO 26-06 09:19:01,613 (Log4JLogger.java:info:94) -Component: businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.BusinessProcessContext
                  INFO 26-06 09:19:01,613 (Log4JLogger.java:info:94) -Component: locale, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Locale
                  INFO 26-06 09:19:01,629 (Log4JLogger.java:info:94) -Component: messages, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.Messages
                  INFO 26-06 09:19:01,644 (Log4JLogger.java:info:94) -Component: interpolator, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Interpolator
                  INFO 26-06 09:19:01,660 (Log4JLogger.java:info:94) -Component: facesMessages, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesMessages
                  INFO 26-06 09:19:01,691 (Log4JLogger.java:info:94) -Component: resourceBundle, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.ResourceBundle
                  INFO 26-06 09:19:01,707 (Log4JLogger.java:info:94) -Component: localeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.LocaleSelector
                  INFO 26-06 09:19:01,707 (Log4JLogger.java:info:94) -Component: uiComponent, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.UiComponent
                  INFO 26-06 09:19:01,722 (Log4JLogger.java:info:94) -Component: org.jboss.seam.remoting.messaging.subscriptionRegistry, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.remoting.messaging.SubscriptionRegistry
                  INFO 26-06 09:19:01,754 (Log4JLogger.java:info:94) -Component: pojoCache, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PojoCache
                  INFO 26-06 09:19:01,988 (Log4JLogger.java:info:94) -Component: org.jboss.seam.core.ejb, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Ejb
                  INFO 26-06 09:19:02,082 (Log4JLogger.java:info:94) -scanning: C:\eclipse\workspace\seam-play\bin
                  INFO 26-06 09:19:02,160 (Log4JLogger.java:info:94) -scanning: C:\eclipse\workspace\seam-play\resource
                  INFO 26-06 09:19:02,175 (Log4JLogger.java:info:94) -Component: register, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.jboss.seam.example.registration.RegisterAction, JNDI: RegisterAction/local
                  INFO 26-06 09:19:02,238 (Log4JLogger.java:info:94) -Component: user, scope: SESSION, type: ENTITY_BEAN, class: org.jboss.seam.example.registration.User
                  INFO 26-06 09:19:02,269 (Log4JLogger.java:info:94) -starting the embedded EJB container
                  WARN 26-06 09:19:04,285 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
                  INFO 26-06 09:19:05,550 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/DefaultDS'
                  INFO 26-06 09:19:06,707 (Ejb3Deployment.java:create:467) -EJB3 deployment time took: 344
                  INFO 26-06 09:19:07,035 (Ejb3Deployment.java:create:467) -EJB3 deployment time took: 328
                  INFO 26-06 09:19:07,035 (MCKernelAbstraction.java:install:84) -installing bean: persistence.units:unitName=userDatabase with dependencies:
                  INFO 26-06 09:19:07,035 (MCKernelAbstraction.java:install:87) - AbstractDependencyMetaData@1217e67{dependency=DefaultDS}
                  INFO 26-06 09:19:07,113 (Log4JLogger.java:info:94) -Hibernate EntityManager 3.2.0.CR1
                  INFO 26-06 09:19:07,129 (Log4JLogger.java:info:94) -Hibernate Annotations 3.2.0.CR1
                  INFO 26-06 09:19:07,144 (Log4JLogger.java:info:94) -Hibernate 3.2 cr2
                  INFO 26-06 09:19:07,160 (Log4JLogger.java:info:94) -hibernate.properties not found
                  INFO 26-06 09:19:07,160 (Log4JLogger.java:info:94) -Bytecode provider name : cglib
                  INFO 26-06 09:19:07,191 (Log4JLogger.java:info:94) -using JDK 1.4 java.sql.Timestamp handling
                  INFO 26-06 09:19:07,347 (Log4JLogger.java:info:94) -Processing PersistenceUnitInfo [
                  name: userDatabase
                  ...]
                  WARN 26-06 09:19:07,347 (Log4JLogger.java:warn:104) -Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
                  INFO 26-06 09:19:07,363 (Log4JLogger.java:info:94) -Reading mappings from resource: META-INF/orm.xml
                  INFO 26-06 09:19:07,363 (Log4JLogger.java:info:94) -[PersistenceUnit: userDatabase] no META-INF/orm.xml found
                  INFO 26-06 09:19:07,425 (Log4JLogger.java:info:94) -Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
                  INFO 26-06 09:19:07,441 (Log4JLogger.java:info:94) -Using provided datasource
                  INFO 26-06 09:19:07,800 (Log4JLogger.java:info:94) -RDBMS: HSQL Database Engine, version: 1.8.0
                  INFO 26-06 09:19:07,800 (Log4JLogger.java:info:94) -JDBC driver: HSQL Database Engine Driver, version: 1.8.0
                  INFO 26-06 09:19:07,832 (Log4JLogger.java:info:94) -Using dialect: org.hibernate.dialect.HSQLDialect
                  INFO 26-06 09:19:07,879 (Log4JLogger.java:info:94) -Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
                  INFO 26-06 09:19:07,879 (Log4JLogger.java:info:94) -instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
                  INFO 26-06 09:19:07,879 (Log4JLogger.java:info:94) -instantiated TransactionManagerLookup
                  INFO 26-06 09:19:07,879 (Log4JLogger.java:info:94) -Automatic flush during beforeCompletion(): disabled
                  INFO 26-06 09:19:07,879 (Log4JLogger.java:info:94) -Automatic session close at end of transaction: disabled
                  INFO 26-06 09:19:07,879 (Log4JLogger.java:info:94) -JDBC batch size: 15
                  INFO 26-06 09:19:07,879 (Log4JLogger.java:info:94) -JDBC batch updates for versioned data: disabled
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Scrollable result sets: enabled
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -JDBC3 getGeneratedKeys(): disabled
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Connection release mode: auto
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Default batch fetch size: 1
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Generate SQL with comments: disabled
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Order SQL updates by primary key: disabled
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Using ASTQueryTranslatorFactory
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Query language substitutions: {}
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Second-level cache: enabled
                  INFO 26-06 09:19:07,894 (Log4JLogger.java:info:94) -Query cache: disabled
                  INFO 26-06 09:19:07,910 (Log4JLogger.java:info:94) -Cache provider: org.hibernate.cache.HashtableCacheProvider
                  INFO 26-06 09:19:07,910 (Log4JLogger.java:info:94) -Optimize cache for minimal puts: disabled
                  INFO 26-06 09:19:07,910 (Log4JLogger.java:info:94) -Structured second-level cache entries: disabled
                  INFO 26-06 09:19:07,925 (Log4JLogger.java:info:94) -Statistics: disabled
                  INFO 26-06 09:19:07,925 (Log4JLogger.java:info:94) -Deleted entity synthetic identifier rollback: disabled
                  INFO 26-06 09:19:07,925 (Log4JLogger.java:info:94) -Default entity-mode: pojo
                  INFO 26-06 09:19:08,019 (Log4JLogger.java:info:94) -building session factory
                  INFO 26-06 09:19:08,019 (Log4JLogger.java:info:94) -Not binding factory to JNDI, no JNDI name configured
                  INFO 26-06 09:19:08,035 (Log4JLogger.java:info:94) -Running hbm2ddl schema export
                  INFO 26-06 09:19:08,035 (Log4JLogger.java:info:94) -exporting generated schema to database
                  INFO 26-06 09:19:08,175 (Log4JLogger.java:info:94) -schema export complete
                  INFO 26-06 09:19:08,191 (Log4JLogger.java:info:94) -JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                  INFO 26-06 09:19:08,222 (MCKernelAbstraction.java:install:84) -installing bean: jboss.j2ee:jar=bin,name=RegisterAction,service=EJB3 with dependencies:
                  INFO 26-06 09:19:08,222 (MCKernelAbstraction.java:install:87) - AbstractDependencyMetaData@148e798{dependency=persistence.units:unitName=userDatabase}
                  INFO 26-06 09:19:08,613 (EJBContainer.java:start:553) -STARTED EJB: org.jboss.seam.example.registration.RegisterAction ejbName: RegisterAction
                  INFO 26-06 09:19:08,644 (Log4JLogger.java:info:94) -done initializing Seam
                  INFO 26-06 09:19:09,097 (Log4JLogger.java:info:94) -stopping the embedded EJB container
                  INFO 26-06 09:19:09,129 (Log4JLogger.java:info:94) -closing
                  INFO 26-06 09:19:09,129 (Log4JLogger.java:info:94) -Running hbm2ddl schema export
                  INFO 26-06 09:19:09,129 (Log4JLogger.java:info:94) -exporting generated schema to database
                  INFO 26-06 09:19:09,129 (Log4JLogger.java:info:94) -schema export complete
                  FAILED: testLogin
                  javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select username from User where username=:username]
                  at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
                  at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
                  at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:181)
                  at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
                  at $Proxy30.register(Unknown Source)
                  at org.jboss.seam.example.registration.RegisterTest$1.invokeApplication(RegisterTest.java:33)
                  at org.jboss.seam.mock.SeamTest$Script.run(SeamTest.java:242)
                  at org.jboss.seam.example.registration.RegisterTest.testLogin(RegisterTest.java:47)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
                  at org.testng.internal.Invoker.invokeMethod(Invoker.java:407)
                  at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:778)
                  at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
                  at org.testng.TestRunner.privateRun(TestRunner.java:682)
                  at org.testng.TestRunner.run(TestRunner.java:566)
                  at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220)
                  at org.testng.SuiteRunner.run(SuiteRunner.java:146)
                  at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:98)
                  at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
                  Caused by: javax.persistence.PersistenceException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select username from User where username=:username]
                  at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
                  at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:79)
                  at org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:127)
                  at org.jboss.seam.example.registration.RegisterAction.register(RegisterAction.java:35)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
                  at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
                  at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                  at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                  at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
                  ... 32 more
                  Caused by: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select username from User where username=:username]
                  at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
                  at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
                  at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
                  at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:267)
                  at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3049)
                  at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2938)
                  at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
                  at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
                  at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
                  at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
                  at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:227)
                  at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:159)
                  at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:110)
                  at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
                  at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
                  at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
                  at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
                  at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
                  at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1612)
                  at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:76)
                  ... 47 more


                  ===============================================
                  Register
                  Tests run: 1, Failures: 1, Skips: 0
                  ===============================================


                  ===============================================
                  Registration
                  Total tests run: 1, Failures: 1, Skips: 0
                  ===============================================


                  • 6. Re: running Eclipse TestNG plugin on a Seam project
                    David Bernstein Newbie

                    Anybody got any ideas? Adding

                    <component class="org.jboss.seam.example.registration.User"/>

                    to components.xml doesn't seem to change anything. If I create a META-INF/orm.xml file (which the correctly functioning ant version doesn't have) with the following contents:

                    <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
                     version="1.0">
                     <entity class="org.jboss.seam.example.registration.User" access="PROPERTY">
                     </entity>
                    </entity-mappings>


                    then it's still missing the "adding class annotation DefaultInterceptorMarker" and "found EJB3 Entity bean: org.jboss.seam.example.registration.User" messages, but it doesn get the messages about binding entity from annotated class User to table users. As the test proceeds, the error about user not being mapped doesn't show up, but then when the test runs, it fails to get the user instance
                    User user = (User) Component.getInstance("user", true);
                    assert user!=null;


                    Is there anybody with some more Seam experience who can suggest what might be misconfigured?

                    Thanks.

                    • 7. Re: running Eclipse TestNG plugin on a Seam project
                      David Bernstein Newbie

                      Mystery solved: The "resource" directory in my project was entered into the project's classpath as a "class folder" in the "Libraries" tab of the "Java Build Path" property for the project. I moved it to being a source folder and it worked. Voila.

                      • 8. Re: running Eclipse TestNG plugin on a Seam project
                        Jye Tucker Newbie

                        Glad to hear you are up and running!