5 Replies Latest reply on Nov 25, 2008 6:42 PM by Raghunath Nandy

    Seam testing is failing

    Raghunath Nandy Newbie

      Hi


      I'm using jboss-seam-2.1.1.CR1 on jboss 4.2. I generated one sample app using jboss tools. And after generation Seam Form, I just want to test this form component. Im getting following exception when I'm running TestNG case.


      _(ClassNotFoundException: [Ljava.lang.Class)_




      testng-customsuite.xml
      temp-testng-customsuite.xml
      
      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Described: name=BeanDeployer state=PreInstall
      java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException
           at org.jboss.aop.util.ClassInfoMethodHashing.methodHash(ClassInfoMethodHashing.java:70)
           at org.jboss.aop.util.ClassInfoMethodHashing.addDeclaredMethods(ClassInfoMethodHashing.java:169)
           at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:182)
           at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
           at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
           at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
           at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
           at org.jboss.aop.util.ClassInfoMethodHashing.populateMethodTables(ClassInfoMethodHashing.java:181)
           at org.jboss.aop.util.ClassInfoMethodHashing.getMethodMap(ClassInfoMethodHashing.java:188)
           at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getMethodAnnotationDependencies(AOPDependencyBuilder.java:197)
           at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getAnnotationDependencies(AOPDependencyBuilder.java:152)
           at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getDependencies(AOPDependencyBuilder.java:130)
           at org.jboss.classadapter.plugins.BasicClassAdapter.getDependencies(BasicClassAdapter.java:80)
           at org.jboss.beans.info.plugins.AbstractBeanInfo.getDependencies(AbstractBeanInfo.java:211)
           at org.jboss.kernel.plugins.dependency.DescribeAction.installActionInternal(DescribeAction.java:53)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
           at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
           at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
           at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
           at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
           at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
           at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
           at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1025)
           at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:916)
           at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
           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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
           at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278)
           at org.testng.SuiteRunner.run(SuiteRunner.java:198)
           at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823)
           at org.testng.TestNG.runSuitesLocally(TestNG.java:790)
           at org.testng.TestNG.run(TestNG.java:708)
           at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      Caused by: java.lang.reflect.UndeclaredThrowableException
           at org.jboss.reflect.plugins.ArrayInfoImpl.getType(ArrayInfoImpl.java:103)
           at org.jboss.reflect.plugins.ClassInfoImpl.isArray(ClassInfoImpl.java:495)
           at org.jboss.aop.util.ClassInfoMethodHashing.getTypeString(ClassInfoMethodHashing.java:149)
           at org.jboss.aop.util.ClassInfoMethodHashing.methodHash(ClassInfoMethodHashing.java:53)
           ... 53 more
      Caused by: java.lang.ClassNotFoundException: [Ljava.lang.Class;
           at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
           at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
           at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.resolveComplexTypeInfo(IntrospectionTypeInfoFactoryImpl.java:367)
           at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactoryImpl.getTypeInfo(IntrospectionTypeInfoFactoryImpl.java:344)
           at org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory.getTypeInfo(IntrospectionTypeInfoFactory.java:54)
           at org.jboss.reflect.plugins.ArrayInfoImpl.getType(ArrayInfoImpl.java:99)
           ... 56 more


        • 1. Re: Seam testing is failing
          Olivier Thierry Apprentice

          You should paste the code of your test to get help.

          • 2. Re: Seam testing is failing
            Raghunath Nandy Newbie

            Olivier,
            Thanks for your reply


            my code is simple :



            package org.domain.t2.test;
            
            import org.testng.annotations.Test;
            import org.jboss.seam.mock.SeamTest;
            
            public class MainCollegeTest extends SeamTest {
            
                 @Test
                 public void test_MainCollege() throws Exception {
                      new FacesRequest() {
                           @Override
                           protected void invokeApplication() {
                                //call action methods here
                                invokeMethod("#{MainCollege.helloworld}");
                           }
                      }.run();
                 }
            }



            MainCollege is simple class with helloworld method.


            thanks
            raghu

            • 3. Re: Seam testing is failing
              Raghunath Nandy Newbie

              This code is generated by JBoss eclipse Seam tools when I created the Seam action through JBoss eclipse seam tools


              thanks
              raghu

              • 4. Re: Seam testing is failing
                Raghunath Nandy Newbie
                Hi

                I cleared that error by adding -Dsun.lang.ClassLoader.allowArraySyntax=true in jvm arguements.

                Now i'm getting some other error(this is happening seam validation). I have only one component Authenticator in my class path.


                `
                FAILED CONFIGURATION: @BeforeSuite startSeam
                java.lang.IllegalStateException: Two components with the same name and precedence - component name: authenticator, component classes: org.domain.t5.session.Authenticator, org.domain.t5.session.Authenticator
                     at org.jboss.seam.init.Initialization.addComponentDescriptor(Initialization.java:595)
                     at org.jboss.seam.init.Initialization.installScannedComponentAndRoles(Initialization.java:948)
                     at org.jboss.seam.init.Initialization.installHotDeployableComponents(Initialization.java:845)
                     at org.jboss.seam.init.Initialization.init(Initialization.java:724)
                     at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:920)
                     at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
                ... Removed 15 stack frames
                SKIPPED CONFIGURATION: @BeforeClass setupClass
                SKIPPED CONFIGURATION: @BeforeMethod begin
                SKIPPED CONFIGURATION: @AfterMethod end
                SKIPPED CONFIGURATION: @AfterClass clean

                `
                • 5. Re: Seam testing is failing
                  Raghunath Nandy Newbie

                  Hi


                  Yahoo ! I'm able to test this. I removed seam.properties from not-testing project temperately . this file exists 2 times in testing-project class path. now it's working fine.Because of this ,it's getting Two components with the same name and precedence
                  exception


                  thanks
                  raghu