tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Kemnade (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (TAP5-1910) JPA and JBoss 7 datasources
Date Mon, 22 Aug 2016 06:48:23 GMT

     [ https://issues.apache.org/jira/browse/TAP5-1910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jochen Kemnade closed TAP5-1910.
--------------------------------
    Resolution: Incomplete

We assume this is no longer relevant and therefore close it.
If you still have this issue in a recent Tapestry version (such as 5.4.1 or newer), feel free
to provide the necessary information and reopen.

> JPA and JBoss 7 datasources
> ---------------------------
>
>                 Key: TAP5-1910
>                 URL: https://issues.apache.org/jira/browse/TAP5-1910
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-jpa
>    Affects Versions: 5.3.2
>            Reporter: Miguel Figueiredo
>              Labels: bulk-close-candidate
>
> Hello,
> I am using tapestry 5.3.2 with JBoss 7, and I'm having some problems
> when using a JBoss datasource with JPA.
> My datasource configuration:
>                <datasource jta="false"
> jndi-name="java:jboss/myDatasource" pool-name="mysqlDS" enabled="true"
> use-java-context="true" use-ccm="true">
>                    (...)
>                </datasource>
> My persistence.xml configuration:
>    <persistence-unit name="my-pu"
>        transaction-type="RESOURCE_LOCAL">
>        <provider>org.hibernate.ejb.HibernatePersistence</provider>
>        <non-jta-data-source>java:jboss/myDatasource</non-jta-data-source>
>        (...)
>    </persistence-unit>
> Looking at the code in the PersistenceUnitInfoImpl of tapestry-jpa
> 5.3.2 I found the following:
>    private DataSource lookupDataSource(final String name)
>    {
>        try
>        {
>            // TODO: Create InitialContext with environment properties?
>            final Context initContext = new InitialContext();
>            final Context envContext = (Context) initContext.lookup("java:comp/env");
>            return (DataSource) envContext.lookup(name);
>        } catch (final NamingException e)
>        {
>            throw new RuntimeException(e);
>        }
>    }
> In JBoss 7 the env context should be retrieved from java:jboss, e.g.:
>            final Context initContext = new InitialContext();
>            final Context envContext = (Context)initContext.lookup("java:jboss");
>            return (DataSource) envContext.lookup("myDatasource");
> Maybe a datasource lookup class could be configured here.
> Best regards,
> Miguel



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message