• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

TransactionRequiredException with Spring 4, Eclipselink and JPA  RSS feed

 
Ranch Hand
Posts: 37
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have searched through all the existing questions before posting this. I am using Spring 4 MVC, Eclipselink and JPA

These are my classes
JPA Configuration class



DAO class




This is the exception which I get continuously TransactionRequiredException



I have searched almost everywhere but could not find solution for my problem

Kindly help me

Siddarth C.S
 
Author
Posts: 96
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using @EnableTransactionManagement with AspectJ "mode"? Could you try:

adviceMode=proxy, proxyTargetClass=true


Other than that, your code looks fine...?




 
Siddarth Cherukumudi
Ranch Hand
Posts: 37
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing specific. Even I tried without using the mode as well it does not seem to work, Hence tried with giving it
 
Marco Behler
Author
Posts: 96
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was asking, because in your stacktrace, there are no lines regarding a "TransactionProxy", i.e. your class does not get wrapped with a transaction. I wasn't sure if you had aspectj setup correctly and with that compile time weaving, but in any case, that's where i would have a look at.
 
Siddarth Cherukumudi
Ranch Hand
Posts: 37
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for your time, If you can help me look at the issue. I can share my project with you
please let me know if you are fine with that
 
Marco Behler
Author
Posts: 96
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you put the .zipped project somewhere? Or put it on GitHub or something similar? Thanks
 
Siddarth Cherukumudi
Ranch Hand
Posts: 37
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Here is my project My Project
 
Marco Behler
Author
Posts: 96
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Siddarth, I just tried your code.

the code sample you sent me had the same problem, the same exception. BUT, you were missing the @Transactional annotations on the BookRepository, which are however in the code you pasted in here.

So with @Transactional AND @EnableTransactionManagement (no special options), it works just fine for me.
 
Siddarth Cherukumudi
Ranch Hand
Posts: 37
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Marco,

Thanks a lot for your time. Unfortunately after doing what you have told me I am still landing into the same issue.

Can you please Post the project which you have modified in GitHub or somewhere, I will take it from there and run it?
 
Marco Behler
Author
Posts: 96
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will upload it tomorrow or the day after
 
Marco Behler
Author
Posts: 96
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Siddarth,

check out the following link. It is your project and it should work.

www.marcobehler.com/External.zip
 
Siddarth Cherukumudi
Ranch Hand
Posts: 37
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marco,

Thanks a ton for the code. After carefully observing found the difference between mine and your code. i.e. wrt WebAppInitializer class

My Code


Your Code



Now I am wondering why this is the case. Can you please shed some light on this please?

Regards,
Siddartha C.S
 
Siddarth Cherukumudi
Ranch Hand
Posts: 37
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marco,

Gentle remainder, awaiting reply for above post

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!