6 Replies Latest reply on Nov 12, 2010 4:09 AM by Aslak Knutsen

    jbossas.managed_6 test works with JUnit but fails with Test-NG

    Thorsten Kunz Novice

      I just strated to play around with Arquillian and worked through the example posted here:http://community.jboss.org/en/arquillian/blog/2010/10/04/the-perfect-recipe-for-testing-jpa-2-revisited

       

      After some trial and error it is now humming along just fine... very cool stuff btw.

       

      Now I tried to migrate the example from JUnit to Test-NG. Everything seems to be ok but when I run the test I get this Exception on the AS:

       

      12:56:11,604 INFO  [org.hibernate.impl.SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=test.war#test
      12:56:11,606 INFO  [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      12:56:11,608 INFO  [org.hibernate.impl.SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=test.war#test
      12:56:11,608 WARN  [org.hibernate.impl.SessionFactoryObjectFactory] InitialContext did not implement EventContext
      12:56:11,614 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
      12:56:11,617 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
      12:56:11,623 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] Running hbm2ddl schema export
      12:56:11,623 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] exporting generated schema to database
      12:56:11,624 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] schema export complete
      12:56:11,627 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
      12:56:11,630 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
      12:56:11,631 INFO  [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      12:56:11,734 INFO  [org.jboss.weld.Version] WELD-000900 1.1.0 (Beta1)
      12:56:12,152 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/test
      12:56:12,293 INFO  [org.jboss.resteasy.cdi.CdiInjectorFactory] Found BeanManager at java:comp/BeanManager
      12:56:12,417 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/test].[ServletTestRunner]] Servlet.service() for servlet ServletTestRunner threw exception: java.lang.ClassNotFoundException: com.beust.jcommander.ParameterException from BaseClassLoader@744cdfbb{vfs:///home/thorsten/Development/Flexarc/Workspaces/Pegasus/event-dispatcher/test.war}
          at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.Alpha8]
          at java.lang.ClassLoader.loadClass(ClassLoader.java:266) [:1.6.0_20]
          at org.jboss.arquillian.testng.TestNGTestRunner.execute(TestNGTestRunner.java:48) [:]
          at org.jboss.arquillian.protocol.servlet_3.ServletTestRunner.doGet(ServletTestRunner.java:84) [:]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [:1.0.0.Beta2]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Beta2]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100911-M5]
          at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100911-M5]
          at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:68) [:2010-08-30 15:40]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.20100911-M5]
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.20100911-M5]
          at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.CR3]
          at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.CR3]
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.20100911-M5]
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.20100911-M5]
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.20100911-M5]
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20100911-M5]
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.20100911-M5]
          at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.20100911-M5]
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.20100911-M5]
          at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:893) [:6.0.0.20100911-M5]
          at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:599) [:6.0.0.20100911-M5]
          at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2024) [:6.0.0.20100911-M5]
          at java.lang.Thread.run(Thread.java:636) [:1.6.0_20]
      

       

      I am using AS 6 M5.

       

      Is that a bug or am I missing something?

       

      Thanks, Thorsten