|
From: Lars F. <lar...@gm...> - 2003-08-23 12:35:33
|
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
|