|
From: Lars F. <lar...@gm...> - 2003-08-23 13:55:57
|
Thomas,
attached is the web.xml.
Without the ContextLoaderListener nothing would happen, not even
the Hibernate stuff in applicationContext.xml.
Thanks
Lars
> Lars,
>
> You did not include your web.xml, but my guess is you need to add a
> ContextLoaderListener. The application context has to be loaded first,
> and the
> error messages indicates that the bean 'cwxDao' can't be found, so it
> looks like
> that did not happen.
>
> web.xml:
>
> <web-app>
>
> <!--
> - Loads the root application context of this web app at startup,
> - by default from "/WEB-INF/applicationContext.xml".
> -->
> <listener>
> <listener-class>
> com.interface21.web.context.ContextLoaderListener
> </listener-class>
> </listener>
>
> <!-- more definitions -->
>
> </web-app>
>
>
> Hope this helps.
>
> Thomas
>
>
>
> > Hi all Spring experts,
> >
> > can anyone provide me the example classes mentioned in several skeletons
>
> > (e.g. exampleController, exampleBusinessObject, exampleDataAccessObject)
> ?
> >
> > The two provided sample applications don't reflect the skeletons very
> well.
> > There should be one 'big' application showing all the stuff and many
> small
> > ones to show single options (like in WebWork 1).
> >
> > I've defined the following in applicationContext.xml (and it works):
> >
> > <bean id="cwxDao" class="example.dao.CwxDaoHibernate">
> > <property name="sessionFactory"><ref
> bean="cwxSessionFactory"/></property>
> > </bean>
> >
> > When defining
> >
> > (cwx-servlet.xml)
> >
> > <!-- Controller for the initial "Hello" page -->
> > <bean id="cwxController" class="example.web.CwxController">
> > <property name="cwxDao"><ref external="cwxDao"/></property>
> > </bean>
> >
> > (CwxController)
> >
> > private CwxDao cwxDao;
> >
> > public void setCwxDao(CwxDao cwxDao) {
> > this.cwxDao = cwxDao;
> > }
> >
> >
> > I always get
> >
> > ERROR [com.interface21.web.servlet.DispatcherServlet] - <Servlet with
> name
> > 'cwx' : initialization error>
> > com.interface21.beans.factory.NoSuchBeanDefinitionException: No bean
> named
> > [cwxDao] is defined {class
> com.interface21.beans.factory.xml.XmlBeanFactory:
> > defined beans [messageSource,viewResolver,urlMapping,cwxController]}
> >
> > This is the second time I get almost useless error messages. This is one
> > point where EJBs are far ahead (
> > there is almost always an error message telling you what excactly is
> > wrong).
> >
> > Another (dumb) question:
> >
> > What is the difference between a DAO *implementation* and a business
> object
> > and where does
> > e. g. Petclinic reflect this ? I'm asking this because of the diiference
> > between the skeletons and the
> > sample applications. The skeletons provide a DAO and a Business Object
> using
> > the DAO definition,
> > Petclinic does not. The samples should be as close as possible to the
> > skeletons or the skeletons should
> > at least provide the java classes (shouldn't be too hard).
> >
> > Thanks in advance
> > Lars
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: VM Ware
> > With VMware you can run multiple operating systems on a single machine.
> > WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
> > at the same time. Free trial click
> here:http://www.vmware.com/wl/offer/358/0
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>
>
> |