My C:\source\project3\core\src\main\resources\applicationContext.xml ############################################## <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" default-lazy-init="true"> <bean id="personDao" class="nl.osix.dsm.dao.hibernate.PersonDaoHibernate"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- END SNIPPET: personDao -->
<!-- Add new DAOs here --> <!-- Add new Managers here --> <bean id="personManager" class="org.appfuse.service.impl.GenericManagerImpl" > <constructor-arg ref="personDao"/> </bean> </beans ############################################## mraible wrote: > > Please post the contents of core/src/main/resources/ > applicationContext.xml and make sure you don't have a web/src/main/ > resources/applicationContext.xml file. > > Matt > > On Jan 11, 2008, at 1:06 PM, os57741 wrote: > >> >> Matt, >> One step further. >> I have did as you said. >> (there is nothing in the >> project3/web/src/main/webapp/WEB-INF/applicationContext.xml file) >> Then I defined the PersonControllerTest and modified the >> dispatcher-servlet.xml with PersonController bean >> >> <bean id="personController" >> class="nl.osix.dsm.webapp.controller.PersonController"> >> <property name="personManager" ref="personManager"/> >> </bean> >> >> When I run the PersonControllerTest from the project root it runs. >> If I run jetty:run-war from the web directory I get the following >> error: >> >> ######################################## >> Test set: nl.osix.dsm.webapp.controller.PersonControllerTest >> ---------------------------------------------------------------------- >> --------- >> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: >> 4.656 sec >> <<< FAILURE! >> testHandleRequest >> (nl.osix.dsm.webapp.controller.PersonControllerTest) Time >> elapsed: 4.625 sec <<< ERROR! >> org.springframework.beans.factory.BeanCreationException: Error >> creating bean >> with name 'personController' defined in ServletContext resource >> [/WEB-INF/dispatcher-servlet.xml]: Cannot resolve reference to bean >> 'personManager' while setting bean property 'personManager'; nested >> exception is >> org.springframework.beans.factory.NoSuchBeanDefinitionException: No >> bean >> named 'personManager' is defined >> ################################################## >> >> >> >> >> mraible wrote: >>> >>> Your personManager and personDao bean definitions should both be in >>> core/src/main/resources/applicationContext.xml. >>> >>> Matt >>> >>> On Jan 11, 2008, at 10:16 AM, os57741 wrote: >>> >>>> >>>> Matt, >>>> Sorry, to bother you again, but I still have problem, probably due >>>> a lack of >>>> knowledge cq experience. >>>> >>>> In the core module I have defined a personDao interface. >>>> The personDao test is running. >>>> >>>> I get a problem as soon as I run jetty in the web module. >>>> >>>> It probably has to do with the personManager. >>>> This is the content of the >>>> project3/web/src/main/webapp/WEB-INF/applicationContext.xml file >>>> >>>> ################################### >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <beans xmlns="http://www.springframework.org/schema/beans" >>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>> xsi:schemaLocation="http://www.springframework.org/schema/ >>>> beans >>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" >>>> default-lazy-init="true"> >>>> >>>> <bean id="personManager" >>>> class="org.appfuse.service.impl.GenericManagerImpl"> >>>> <constructor-arg ref ="personDao"/> >>>> >>>> </bean> >>>> </beans> >>>> ############################################### >>>> When I run mvn jetty:run-war I get the following error >>>> org.springframework.beans.factory.BeanCreationException: Error >>>> creating bean >>>> with name 'personController' defined in ServletContext resource >>>> [/WEB-INF/dispatcher-servlet.xml]: Cannot resolve reference to bean >>>> 'personManager' while setting bean property 'personManager'; nested >>>> exception is >>>> org.springframework.beans.factory.BeanCreationException: Error >>>> creating bean with name 'personManager' defined in ServletContext >>>> resource >>>> [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean >>>> 'personDao' while setting constructor argument; nested exception is >>>> org.springframework.beans.factory.NoSuchBeanDefinitionException: No >>>> bean >>>> named 'personDao' is defined >>>> >>>> The personDao is defined but apparently spring cannot find it. >>>> What am I doing wrong? >>>> Once again, thanks for your time. >>>> >>>> By the way: I got confused about the action class as a PersonAction >>>> exists >>>> in the service-tutorial >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> mraible wrote: >>>>> >>>>> Controller should go in the web module, as stated in the tutorial. >>>>> You are correct that Actions are for Struts - maybe you're reading >>>>> the wrong tutorial? >>>>> >>>>> Matt >>>>> >>>>> On Jan 9, 2008, at 12:45 AM, os57741 wrote: >>>>> >>>>>> >>>>>> Matt, Thanks for answering. >>>>>> Yes, I applied the proper names, but should I put the controller >>>>>> stuff in >>>>>> the core module or in the web module (as generated by the >>>>>> archetype)? >>>>>> And about the Action stuff: I have the idea that that is not used >>>>>> by Spring >>>>>> MVC but by Struts? Is that right? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> mraible wrote: >>>>>>> >>>>>>> If you're using Spring MVC, you should use $ >>>>>>> {groupId}.webapp.controller as your package name. You can find $ >>>>>>> {groupId} in pom.xml as the value for <groupId>. >>>>>>> >>>>>>> HTH, >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> On Jan 8, 2008, at 2:43 PM, os57741 wrote: >>>>>>> >>>>>>>> >>>>>>>> Hi Everybody, >>>>>>>> I am going through the tutorials. I have setup a modular Spring >>>>>>>> MVC >>>>>>>> configuration. >>>>>>>> Some tests work, some don't. >>>>>>>> I suspect that I didn't put the packages in the correct >>>>>>>> location. >>>>>>>> The >>>>>>>> Services tutorial is not clear on that. >>>>>>>> The Dao stuff I have put in the core module and the controller >>>>>>>> stuff in the >>>>>>>> webapp module. >>>>>>>> I am not sure if I understood well where to put the following >>>>>>>> packages: >>>>>>>> - service with the PersonManager interface >>>>>>>> - service.impl with the PersonManagerImpl class >>>>>>>> >>>>>>>> I also wonder if there shouldn't be webapp.action package with a >>>>>>>> PersonAction class. >>>>>>>> Where else should I put the setPersonManager methods ? >>>>>>>> Any help very much appreciated. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> View this message in context: http://www.nabble.com/Location-of- >>>>>>>> Controller-and-Service-packages-in-Modular-Spring-MVC- >>>>>>>> tp14699664s2369p14699664.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/Location-of- >>>>>> Controller-and-Service-packages-in-Modular-Spring-MVC- >>>>>> tp14699664s2369p14706620.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/Location-of- >>>> Controller-and-Service-packages-in-Modular-Spring-MVC- >>>> tp14699664s2369p14761160.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/Location-of- >> Controller-and-Service-packages-in-Modular-Spring-MVC- >> tp14699664s2369p14763913.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/Location-of-Controller-and-Service-packages-in-Modular-Spring-MVC-tp14699664s2369p14764748.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]