[jboss-jira] [JBoss JIRA] (WFLY-4096) Datasource Defined in web.xml Does Not Work with JPA Entity Manager

Scott Marlow (JIRA) issues at jboss.org
Wed Nov 19 08:41:39 EST 2014


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

Scott Marlow commented on WFLY-4096:
------------------------------------

[https://community.jboss.org/en/wildfly?view=discussions] is the best place to ask questions like this.  The question to ask would of been something like, "how can I get a Datasource defined in web.xml to work with JPA Entity Manager?"
Have you tried adding a hibernate.temp.use_jdbc_metadata_defaults?  Probably not, I just found out about this property a few weeks ago myself.  There are other ways that we can talk about but try that first.  If that doesn't help, we can probably discuss the other ways in the above user forums, so let me know either way.

{quote}
<persistence-unit name="wtpu" transaction-type="JTA">
<jta-data-source>java:/datasources/test</jta-data-source>
<properties>
  <property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
</properties>
</persistence-unit>
{quote}



> Datasource Defined in web.xml Does Not Work with JPA Entity Manager
> -------------------------------------------------------------------
>
>                 Key: WFLY-4096
>                 URL: https://issues.jboss.org/browse/WFLY-4096
>             Project: WildFly
>          Issue Type: Bug
>          Components: JPA / Hibernate, Web (JBoss Web)
>    Affects Versions: 8.1.0.Final
>         Environment: Windows 7
> Java 8u25
> WildFly 8.1.0.Final
>            Reporter: shinzey shinzey
>            Assignee: Scott Marlow
>            Priority: Critical
>              Labels: datasource, deployment, jpa, persistence.xml, persistenceUnit
>
> The datasource defined in web.xml:
> {quote}
> <data-source>
>     <name>java:/datasources/test</name>
>     <class-name>org.apache.derby.jdbc.ClientDataSource</class-name>
>     <database-name>test</database-name>
>     <url>jdbc:derby://localhost:1527/test</url>
>     <user>test</user>
>     <password>test</password>
> </data-source>
> {quote}
> The persistence unit:
> {quote}
> <persistence-unit name="wtpu" transaction-type="JTA">
>     <jta-data-source>java:/datasources/test</jta-data-source>
> </persistence-unit>
> {quote}
> The deployment error:
> {quote}
> 17:57:10,813 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "WebTest.war" (runtime-name: "WebTest.war")
> 17:57:11,078 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011401: Read persistence.xml for wtpu
> 17:57:11,172 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "WebTest.war")]) - failure description: ("JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"WebTest.war#wtpu\".__FIRST_PHASE__ is missing [jboss.naming.context.java.datasources.test]"])
> 17:57:11,187 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "WebTest.war" (runtime-name : "WebTest.war")
> 17:57:11,187 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
> JBAS014775:    New missing/unsatisfied dependencies:
>       service jboss.naming.context.java.datasources.test (missing) dependents: [service jboss.persistenceunit."WebTest.war#wtpu".__FIRST_PHASE__]
> {quote}
> If I remove the persistence unit, the datasource can be successfully bound:
> {quote}
> 17:55:47,851 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/datasources/test]
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.8#6338)


More information about the jboss-jira mailing list