4 Replies Latest reply: Jun 11, 2010 10:38 AM by Dan Allen RSS

simple test scenario - cannot detect what's going

Jan Groth Novice

hi there,

 

I'm halfway through Nicklas' tutorial "AHitchhikersGuideToJavaEE6ApplicationSetup". While I had Arquillian up and running in Part I, my (trivial) tests fail with a (non-trival) java.lang.ClassNotFoundException after I added ICE-Faces to the project (Part II of the tutorial).

 

As the error message leaves me without a clue what's actually going wrong, I'm posting here ;-)

 

Setup: http://in.relation.to/Bloggers/AHitchhikersGuideToJavaEE6ApplicationSetupPartII

 

The Test itself is trival (and commented out)

 

@RunWith(Arquillian.class)
public class GreetingTest {

    @Inject
    GreetingBean greetingBean;

    @Deployment
    public static JavaArchive createTestArchive() {

        return ShrinkWrap.create("test.jar", JavaArchive.class).addClass(
                GreetingBean.class).addManifestResource(
                new ByteArrayAsset("<beans/>".getBytes()),
                ArchivePaths.create("beans.xml"));
    }

    @Test
    public void testInjection() {
        greetingBean.setGreeting("hallo welt");
        // Assert.assertEquals("hallo welt", greetingBean.getGreeting());
        // Assert.assertEquals(0, greetingBean.getGreetings().size());
        // greetingBean.addGreeting();
        // Assert.assertEquals(1, greetingBean.getGreetings().size());
    }
}

 

 

JBoss 6.0 M3 starts without complaining, tests are created and  deployed:

 

13:33:08,202 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.20100429-M3 "Neo"] Started in 32s:811ms
13:34:02,650 INFO  [org.jboss.deployment.MainDeployer] deploy, url=file:/D:/dev/workspace/default/JeeMin/test.war
13:34:09,580 INFO  [org.jboss.weld.Version] WELD-000900 1.0.1 (CR2)
13:34:09,982 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/test
13:34:11,511 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] undeploy, ctxPath=/test

 

No matter whether I run the test through maven or Eclipse / JUnit plugin, it fails like this:

 


Test set: com.helvetia.ch.JeeMin.GreetingTest

-


Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 11.443 sec &lt;&lt;&lt; FAILURE!

testInjection(com.helvetia.ch.JeeMin.GreetingTest)  Time elapsed: 0.118 sec  &lt;&lt;&lt; ERROR!

org.jboss.arquillian.impl.event.FiredEventException: java.lang.IllegalStateException: Error launching test com.helvetia.ch.JeeMin.GreetingTest public void com.helvetia.ch.JeeMin.GreetingTest.testInjection()

    at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:68)

    at org.jboss.arquillian.impl.context.AbstractEventContext.fire(AbstractEventContext.java:115)

    at org.jboss.arquillian.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:117)

    at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:228)

    at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:191)

    at org.jboss.arquillian.junit.Arquillian$5$1.evaluate(Arquillian.java:209)

    at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(Arquillian.java:272)

    at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:205)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

    at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:152)

    at org.jboss.arquillian.junit.Arquillian$3$1.evaluate(Arquillian.java:170)

    at org.jboss.arquillian.junit.Arquillian$MultiStatementExecutor.execute(Arquillian.java:272)

    at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:166)

    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

    at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:118)

    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)

    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)

    at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)

    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)

    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:597)

    at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)

    at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

Caused by: java.lang.IllegalStateException: Error launching test com.helvetia.ch.JeeMin.GreetingTest public void com.helvetia.ch.JeeMin.GreetingTest.testInjection()

    at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:61)

    at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:50)

    at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:40)

    at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63)

    ... 30 more

Caused by: java.lang.ClassNotFoundException: org.jboss.weld.exceptions.WeldException

    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

    at java.lang.Class.forName0(Native Method)

    at java.lang.Class.forName(Class.java:247)

    at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)

    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)

    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)

    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)

    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)

    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)

    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)

    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

    at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.execute(ServletMethodExecutor.java:88)

    at org.jboss.arquillian.protocol.servlet.ServletMethodExecutor.invoke(ServletMethodExecutor.java:57)

    ... 33 more

 

What did I change between yesterday and today? Usual answer: "Nothing" - I just added the ICE-faces jars ;-)

 

Any help highly appreciated,

 

cheers,

Jan