Skip to main content

Provide EntityManagerFactory via JNDI lookup to webapp

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2011-08-02


i want to get the EntityManagerFactory for a persistence unit in a webapp using JNDI. What do i need to do to get the thing working?


<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="" xmlns:xsi=""
<persistence-unit name="web">

web.xml ?


JNDI name ?
using java:comp/env/persistence/web i get a NamingException stating that the name is not found, and when i use list-jndi-entries with asadmin i can not list the persistence context.

Thanks for any hint