Thanks! That worked.

I've hooked up Arquillian Persistence + DbUnit and have it deployed to a JBoss 
7. I'd like to do the same with OpenEJB because deploying to a server is slow. 
I know I have an uphill battle:
1. Finding classes for the persistence unit
2. Getting the persistence unit to work with Hibernate
3. Hooking up Arquillian Persistence config to OpenEJB UserTransaction.
4. Seeing if Arquillian Persistence can be run outside of JBoss server.

I came across a couple of other issues. I have a 
src/test/resources/test/dbUnit-persistence.xml which gets packaged properly to 
a JavaArchive META-INF/persistence.xml. I notice that the PersistenceUnitInfo's 
root url is file:/..../target/test-classes/test/persistence.xml. Two things 
here:
1. all my code is coming from the underlying file:/.../target/classes ... but 
in theory the classes could be found on a mixture of class loaders
2. the persistence unit root url shouldn't point to the persistence.xml. It 
should be the root of the persistence unit (JavaArchive: / ; WebArchive: 
/WEB-INF/classes).

Let me know if you want a simple example. The code I'm working with is specific 
to my company, so I'll need to spend time creating a sample.

Much appreciated,
Trev

-----Original Message-----
From: Romain Manni-Bucau [mailto:[email protected]] 
Sent: Friday, November 09, 2012 7:52 AM
To: OpenEJB Users
Subject: Re: cdi-basic-arquillian

right should be fixed on trunk (just fixed)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/11/9 Baker, Trevor <[email protected]>

> Ah. Yes. Thanks. I knew I was missing something.
>
> I did change it up from a JavaArchive to a WebArchive. The CDI 
> injection works when the beans.xml exists as WEB-INF/beans.xml but 
> does not as WEB-INF/classes/META-INF/beans.xml.
>
> Trev
>
> -----Original Message-----
> From: Romain Manni-Bucau [mailto:[email protected]]
> Sent: Wednesday, November 07, 2012 11:18 PM
> To: OpenEJB Users
> Subject: Re: cdi-basic-arquillian
>
> Hi,
>
> yeah, you forgot the little "active me cdi please" detail:
> META-INF/beans.xml. That's why you don't get any managed bean.
>
> Not sure you are familiar with arquillian so saying it: it is done 
> using addAsManifestResource(EmptyAsset.INSTANCE, 
> ArchivePaths.create("beans.xml"))
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
>
> 2012/11/8 Baker, Trevor <[email protected]>
>
> >  Hi,****
> >
> > ** **
> >
> > I was trying to convert the cdi-basic example to use Arquillian. I 
> > ran into a problem because Faculty cannot be injected into Course 
> > unless Faculty is a @ManagedBean (or @Stateless). However, in the 
> > original cdi-basic example Faculty isn't a @ManagedBean and the test 
> > runs
> > green.***
> > *
> >
> > ** **
> >
> > Wondering if I'm missing some config or something else.****
> >
> > ** **
> >
> > I've attached the cdi-basic-arquillian example.****
> >
> > ** **
> >
> > Thanks,****
> >
> > Trev****
> >
>

Reply via email to