You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Eivinn Hustveit <eh...@mobiletech.no> on 2008/02/05 10:15:16 UTC

OpenEJB maven problem

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

Re: OpenEJB maven problem

Posted by Eivinn Hustveit <eh...@mobiletech.no>.
Thank you all!
The TransactionManager-suggestion was it, along with a new fresh  
project.

The last needed step was this page which tied it all together:
http://openejb.apache.org/3.0/hibernate.html

I do now use along with alot of hibernate stuff as well. If anyone  
else experience the same problems I can write a JTA setup and in time  
upload an example project.
<dependency>
       <groupId>org.apache.openejb</groupId>
       <artifactId>openejb-core</artifactId>
       <version>3.0-beta-2</version>
       <scope>test</scope>
</dependency>

mvh
Eivinn Hustveit
System Manager
+47 97777594
www.mobiletech.no

Re: OpenEJB maven problem

Posted by David Blevins <da...@visi.com>.
On Feb 7, 2008, at 12:06 AM, Martin Vysny wrote:

>
> On Wed, 2008-02-06 at 14:12 -0800, David Blevins wrote:
>>
>> You should give the recently released 3.0-beta-2 a try.  http://www.apache.org/dist/openejb/3.0-beta-2/
>>
> David, thanks, great news! ;) Do you know when it will be released  
> into
> Maven2 repository (ibiblio or other)?

Sorry, Martin, totally missed this part on the end.  It's all up in  
repo1.maven.org at last, so you should be good to go.

-David


Re: OpenEJB maven problem

Posted by Martin Vysny <mv...@whitestein.com>.
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


Re: OpenEJB maven problem

Posted by David Blevins <da...@visi.com>.
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().

> 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

>
>
>
> 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
>>
>
>


Re: OpenEJB maven problem

Posted by Eivinn Hustveit <eh...@mobiletech.no>.
Hi all,

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?

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.


mvh
Eivinn Hustveit
System Manager
www.mobiletech.no



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
>