I finally figured out what's been the problem concerning my tests not
working. I seperated my project in even more modules (model,dao,service,web)
than just web and core. The applicationContext.xml in the dao module was
renamed to applicationContext-dao.xml

On Thu, Jul 17, 2008 at 1:18 AM, Michael Duergner <
[EMAIL PROTECTED]> wrote:

> I just wrote tests based upon that tutorial yes. I could get the tests
> working by adding the following entries to applicationContext-resources.xml
> in src/test/resources/
>
> <bean id="entityManagerFactory"
>
>           class="org.springframework.orm.jpa
> .LocalContainerEntityManagerFactoryBean">
>
>         <property name="dataSource" ref="dataSource" />
>
>         <property name="jpaVendorAdapter">
>
>             <bean class="org.springframework.orm.jpa
> .vendor.HibernateJpaVendorAdapter">
>
>                 <property name="showSql" value="true"/>
>
>                 <property name="generateDdl" value="true"/>
>
>                 <property name="databasePlatform" value="org.hibernate
> .dialect.MySQL5InnoDBDialect"/>
>
>             </bean>
>
>         </property>
>
>     </bean>
>
>
>     <tx:annotation-driven transaction-manager="transactionManager" />
>
>
>     <bean 
> class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
> />
>
>
>     <bean class="org.springframework.dao
> .annotation.PersistenceExceptionTranslationPostProcessor"/>
>
>
>     <bean id="transactionManager" class="org.springframework.orm.jpa
> .JpaTransactionManager">
>
>         <property name="entityManagerFactory" ref="entityManagerFactory"/>
>
>         <property name="dataSource" ref="dataSource"/>
>
>     </bean>
>
> That should define the transaction manager as far as I understood. Having
> had a look again at the sunfire report shows without that snippet:
>
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name 'com.duergner.wowcp.dao.base.item.ArmorItemDaoTest':
> Unsatisfied dependency expressed through bean property
> 'entityManagerFactory': Set this property value or disable dependency
> checking for this bean.
>
> Seems as if it is not finding a transaction manager without it.
>
>
> On Thu, Jul 17, 2008 at 1:04 AM, Matt Raible <[EMAIL PROTECTED]>
> wrote:
>
>> Can you post your test? Have you gone through the JPA tutorial on the
>> wiki?
>>
>> http://appfuse.org/display/APF/Using+JPA
>>
>> Matt
>>
>> On Wed, Jul 16, 2008 at 4:50 PM, Michael Duergner
>> <[EMAIL PROTECTED]> wrote:
>> > Both. It's neither updating an existing object nor inserting a new one.
>> >
>> > On Thu, Jul 17, 2008 at 12:46 AM, Matt Raible <[EMAIL PROTECTED]>
>> > wrote:
>> >>
>> >> When do you not see the object being persisted? In a test or when
>> >> you're running the app in Tomcat/Jetty?
>> >>
>> >> Matt
>> >>
>> >> On Wed, Jul 16, 2008 at 4:44 PM, Michael Duergner
>> >> <[EMAIL PROTECTED]> wrote:
>> >> > Any Idea how I can check if it's a transaction related problem?
>> >> >
>> >> > On Thu, Jul 17, 2008 at 12:43 AM, Matt Raible <
>> [EMAIL PROTECTED]>
>> >> > wrote:
>> >> >>
>> >> >> AppFuse should take care of the JPA configuration for you.
>> >> >>
>> >> >> Matt
>> >> >>
>> >> >> On Wed, Jul 16, 2008 at 3:20 PM, Michael Duergner
>> >> >> <[EMAIL PROTECTED]> wrote:
>> >> >> > I set the stuff up like described in the JPA tutorial and the
>> >> >> > examples
>> >> >> > on
>> >> >> > springframework.org. Does appfuse take care of that stuff or do I
>> >> >> > have
>> >> >> > to
>> >> >> > add that on my own?
>> >> >> >
>> >> >> > On Wed, Jul 16, 2008 at 11:09 PM, Matt Raible
>> >> >> > <[EMAIL PROTECTED]>
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> Are you sure your save is wrapped in a transaction?
>> >> >> >>
>> >> >> >> Matt
>> >> >> >>
>> >> >> >> On Wed, Jul 16, 2008 at 6:56 AM, Michael Duergner
>> >> >> >> <[EMAIL PROTECTED]> wrote:
>> >> >> >> > Hi all,
>> >> >> >> > i've got a Appfuse Spring MVC modular project using JPA for
>> >> >> >> > persistence
>> >> >> >> > layer. Getting objects form the database works as intended but
>> I'm
>> >> >> >> > not
>> >> >> >> > able
>> >> >> >> > to save a object. I've implemented a own DAO extending
>> >> >> >> > GenericDaoJpa
>> >> >> >> > with
>> >> >> >> > just calls super.save() for saving an object. But the object
>> will
>> >> >> >> > not
>> >> >> >> > be
>> >> >> >> > persisted in the database. Looking at the SQL log i cannot see
>> an
>> >> >> >> > INSERT
>> >> >> >> > or
>> >> >> >> > UPDATE statement.
>> >> >> >> > The application is build upon the current archtype using JPA
>> for
>> >> >> >> > persistence
>> >> >> >> > and MySQL als database backend.
>> >> >> >> > Can anyone give me a hint where to look or do you need further
>> >> >> >> > information?
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > Mit freundlichen Grüßen / With kind regards
>> >> >> >> >
>> >> >> >> > Michael Dürgner
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > --
>> >> >> > Mit freundlichen Grüßen / With kind regards
>> >> >> >
>> >> >> > Michael Dürgner
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > --
>> >> > Mit freundlichen Grüßen / With kind regards
>> >> >
>> >> > Michael Dürgner
>> >
>> >
>> >
>> > --
>> > --
>> > Mit freundlichen Grüßen / With kind regards
>> >
>> > Michael Dürgner
>>
>
>
>
> --
> --
> Mit freundlichen Grüßen / With kind regards
>
> Michael Dürgner
>



-- 
-- 
Mit freundlichen Grüßen / With kind regards

Michael Dürgner

Reply via email to