[jboss-jira] [JBoss JIRA] (WFLY-2841) Datasource mapped in jboss-web.xml not available to persistence unit

Scott Marlow (JIRA) issues at jboss.org
Thu Jan 30 13:39:28 EST 2014


    [ https://issues.jboss.org/browse/WFLY-2841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12940291#comment-12940291 ] 

Scott Marlow commented on WFLY-2841:
------------------------------------

It sounds like an internal ordering problem during deployment of your app.  

What happens if you set wildfly.jpa.twophasebootstrap to false in the persistence.xml?  The persistence unit should deploy later as a result.

{quote}
<property name="wildfly.jpa.twophasebootstrap" value="false"/>
{quote}

Should look like:

{quote}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_1.xsd">

    <persistence-unit name="wfdsPU" transaction-type="JTA">
        <jta-data-source>java:comp/env/MyDS</jta-data-source>
    <properties>
                <property name="wildfly.jpa.twophasebootstrap" value="false"/>
                <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
                <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
        </properties>
  </persistence-unit>
</persistence>
{quote}
                
> Datasource mapped in jboss-web.xml not available to persistence unit
> --------------------------------------------------------------------
>
>                 Key: WFLY-2841
>                 URL: https://issues.jboss.org/browse/WFLY-2841
>             Project: WildFly
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 8.0.0.CR1
>            Reporter: Martin Andersson
>
> I have mapped the datasource java:jboss/datasources/ExampleDS to jdbc/MyDS in jboss-web.xml for my application.
> In a stateless bean i can do a jndi lookup and find the datasource in both java:comp/env/jdbc/MyDS and java:module/env/jdbc/MyDS as expected. But if I try to use it in my persistence.xml I get an error:
> 13:18:28,129 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"wfds-1.0-SNAPSHOT.war#wfdsPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.module.\"wfds-1.0-SNAPSHOT\".\"wfds-1.0-SNAPSHOT\".env.MyDS]"]}
> A minimal example application that demonstrates the problem is available at: https://github.com/umartin/wfds/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list