• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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.



 
On my planet I'm considered quite beautiful. Thanks to the poetry in this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic