tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kasmeroglu <daniel.kasmero...@kasisoft.net>
Subject Re: resources.xml in a WAR ?
Date Thu, 02 Oct 2014 13:37:02 GMT
Am 02.10.2014 um 15:03 schrieb Romain Manni-Bucau:
> I think it can be considered as a bug since persistence unit
> datasource matching needs JtaManaged attribute. I guess you can
> provide it even if it will be ignored. I'll open a jira for it
> 
To be honest I think we've got a misunderstanding here. I didn't asked
because of the 'JtaManaged' attribute. I think there's an ordering issue
here:

a) Running my code in a test environment (same settings):

     1.) My custom data source factory is called in order to create my
DataSource
     2.) The 'AutoConfig' deployment takes place and initializes the
persistence.
     => Everything's fine here.

b) Running my code as a dynamic webapp (war):

     1.) The 'AutoConfig' deployment takes place and initializes the
persistence.
     => My custom data source factory is not called ahead and therefore
the initialization fails.

If no one has any idea about this problem I will try to reduce my
project in order to provide a reproducable example.


Best regards

Daniel Kasmeroglu


> 
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
> 
> 
> 2014-10-02 14:12 GMT+02:00 Daniel Kasmeroglu <daniel.kasmeroglu@kasisoft.net>:
>> Hi there,
>>
>> I've got the following problem: When running my application as a WAR it
>> fails to create the datasources (I'm using a CustomDataSourceFactory as
>> you can see within the attached 'resources.xml').
>>
>> At least they're not created ahead of the deployment of the web module
>> which causes a failure within the lookup in 'PersistenceBuilder'.
>>
>> I definitely know that my custom data source is working as I've tested
>> the server with the auto resource creation option turned on. In that
>> case I'm perfectly capable to inject my data sources although my JPA
>> persistence then gets adjusted to HSQLDB related datasources instead of
>> the configured ones (which is basically the reason for my investigation).
>>
>> Furthermore my custom data sources are properly working in a test setup
>> which is an EJB container loading a corresponding 'tomee.xml'. In that
>> case the persistence layer is getting properly configured.
>>
>> My suspicion is that the web module deployment starts without having the
>> resources ready but the OpenEJB code isn't that easy to read.
>>
>> So does anyone have an advice for this situation or any kind of hint in
>> order to help me ?
>>
>> P.S:
>>
>> * Tomee Plume 1.7.0
>> * Java 7
>> * Obviously I've checked ahead whether the declarative artifacts like
>> beans.xml, persistence.xml, resources.xml etc. are at the right locations.
>>
>>
>> Best regards
>>
>> Daniel Kasmeroglu
>>


Mime
View raw message