I've a project which followed the hibernate example here: 
I'm now trying to do the same but with eclipselink as supplied with 
Resin 4.0.14 pro. I extended that hibernate example to perform commits 
using UserTransaction and EntityManager instances but when I used the 
same code with eclipselink I get

"[EL Severe]: 2011-02-02 
Can't allocate connection because the connection pool is closed."

I'm sure this is a newbie db config problem. The servlet code is

EntityManagerFactory emf;

private UserTransaction ut;

private EntityManager em;

public void service(HttpServletRequest req, HttpServletResponse res)
     throws IOException, ServletException {

     PrintWriter out = res.getWriter();

     Contact contact;
     try {
         em = emf.createEntityManager();


and the exception occurs at that last line. I defined my db in 

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://caucho.com/ns/resin";>
<system-property service.version.id='LnJPA 1.00'/>

<driver type="org.gjt.mm.mysql.Driver">

And thought the <jta-data-source> entry in persistence.xml was all I 
needed to wire it up:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"; version="1.0">
<persistence-unit name="contact">





Is there something else I should be doing please?

-- Carl Whalley http://www.androidacademy.com

resin-interest mailing list

Reply via email to