<div dir="ltr">Thanks a lot! <div><br></div><div>I can confirm that the app works now.</div><div><br></div><div>Br,</div><div>Martin Andersson</div><div>Java EE developer at <a href="http://www.purplescout.se">www.purplescout.se</a></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 1:55 PM, Scott Marlow <span dir="ltr">&lt;<a href="mailto:smarlow@redhat.com" target="_blank">smarlow@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Arjan,<br>
<br>
Great catch!  Your change and adding an persistence unit hint that the<br>
persistence unit doesn&#39;t need to be started early:<br>
<br>
   &lt;property name=&quot;wildfly.jpa.twophasebootstrap&quot; value=&quot;false&quot;/&gt;<br>
<br>
Helps the deployment succeed.<br>
<br>
It looks like ResourceReferenceProcessor is running during the<br>
Phase.POST_MODULE deployment phase, so we need to add a hint to the<br>
persistence.xml, that helps the persistence unit deploy later.<br>
<br>
[6]<br>
<a href="https://github.com/wildfly/wildfly/blob/master/ee/src/main/java/org/jboss/as/ee/subsystem/EeSubsystemAdd.java#L194" target="_blank">https://github.com/wildfly/wildfly/blob/master/ee/src/main/java/org/jboss/as/ee/subsystem/EeSubsystemAdd.java#L194</a><br>

<br>
Scott<br>
<div class="im"><br>
On 01/31/2014 06:25 AM, arjan tijms wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I looks like there&#39;s one bug in the example.<br>
&gt;<br>
&gt; jboss-web.xml defines jdbc/MyDS<br>
&gt;<br>
&gt; But persistence.xml references java:comp/env/MyDS<br>
&gt;<br>
&gt; Shouldn&#39;t the last one be at least java:comp/env/jdbc/MyDS? Regardless,<br>
&gt; even with matching names it indeed doesn&#39;t work.<br>
&gt;<br>
&gt; Kind regards,<br>
&gt; Arjan Tijms<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Jan 30, 2014 at 9:52 PM, Scott Marlow &lt;<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a><br>
</div><div><div class="h5">&gt; &lt;mailto:<a href="mailto:smarlow@redhat.com">smarlow@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     WFLY-2841 reports a deployment failure that occurs when a deployments<br>
&gt;     [1] persistence.xml, tries to use a resource reference [2] for the<br>
&gt;     datasource [3].  The error [4] mentions an unresolved (DataSource)<br>
&gt;     service dependency that is added to the persistence unit service [5],<br>
&gt;     instead of resolving the resource reference (and using the underlying<br>
&gt;     DataSource).<br>
&gt;<br>
&gt;     How should we handle resource references for this case?  Is there a way<br>
&gt;     to resolve the resource reference directly from deployers?  Or do we<br>
&gt;     represent the resource reference as a service?<br>
&gt;<br>
&gt;     Scott<br>
&gt;<br>
&gt;     [1] test app is at <a href="https://github.com/umartin/wfds/" target="_blank">https://github.com/umartin/wfds/</a><br>
&gt;<br>
&gt;     [2] jboss-web.xml<br>
&gt;     &lt;jboss-web&gt;<br>
&gt;               &lt;context-root&gt;/wfds&lt;/context-root&gt;<br>
&gt;               &lt;resource-ref&gt;<br>
&gt;                       &lt;res-ref-name&gt;jdbc/MyDS&lt;/res-ref-name&gt;<br>
&gt;                       &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;<br>
&gt;<br>
&gt;       &lt;jndi-name&gt;java:jboss/datasources/ExampleDS&lt;/jndi-name&gt;<br>
&gt;               &lt;/resource-ref&gt;<br>
&gt;     &lt;/jboss-web&gt;<br>
&gt;<br>
&gt;     [3] persistence.xml pu def<br>
&gt;     &lt;persistence-unit name=&quot;wfdsPU&quot; transaction-type=&quot;JTA&quot;&gt;<br>
&gt;               &lt;jta-data-source&gt;java:comp/env/MyDS&lt;/jta-data-source&gt;<br>
&gt;     &lt;/persistence-unit&gt;<br>
&gt;<br>
&gt;     [4] {&quot;JBAS014771: Services with missing/unavailable dependencies&quot; =&gt;<br>
&gt;     [&quot;jboss.persistenceunit.\&quot;wfds-1.0-SNAPSHOT.war#wfdsPU\&quot;.__FIRST_PHASE__<br>
&gt;     is missing<br>
&gt;     [jboss.naming.context.java.module.\&quot;wfds-1.0-SNAPSHOT\&quot;.\&quot;wfds-1.0-SNAPSHOT\&quot;.env.MyDS]&quot;]}<br>
&gt;<br>
&gt;<br>
&gt;     [5]<br>
&gt;     <a href="https://github.com/wildfly/wildfly/blob/master/jpa/core/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java#L358" target="_blank">https://github.com/wildfly/wildfly/blob/master/jpa/core/src/main/java/org/jboss/as/jpa/processor/PersistenceUnitServiceHandler.java#L358</a><br>

&gt;     _______________________________________________<br>
&gt;     wildfly-dev mailing list<br>
</div></div>&gt;     <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a>&gt;<br>
&gt;     <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
wildfly-dev mailing list<br>
<a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/wildfly-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Hälsningar,<div>Martin Andersson</div><div>Purple Scout AB</div><div>+46 732 05 14 01</div></div>
</div>