-
1. Re: Is there a Seam 3 equivalent to Seam 2's @Install?
lightguard Aug 24, 2011 3:49 PM (in response to benkirby)I have to say, I'm a little confused about what you want to do. Seam3 has no notion of installation precedence. If you're looking to override a bean that's been installed there are a couple of ways to do this.
- You could write an extension to
veto()
the bean you don't want installed - Use the
@Specializes
or@Alternative
annotation http://docs.jboss.org/weld/reference/latest/en-US/html/specialization.html - Add a qualifier to your new subclass and make sure to qualify the injection
- You could write an extension to
-
2. Re: Is there a Seam 3 equivalent to Seam 2's @Install?
benkirby Sep 1, 2011 8:14 AM (in response to benkirby)Ahhh, of course - good ideas! Thanks!
The issue is that JBoss AS 7.0.1.Final now makes UserTransaction available on the global jndiname
java:jboss/UserTransaction
. The Seam3 class DefaultSeamTransaction obviously only tries to look up UserTransaction from where it knew it could be, previously:java:comp/UserTransaction
andUserTransaction
. So, on non-EE threads, it never finds the UserTransaction.So I need to replace the class DefaultSeamTransaction with a version of my own, which additionally attempts to lookup UserTransaction from the new, AS7 location, where it will be available. Chris did this in Seam2 with @Install.
So if I create the specialized/alternate class in one of my JARs (packaged in an EAR), enable the alternate in the beans.xml, and otherwise follow the instructions, it should be able to replace DefaultSeamTransaction? The seam-persistence jar which is currently bundled in the same EAR.
I'll give it a go anyway, thanks for the suggestion!
-
3. Re: Is there a Seam 3 equivalent to Seam 2's @Install?
yangju.richard.yang.pearson.com Oct 28, 2011 3:28 PM (in response to benkirby)Have you figured out the with Specilizes and Alternatives?
I was trying the same approach as it seems that Seam 3.1.0.Beta4(latest I can find for seam-transaction) still has not fixed this.
However, I run into the same issue of
https://issues.jboss.org/browse/WELD-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
(The fix is said to be in weld 1.2 but it is not there yet)
So I cannot replace the DefaultSeamTransaction with my own code.
Any suggest how to get around with this issue? -
4. Re: Is there a Seam 3 equivalent to Seam 2's @Install?
lightguard Oct 28, 2011 7:32 PM (in response to benkirby)https://issues.jboss.org/browse/SEAMTRANSACTION-6 to track this issue