I've been working with AppFuse 2.0.1 successfully since its release.  I ran
into that problem suddenly on March 18. My suspicion is that Maven
downloaded some latest jar which causes this problem
  
I just looked into my local m2 repository and found out that Maven has
downloaded a new surefire plugin version 2.4.2 on March 18. I consulted the
plugin's web site and found a bug report at:

  http://jira.codehaus.org/browse/SUREFIRE-475

The report seems to describe our issue which is unresolved. Meanwhile you
can
a) either follow their work-around description,
b) insist in the pom.xml on using a former surefire plugin version.

In the build plugin section add the following:
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.3</version>
        </plugin>

Don't forget to change the testResorurces section to its original state:
       <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
            <testResource>
                <directory>src/main/webapp</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </testResource>
        </testResources>
 

Aled, I think this should solve it. Can you confirm? I ran several
integration-tests on my project with different databases and it worked.

Good luck,
Martin

 

Aled Rhys Jones wrote:
> 
> This seems to have helped a lot, thanks guys.
> 
> I now get the same error with all my controller tests, it can't find the
> userManager.  This is part of appfuse, so I assume I've done something
> wrong
> upgrading to 2.0.1.  It worked ok in 2.0 I think.
> 
> e.g.
> testHandleRequest(com._8media.travelbeen.webapp.controller.AssociationContro
> llerTest)  Time elapsed: 0.309 sec  <<< ERROR!
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'passwordHintController' defined in ServletContext resource
> [/WEB-INF/dispatcher-servlet.xml]: Cannot resolve reference to bean
> 'userManager' while setting bean property 'userManager'; nested exception
> is
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
> named 'userManager' is defined
>       at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
> eReference(BeanDefinitionValueResolver.java:274)
>       at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
> eValueIfNecessary(BeanDefinitionValueResolver.java:104)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
> .applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1274)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
> .populateBean(AbstractAutowireCapableBeanFactory.java:1042)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
> .doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
> $1.run(AbstractAutowireCapableBeanFactory.java:485)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
> .createBean(AbstractAutowireCapableBeanFactory.java:455)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(Ab
> stractBeanFactory.java:251)
>       at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSi
> ngleton(DefaultSingletonBeanRegistry.java:169)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
> ctBeanFactory.java:248)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
> ctBeanFactory.java:170)
>       at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
> antiateSingletons(DefaultListableBeanFactory.java:413)
>       at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFac
> toryInitialization(AbstractApplicationContext.java:735)
>       at
> org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
> actApplicationContext.java:369)
>       at
> org.appfuse.webapp.controller.BaseControllerTestCase.loadContextLocations(Ba
> seControllerTestCase.java:56)
>       at
> org.springframework.test.AbstractSingleSpringContextTests.loadContext(Abstra
> ctSingleSpringContextTests.java:187)
>       at
> org.springframework.test.AbstractSpringContextTests.getContext(AbstractSprin
> gContextTests.java:140)
>       at
> org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSing
> leSpringContextTests.java:100)
>       at junit.framework.TestCase.runBare(TestCase.java:132)
>       at
> org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.jav
> a:76)
>       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(Ab
> stractDirectoryTestSuite.java:140)
>       at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractD
> irectoryTestSuite.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(SurefireB
> ooter.java:338)
>       at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997
> )
> Caused by:
> org.springframework.beans.factory.NoSuchBeanDefinitionException:
> No bean named 'userManager' is defined
>       at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean
> Definition(DefaultListableBeanFactory.java:391)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocal
> BeanDefinition(AbstractBeanFactory.java:999)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
> ctBeanFactory.java:233)
>       at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
> ctBeanFactory.java:170)
>       at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolv
> eReference(BeanDefinitionValueResolver.java:268)
>       ... 37 more
> 
> 
> Where should it be getting the bean definition?
> Thanks
> Aled
> 
> -----Neges Wreiddiol/Original Message-----
> From: Martin Homik [mailto:[EMAIL PROTECTED] 
> Sent: 25 March 2008 11:30
> To: users@appfuse.dev.java.net
> Subject: Re: [appfuse-user] UnsatisfiedDependencyException -Solved-
> 
> 
> This does not work for me. If you clean your project and run the tests,
> it'll
> fail.
> Maybe, I have just found another not so elegant solution. I copied the
> testResource
> part and renamed the copy's directory to: src/main/webapp/WEB-INF. Hence,
> I ended up with:
> 
> <testResources>
>             <testResource>
>                 <directory>src/test/resources</directory>
>                 <filtering>true</filtering>
>             </testResource>
>             <testResource>
>                 <directory>src/main/webapp</directory>
>                 <filtering>true</filtering>
>                 <includes>
>                     <include>**/*.xml</include>
>                 </includes>
>             </testResource>
>             <testResource>
>                 <directory>src/main/webapp/WEB-INF</directory>
>                 <filtering>true</filtering>
>                 <includes>
>                     <include>**/*.xml</include>
>                 </includes>
>             </testResource>
>         </testResources>
> 
> It seems to work.
> 
> Cheers,
> Martin
> 
> 
> 
> Campa wrote:
>> 
>> Hi guys,
>> 
>> I have solved these issue changing the section of pom.xml from:
>> 
>>           <testResource>
>>                 <directory>src/main/webapp</directory>
>>                 <filtering>true</filtering>
>>                 <includes>
>>                     <include>**/*.xml</include>
>>                 </includes>
>>             </testResource>
>> 
>> 
>> to:
>> 
>>            <testResource>
>>                 <directory>src/main/webapp/WEB-INF</directory>
>>                 <filtering>true</filtering>
>>                 <includes>
>>                     <include>*.xml</include>
>>                 </includes>
>>             </testResource>
>> 
>> Seems the wildchars ** does not work, as ant users expect in spring
>> classloader...it does not descend the tree.. only use ** as a file/dir
>> name.
>> 
>> Hope this help you.
>> Bye
>> Campa
>> 
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/UnsatisfiedDependencyException-tp15793588s2369p1627399
> 6.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/UnsatisfiedDependencyException-tp15793588s2369p16300428.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


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

Reply via email to