File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Transactions testing with maven and jetty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Transactions testing with maven and jetty" Watch "Transactions testing with maven and jetty" New topic

Transactions testing with maven and jetty

Trilochan Bharadwaj
Ranch Hand

Joined: Feb 02, 2009
Posts: 100

I am currently working on a Spring MVC, Spring Web Flow / Dojo client / Restful Resource on JAX RS (using Jersey JAX) <--> Spring <--> Hibernate <--> DB based web application; and we use maven with jetty for running some of our stuff for testing. I wanted to test some of my Business tier elements (Service Tier annotated with @Transactional annotations for Spring); On presentation tier I have restful resource using Jersey JAX RS that calls Spring based POJO service that calls DAO to get the results. The service methods are annotated with @Transactional (spring) annotations and I wanted to test out my flow; Our service xml for Spring beans/context configuration looks like this:


I have configured Jetty plugin as follows: (in POM.xml)

For jetty config I am using Jetty plus xml as supplied with jetty server download. I have added following lines to it:

But when I do a mvn clean compile test install jetty:run ... It compiles fine and test cases run, but Jetty maven plugin cannot find UserTransactionImp; I checked ... its there on the classpath and I checked the jar in .m2 repo ... its present where it should be ...

2010-02-09 23:07:34.657:INFO::Logging to StdErrLog:: DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
2010-02-09 23:07:34.689:WARN::Config error at <New id="userTxImpl" class="com.atomikos.icatch.jta.UserTransactionImp"/> java.lang.ClassNotFoundException: com.atomikos.icatch.jta.UserTransactionImp

^^ those are the two lines I get and server exits ...

Any help or suggestions would appreciated ... NOTE: I don't need Atomikos ... I couldn't find any other transaction implementation that I could use with Jetty ... I just need to test my code's flow with Transaction management (Integration testing 101).

Thanks in advance!
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Sounds like a Jetty issue and not a Spring issue. Moving this thread to the more appropriate forum.



Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Trilochan Bharadwaj
Ranch Hand

Joined: Feb 02, 2009
Posts: 100

If you read what I said in the end you'd know that I do NOT intend to use only transaction manager with JETTY or that JETTY alone; I asked I just want to test out my transactions in Spring; which means I need pointers on how to do that in Spring ... so it really is a concern of Spring.

I agree. Here's the link:
subject: Transactions testing with maven and jetty
It's not a secret anymore!