Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to access PersistenceUnit from servlet?  RSS feed

 
Alejandro Dominguez
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to all,
I have been trying to access a persistence unit from a servlet in JBoss 4.2.2, but I always get a "not bound" exception.

My directories are as follows:
.ear
-META-INF
--MANIFEST.MF
--application.xml
-.jar (persitence.xml)
-.war (web.xml, jboss-app.xml)

In my web.xml I have:


and in my servlet (inside the .war file) I have:


However, by looking at JMX Console I don't see the persistence/context being created, and when I try to lookup the manager, I get "persistence not bound".

Am I missing something here?

Regards
 
Alejandro Dominguez
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, I upgraded to JBoss 5 (RC1) and it works perfectly

Nice to see a popular request being taken care of!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!