Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access PersistenceUnit from servlet?

 
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic