but now I have the following problem:
[12:14:02.213] java.lang.IllegalArgumentException: No SessionFactory specified
[12:14:02.213] at org.springframework.util.Assert.notNull(Assert.java:90)
[12:14:02.213] at org.springframework.orm.hibernate.SessionFactoryUtils.getSession(Session FactoryUtils.java:273)
[12:14:02.213] at org.springframework.orm.hibernate.SessionFactoryUtils.getSession(Session FactoryUtils.java:183)
[12:14:02.213] at org.andromda.samples.springanimalquiz.decisiontree.DecisionItemDaoBase.f indRoot(DecisionItemDaoBase.java:187)
[12:14:02.213] at org.andromda.samples.springanimalquiz.decisiontree.DecisionItemDaoBase.f indRoot(DecisionItemDaoBase.java:178)
[12:14:02.213] at org.andromda.samples.springanimalquiz.decisiontree.DecisionItemDaoBase.f indRoot(DecisionItemDaoBase.java:160)
[12:14:02.213] at org.andromda.samples.springanimalquiz.decisiontree.DecisionServiceImpl.h andleGetFirstQuestion(DecisionServiceImpl.java:33)
[12:14:02.213] at org.andromda.samples.springanimalquiz.decisiontree.DecisionServiceBase.g etFirstQuestion(DecisionServiceBase.java:106)
AFAI can see, applicationContext.xml looks good to me and references a SessionFactory:
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<list>
<value>org/andromda/samples/springanimalquiz/decisiontree/ DecisionItem.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.PostgreSQLDialect</ prop>
<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvi der</prop>
<prop key="hibernate.cache.query_cache_factory">net.sf.hibernate.cache.Standar dQueryCacheFactory</prop>
</props>
</property>
</bean>
<!-- The Hibernate interceptor -->
<bean id="hibernateInterceptor" class="org.springframework.orm.hibernate.HibernateInterceptor">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<!-- Transaction Manager -->
<bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
<property name="sessionFactory"><ref local="sessionFactory"/></property>
</bean>
This is my implementation for getFirstQuestion from DecisionServiceImpl:
protected org.andromda.samples.springanimalquiz.decisiontree.DecisionItem handleGetFirstQuestion()
throws java.lang.Exception
{
try {
DecisionItemDaoBase d = new DecisionItemDaoImpl();
java.util.Collection dItems = d.findRoot();
DecisionItem dItem;
if (dItems.isEmpty()) {
dItem = new AnimalDaoImpl().create( "elephant", true );
}
else {
dItem = (DecisionItem) dItems.iterator().next();
}
return dItem;
}
catch (DecisionException e) {
throw new Exception(e);
}
}
perhaps I'm missing something else regarding the initalization of some stuff?
Jan
Am 23.01.2005 um 10:20 schrieb Jan Heise:
Just a guess:
DecisionItemDAO is an interface, the Entity DecisionItem is abstract - there are no methods in the interface after code generation.
So for sure there is nothing that matches "*".
Jan
Am 23.01.2005 um 09:19 schrieb Jan Heise:
well, I guess if the first one get's fixed, the second one won't bother me.
I filed a JIRA issue, but I have no clue for a more specific problem desciption.
Jan
Am 23.01.2005 um 01:59 schrieb Chad Brandon:
The first one seconds like a bug (which I'll fix if you file a JIRA issue).
The second one I'm not sure about.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jan Heise
Sent: Saturday, January 22, 2005 5:46 PM
To: [email protected]
Subject: [Andromda-user] Resin&Spring Cartridge Problem (Transactions?)
Hi,
I have the following exception:
[01:44:53.999] ExceptionHandler caught this exception:
[01:44:53.999]
org.springframework.transaction.TransactionUsageException: Couldn't
find method '*' on class
[org.andromda.samples.springanimalquiz.decisiontree.DecisionItemDao]
[01:44:53.999] at
org.springframework.transaction.interceptor.MethodMapTransactionAttri but
eSource.addTransactionalMethod(MethodMapTransactionAttributeSource.ja va:
107)
[01:44:53.999] at
org.springframework.transaction.interceptor.MethodMapTransactionAttri but
eSource.addTransactionalMethod(MethodMapTransactionAttributeSource.ja va:
78)
[01:44:53.999] at
org.springframework.transaction.interceptor.TransactionAttributeSourc eEd
itor.setAsText(TransactionAttributeSourceEditor.java:77)
[01:44:53.999] at
org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary (Be
anWrapperImpl.java:934)
[01:44:53.999] at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe rIm
pl.java:768)
[01:44:53.999] at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe rIm
pl.java:674)
I tried to set
<transactionManager>org.springframework.transaction.jta.JtaTransactio nMa
nager</transactionManager>
because I thought I could let Resin handle my transactions instead but
that gave me the following exception :
[01:39:53.389] ExceptionHandler caught this exception:
[01:39:53.389] org.springframework.beans.NotWritablePropertyException:
Invalid property 'sessionFactory' of bean class
[org.springframework.transaction.jta.JtaTransactionManager]: Bean
property 'sessionFactory' is not writable or has an invalid setter
method: Does the parameter type of the setter match the return type of
the getter?
[01:39:53.389] at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe rIm
pl.java:761)
[01:39:53.389] at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe rIm
pl.java:674)
[01:39:53.389] at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrappe rIm
pl.java:815)
[01:39:53.389] at
org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapp erI
mpl.java:842)
[01:39:53.389] at
org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapp erI
mpl.java:831)
[01:39:53.389] at
org.springframework.beans.factory.support.AbstractAutowireCapableBean Fac
tory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:831)
[01:39:53.389] at
org.springframework.beans.factory.support.AbstractAutowireCapableBean Fac
tory.populateBean(AbstractAutowireCapableBeanFactory.java:648)
[01:39:53.389] at
org.springframework.beans.factory.support.AbstractAutowireCapableBean Fac
tory.createBean(AbstractAutowireCapableBe
Jan
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Andromda-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-user
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Andromda-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/andromda-user
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Andromda-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/andromda-user
