<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic problem accessing to JPA in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/problem-accessing-to-JPA/m-p/2299737#M72049</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;I am trying to access JPA from Talend ESB job.&lt;BR /&gt;I have a jar containing my entity classes and my dao/service beans. The jar works with JUnit/JavaSE and with Spring/Apache CXF/Tomcat/JavaEE as web services.&lt;BR /&gt;I started a User Routine and added my jar to it along with some Spring and Hibernate jars.&lt;BR /&gt;My jar has META-INF/persistence.xml file with the persistence unit named "oso" and I am able to reach to it within my routine through the following:&lt;/P&gt; 
&lt;PRE&gt;new Object().getClass().getClassLoader().getSystemResourceAsStream("META-INF/persistence.xml");&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;I am also able to reach to all of my classes.&lt;BR /&gt;But the following cannot get the entity manager factory:&lt;/P&gt; 
&lt;PRE&gt;EntityManagerFactory emf=Persistence.createEntityManagerFactory("oso");&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;I get: &lt;BR /&gt;&lt;FONT color="#FF0000"&gt;javax.persistence.PersistenceException: No Persistence provider for EntityManager named oso&lt;/FONT&gt;&lt;BR /&gt;What could that be?&lt;BR /&gt;I suspect, that could be related to an alternative class loader if Talend is using one. Because I also have had a number of other issues with Spring context initialization and those issues do not happen either in standalone or in web application environments. After all this is a POC project and those beans and the Spring configuration are all very lean and basic. I can see when I add a jar to a Talend routine it is copied into Talend lib folder and afterwards, I cannot tell how a class is resolved in run time if there are jars from different versions of (for example) Hibernate/JPA in the lib folder.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 12:36:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T12:36:33Z</dc:date>
    <item>
      <title>problem accessing to JPA</title>
      <link>https://community.qlik.com/t5/Talend-Studio/problem-accessing-to-JPA/m-p/2299737#M72049</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I am trying to access JPA from Talend ESB job.&lt;BR /&gt;I have a jar containing my entity classes and my dao/service beans. The jar works with JUnit/JavaSE and with Spring/Apache CXF/Tomcat/JavaEE as web services.&lt;BR /&gt;I started a User Routine and added my jar to it along with some Spring and Hibernate jars.&lt;BR /&gt;My jar has META-INF/persistence.xml file with the persistence unit named "oso" and I am able to reach to it within my routine through the following:&lt;/P&gt; 
&lt;PRE&gt;new Object().getClass().getClassLoader().getSystemResourceAsStream("META-INF/persistence.xml");&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;I am also able to reach to all of my classes.&lt;BR /&gt;But the following cannot get the entity manager factory:&lt;/P&gt; 
&lt;PRE&gt;EntityManagerFactory emf=Persistence.createEntityManagerFactory("oso");&lt;/PRE&gt; 
&lt;P&gt;&lt;BR /&gt;I get: &lt;BR /&gt;&lt;FONT color="#FF0000"&gt;javax.persistence.PersistenceException: No Persistence provider for EntityManager named oso&lt;/FONT&gt;&lt;BR /&gt;What could that be?&lt;BR /&gt;I suspect, that could be related to an alternative class loader if Talend is using one. Because I also have had a number of other issues with Spring context initialization and those issues do not happen either in standalone or in web application environments. After all this is a POC project and those beans and the Spring configuration are all very lean and basic. I can see when I add a jar to a Talend routine it is copied into Talend lib folder and afterwards, I cannot tell how a class is resolved in run time if there are jars from different versions of (for example) Hibernate/JPA in the lib folder.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 12:36:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/problem-accessing-to-JPA/m-p/2299737#M72049</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:36:33Z</dc:date>
    </item>
  </channel>
</rss>

