<div dir="ltr">Hello,<div>I've been playing around with JPA in OpenCms(on default isntallation of OpenCms 8.5.1). I have problem with creation of EntityManager from EntityManagerFactory.</div><div style>I am trying to obtain EntityManager in stadard way from EntityManagerFactory with default OpenCms pool name OpenCmsJPAPool.</div>
<div><div> EntityManagerFactory emf = Persistence.createEntityManagerFactory("OpenCmsJPAPool");</div><div> EntityManager em = emf.createEntityManager();</div><div> em.close();</div><div> emf.close();</div><div><br>
</div><div style>This code gives me an error:</div><div style><span style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;background-color:rgb(240,240,240)">Cannot create JDBC driver of class '' for connect URL 'null'</span><br style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;background-color:rgb(240,240,240)">
<span style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;background-color:rgb(240,240,240)">Reason: Cannot create JDBC driver of class '' for connect URL 'null'</span><br>
</div><div style><span style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;background-color:rgb(240,240,240)"><br></span></div>This would sugest that there is something wrong with configuration in persistance.xml but I did not modify this file, so it should be ok. <br>
Has anybody experienced this issue? Or if anybody has a code snippet as example of working with JPA in Opencms I'd be very greatful. I'd love to use JPA in a module that I am developing.</div><div><br></div><div>
Thanks.</div><div><div><br>Jakub Jeèmínek<br>------------------------------------------------<br>NELASOFT Technologies, s.r.o.<br>Mob: +420 604 575 772<br>E-mail: <a href="mailto:jakub.jecminek@nelasoft.cz" target="_blank">jakub.jecminek@nelasoft.cz</a><br>
Web: <a href="http://www.nelasoft.cz" target="_blank">www.nelasoft.cz</a></div>
<div dir="ltr"><br></div></div></div>