File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes How to use JUnit and EJB3 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "How to use JUnit and EJB3" Watch "How to use JUnit and EJB3" New topic
Author

How to use JUnit and EJB3

Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi

I want to test my EJB3 with JUnit. But I get allways following error :



The setup methode looks like :



My persistence.xml :


What can I do ? Where is the right place for the persistence.xml file ?


SCJP, SCWCD, SCBCD<br /> <br />Vienna, Austria
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8143
    
  52

I havent worked with EJB3 much, but EJBs are server side components and they cannot be tested with JUnit. You might have to use Cactus instead, which is very similar to JUnit but allows you to test server side components.


[My Blog] [JavaRanch Journal]
Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi

I have the book "Pro EJB 3" of Apress. There is a description to test EJB3 with JUnit. It schoud be possible.

But I will take a look to Cactus.

Thanks
Georg


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use JUnit and EJB3
 
Similar Threads
Working with DataNucleus: How I solved the "No persistence providers available" problem.
I'm trying to build a JPA application , but i am getting an error NoClassFound
hibernate persistence.xml question
problem in pro EJB3 chapter 2 code
JPA not working with EJB3