You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openwebbeans.apache.org by Thomas Andraschko <to...@yahoo.de> on 2011/07/12 22:59:26 UTC

Re: OWB with Seam?

@Mark
No problem! Thanks for your fix, it works!
AFAICS the basic seam faces and persistence stuff now works with small fixed on OWB , but it's late now :)
Maybe there are also some changes made on Seam but i will check it tomorrow!

--- Mark Struberg <st...@yahoo.de> schrieb am Mi, 29.6.2011:

Von: Mark Struberg <st...@yahoo.de>
Betreff: Re: OWB with Seam?
An: user@openwebbeans.apache.org
Datum: Mittwoch, 29. Juni, 2011 15:02 Uhr

Thanks Thomas!

While digging through our codebase, I found that this might be because of an overly strict requirement of the current spec:

Section 6.6.4 declares that:

> If a producer method declares a passivating scope and:
> ..
> * has a parameter that does not resolve to a passivation capable
> dependency,
> then the container automatically detects the problem and
> treats it as a deployment problem.

Actually I have no idea _why_ the spec states this, but I'll discuss it in the EG.

@Eric, others: wdyt after reading 6.6.4?

LieGrue,
strub


--- On Wed, 6/29/11, Thomas Andraschko <to...@yahoo.de> wrote:

From: Thomas Andraschko <to...@yahoo.de>
Subject: Re: OWB with Seam?
To: user@openwebbeans.apache.org
Date: Wednesday, June 29, 2011, 8:56 AM

All right! issue created :)
https://issues.apache.org/jira/browse/OWB-590

--- Mark Struberg <st...@yahoo.de> schrieb am Mi, 29.6.2011:

Von: Mark Struberg <st...@yahoo.de>
Betreff: Re: OWB with Seam?
An: user@openwebbeans.apache.org
Datum: Mittwoch, 29. Juni, 2011 09:53 Uhr

Yes, please Thomas create a Jira issue:
https://issues.apache.org/jira/browse/OWB

It's important for us to check that as Seam should just work on OWB too. And if it turns out it's an issue in Seam then we still can go on and ping Pete.

txs and LieGrue,
strub

--- On Wed, 6/29/11, Thomas Andraschko <to...@yahoo.de> wrote:

From: Thomas Andraschko <to...@yahoo.de>
Subject: Re: OWB with Seam?
To: user@openwebbeans.apache.org
Date: Wednesday, June 29, 2011, 12:19 AM

Should i create an issue? (I use a snapshot version)
Why not? If you have only 1 database in your application, it does not really matter if you fill the name or not. Otherwhise you can just use @PersistenceUnit(unitName = "myName").

--- Mark Struberg <st...@yahoo.de> schrieb am Mi, 29.6.2011:

Von: Mark Struberg <st...@yahoo.de>
Betreff: Re: OWB with Seam?
An: user@openwebbeans.apache.org
Datum: Mittwoch, 29. Juni, 2011 00:04 Uhr

Of course this might be an error in OWB.
But I generally question the reason why one would like to create a EntityManager for a PersistenceUnit with no name. That would not allow you to use this mechanism in a bit more complex
 scenarios...

LieGrue,
strub


--- On Tue, 6/28/11, Thomas Andraschko <to...@yahoo.de> wrote:

From: Thomas Andraschko <to...@yahoo.de>
Subject: Re: OWB with Seam?
To: user@openwebbeans.apache.org
Date: Tuesday, June 28, 2011, 10:01 PM

AFAICS Seam adds the bean for the EntityManager in: org.jboss.seam.persistence.ManagedPersistenceContextExtension.registerManagedPersistenceContext / afterBeanDiscovery
This bean is also added with OWB but why it will not be injected?

--- Thomas Andraschko <to...@yahoo.de> schrieb am Di, 28.6.2011:

Von: Thomas Andraschko <to...@yahoo.de>
Betreff: Re: OWB with Seam?
An: user@openwebbeans.apache.org
Datum: Dienstag, 28. Juni, 2011 23:10
 Uhr

Don't know how seam produces the EntityManager but the configuration is correct.
You can read about it here:
 http://docs.jboss.org/seam/3/persistence/latest/reference/en-US/html/persistence.html#d0e37

--- Eric Covener <co...@gmail.com> schrieb am Di,
 28.6.2011:

Von: Eric Covener <co...@gmail.com>
Betreff: Re: OWB with Seam?
An: user@openwebbeans.apache.org
Datum: Dienstag, 28. Juni, 2011 22:49 Uhr

On Tue, Jun 28, 2011 at 4:30 PM, Thomas Andraschko
<to...@yahoo.de> wrote:
>
> As you can see in the project uploaded at megaupload (it is linked in one of
 the older posts) the entitymanager is produced through seam with following producer field in my application:
>
> public class MyEntityManagerProducer {
>     @ExtensionManaged
>     @Produces
>     @PersistenceUnit
>    
 @ConversationScoped
>     EntityManagerFactory myEntityManagerFactory;
> }
>

I don't know anything about JPA, but this field produces a
EntityManagerFactory while you inject an EntityManager.  You'd need to
either uses a producer method that invokes the factory, or inject the
factory and then invoke it.