[jboss-jira] [JBoss JIRA] Commented: (JBAS-9339) Provide jta-data-source if not specified

Scott Marlow (JIRA) jira-events at lists.jboss.org
Mon Apr 18 11:06:33 EDT 2011


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

Scott Marlow commented on JBAS-9339:
------------------------------------

It looks like Hibernate has support for javax.persistence.jtaDataSource via AvailableSettings.JTA_DATASOURCE and Ejb3Configuration.configure()

> Provide jta-data-source if not specified
> ----------------------------------------
>
>                 Key: JBAS-9339
>                 URL: https://issues.jboss.org/browse/JBAS-9339
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JPA / Hibernate
>            Reporter: Shelly McGowan
>            Assignee: Scott Marlow
>             Fix For: 7.0.0.CR1
>
>
> Persistence 2.0 Spec, Chapter 8.2.1.5
> In Java EE environments, the jta-data-source and non-jta-data-source elements are used to specify the global JNDI name of the JTA and/or non-JTA data source to be used by the persistence provider.
> and need to provide one if it is not specified:
> If neither is specified, the deployer must specify a JTA data source at deployment or a JTA data source must be provided by the container, and a JTA EntityManagerFactory will be created to correspond to it.
> Without the jta-data-source element in the persistence.xml, the deployment fails to start:
> 08:53:57,004 WARN  [org.hibernate.connection.UserSuppliedConnectionProvider] (MSC service thread 1-6) No connection properties specified - the user must supply JDBC connections
> 08:53:57,011 INFO  [org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider] (MSC service thread 1-5) Using provided datasource
> 08:53:57,017 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.persistenceunit."my_web.war#MY-EM": org.jboss.msc.service.StartException in service jboss.persistenceunit."my_web.war#MY-EM": Failed to start service
>         at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1363)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]
>         at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
> Caused by: javax.persistence.PersistenceException: [PersistenceUnit: MY-EM] Unable to build EntityManagerFactory
>         at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:911)
>         at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
>         at org.jboss.as.jpa.service.PersistenceUnitService.createContainerEntityManagerFactory(PersistenceUnitService.java:169)
>         at org.jboss.as.jpa.service.PersistenceUnitService.start(PersistenceUnitService.java:78)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list