Note that there are some explanatory texts on larger screens.

plurals
  1. POhow inject a EntityManager between ear
    text
    copied!<p>I'm using JBoss 4.2.3 and I deployed two ears called <code>triad-1.0.ear</code> and <code>reportservices-1.0.ear</code>, the thing is that I want to use the entity manager of the project triad in the project reportservices. This is the architecture JBoss follows:</p> <pre><code>triad-1.0.ear: triad-core-1.0.jar: META-INF: MANIFEST.MF components.xml ejb-jar.xml jboss.xml persistence.xml reportservices-1.0.ear: reportservices-core-1.0.jar: META-INF: MANIFEST.MF components.xml ejb-jar.xml jboss.xml persistence.xml </code></pre> <p>this is my attempt to make the entitymanager global between ear in the persistence.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!-- Attention: Generated code! Do not modify by hand! Generated by: persistence.xml.vsl in andromda-ejb3-cartridge. --&gt; &lt;persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"&gt; &lt;persistence-unit name="triad"&gt; &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt; &lt;jta-data-source&gt;java:/jdbc/triad&lt;/jta-data-source&gt; &lt;properties&gt; &lt;property name="hibernate.hbm2ddl.auto" value="update"/&gt; &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/&gt; &lt;property name="jboss.entity.manager.jndi.name" value="java:/triadFactory"/&gt; &lt;property name="jboss.entity.manager.factory.jndi.name" value="java:/triadFactory"/&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload