• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.IllegalStateException: Exception Description: Cannot use an EntityTransaction while using

 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using my Stateful Bean as -



but i am getting this exception-





I don't know why i am getting this exception here becuase i am using the application managed persistence context and resource local transaction.

Generelly resource local transactions can be used in Java SE client, but i am using in a Stateful Bean, but i should be able to use it here without any problem here.

Please advise.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do we need @PersistenceUnit annotation at line 41?.

Also I guess the default entity transaction manager is JTA, so i think you need to specify that you need Resource_Local.

In your persistence.xml file you need to remove <jta-data-source> element & add
<non-jta-data-source>RESOURCE_LOCAL</non-jta-data-source> element.

Correct me if i am wrong.



 
reply
    Bookmark Topic Watch Topic
  • New Topic