Yep, like I said, that part is easy and I believe I can get that
resolved. My question is how to tell Tapestry that @Inject Session is
done by foo+tapestry-cdi and it should use @Inject @Named Session
instead?

On Fri, Sep 23, 2016 at 10:13 AM, Qbyte Consulting
<qbyteconsult...@gmail.com> wrote:
> What about exclude tapestries default hibernate dependency with Maven exclude?
>
> Sent from my iPhone
>
>> On 23 Sep 2016, at 09:05, Adam X <vbgnm3c...@gmail.com> wrote:
>>
>> Hi,
>>
>> I have what seems like a major collision problem and don't know how to
>> solve this. My current architecture is as following:
>>
>> foo
>> weld
>> tapestry-cdi
>> tapestry-core
>>
>> I'd like to have:
>>
>> foo
>> weld
>> tapestry-cdi
>> tapestry-hibernate
>>
>> foo (jar) is a major depenency of my project. It is an internal
>> company framework which contains all the business logic, services,
>> daos, etc etc. It it's only dependency is JSR-330 (cdi) as all
>> services are CDI managed beans. It allows me to easily operate on AWS
>> cloud (we're using DynamoDB, SNS, S3, IAM) as well as internal
>> relational db (backed by hibernate). After integrating tapestry-cdi
>> things work beautifully, as in my page classes I can do things like:
>>
>> @Inject
>> private TxDynamoDao dao;
>>
>> or even
>>
>> @Inject
>> private Session session;
>>
>> without tapestry-hibernate at all. In otherwords, my foo dependency
>> bootstraps hibernate and makes session available to my tapestry app.
>>
>> But now, I want to introduce a separate relational db specific to my
>> project. Since I thought a lot about on my way to work in recent days,
>> I expected some sort of collision. Sure enough, merely changing
>> tapestry-core to tapestry-hibernate in my pom.xml, broke my app as my
>> foo dependency could no longer bootstrap ITS hibernate. But I think in
>> the grand schema of things it's a problem I could manage to get fixed
>> as in the stack trace I noticed things like class not found, so
>> tapestry-hibernate probably brought in some unwanted dependencies (our
>> foo uses hibernate 5.0.7 and tapestry-hibernate wants to bring 4.x).
>>
>> But let's assume that we could get past this initial problem. How do I
>> proceed then? How do I tell Tapestry that:
>>
>> @Inject
>> private Session session;
>>
>> is a no-no, because it belongs to foo, and rather I'd like to do something 
>> like:
>>
>> @Inject @Named("tapestry-hibernate-session")
>> private Session session;
>>
>> Adam
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to