tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Vysny <...@whitestein.com>
Subject Re: OpenEJB maven problem
Date Thu, 07 Feb 2008 08:06:25 GMT

On Wed, 2008-02-06 at 14:12 -0800, David Blevins wrote:
> Hi Eivinn,
> 
> On Feb 6, 2008, at 6:57 AM, Eivinn Hustveit wrote:
> 
> > I have now successfully gotten both Hibernate and DataSource  
> > injection to work using transaction-type="RESOURCE_LOCAL" in  
> > persistence.xml after fiddling with the openejb.xml. The one thing  
> > missing in the DB setup now is transaction-type="JPA". The result  
> > always being that Hibernate complains about not having access to the  
> > "JTA TransactionManager".
> > Has anyone gotten this to work?
> 
> If I recall correctly, I think Martin has.  Martin, do you recall how  
> you hooked up the transaction manager with hibernate?
> 
> We make the transaction manager available via jndi lookup at  
> java:openejb/TransactionManager and also via a static method  
> org.apache.openejb.OpenEJB.getTransactionManager().
> 

If I recall correctly, we had to set a custom TM provider (this goes for
OpenEJB3.0-beta-1:

public class OpenEJBTransactionManagerLookup extends
		JNDITransactionManagerLookup {

	@Override
	protected String getName() {
		return "java:comp/TransactionManager";
	}

	public String getUserTransactionName() {
		return "java:comp/UserTransaction";
	}
}

You have to set this provider to the Hibernate:
properties.put(Environment.TRANSACTION_MANAGER_STRATEGY, new
OpenEJBTransactionManagerLookup());
(You can specify these properties in persistence.xml I think)


> > I can also inform you that I had to remove most classes and that it  
> > is only a simple example class still being used. I will have to add  
> > them back one at a time to find the class(es) that prevents OpenEJB  
> > from setting up the InitialContext.
> 
> You should give the recently released 3.0-beta-2 a try.  http://www.apache.org/dist/openejb/3.0-beta-2/
> 
> -David
> 

David, thanks, great news! ;) Do you know when it will be released into
Maven2 repository (ibiblio or other)?

Martin

> >
> >
> >
> > On Feb 5, 2008, at 10:15 AM, Eivinn Hustveit wrote:
> >
> >> Dear Sirs,
> >>
> >> I have recently tried to use OpenEJB for testing our JEE  
> >> application during a maven build. The application is compiled using  
> >> JDK 1.6 with target 1.5 due to EJB3 deps, OpenEJB is compiled from  
> >> trunk on JDK1.5. I'm running OS X.
> >>
> >> Hope somebody can help.
> >>
> >> When we try to run "mvn test" using JDK 1.6 I get the following  
> >> error:
> >> http://files.mobiletech.no/stacktrace.txt
> >>
> >>
> >> mvh
> >> Eivinn Hustveit
> >> System Manager
> >> www.mobiletech.no
> >>
> >
> >
> 
> 
-- 
Mgr. Martin Vysny | mvy@whitestein.com
Software Engineer
Whitestein Technologies s.r.o | www.whitestein.com
Panenska 28 | 811 03 Bratislava | Slovak Republic
Main +421 2 5443-5502 | Direct +421 2 5930-0717


Mime
View raw message