If you're using JSF, your issue may be caused by the following bug:

http://issues.appfuse.org/browse/APF-905

Matt

On 9/28/07, justin_wang <[EMAIL PROTECTED]> wrote:
>
> I create two POJO Category and AuctionIem and generate all the code through
> appfuse:gen, install is successful, but when I run "mvn jetty:run-war" I got
> the error
>
> =================================================
> Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.031 sec
> <<< FAILURE!
> testAdd(com.mycompany.app.webapp.action.CategoryFormTest)  Time elapsed:
> 0.015 sec  <<< ERROR!
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name 'com.mycompany.app.webapp.action.CategoryFormTest':
> Unsatisfied dependency expressed through bean property 'categoryManager':
> There are 2 beans of type [org.appfuse.service.GenericManager] available for
> autowiring by type: [categoryManager, auctionItemManager]. There should have
> been exactly 1 to be able to autowire property 'categoryManager' of bean
> 'com.mycompany.app.webapp.action.CategoryFormTest'. Consider using
> autowiring by name instead.
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:935)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:833)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:273)
>         at
> org.springframework.test.AbstractDependencyInjectionSpringContextTests.injectDependencies(AbstractDependencyInjectionSpringContextTests.java:179)
>         at
> org.springframework.test.AbstractDependencyInjectionSpringContextTests.prepareTestInstance(AbstractDependencyInjectionSpringContextTests.java:158)
>         at
> org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:88)
>         at junit.framework.TestCase.runBare(TestCase.java:132)
>         at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>         at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>         at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>         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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
>         at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
> =================================================
>
> anybody know what is this problem? do I need use autowiring by name? if yes,
> how to use it?
>
> Thank you very much
>
> --
> View this message in context: 
> http://www.nabble.com/please-help-me-%28autowiring-by-name-%29-tf4537416s2369.html#a12950370
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to