aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Exception in deployment of ejb ear Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Exception in deployment of ejb ear" Watch "Exception in deployment of ejb ear" New topic
Author

Exception in deployment of ejb ear

Amit Chauhan
Greenhorn

Joined: Jun 26, 2007
Posts: 27
Hi All ...
I am getting this exception while deploying an ear which contains a call to the entity bean from a session bean , does anybody have an idea where the things are going wrong :



My code goes like this (I have put it in a servlet) ::


Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

In your FirstSessionBean.java, can you show how you declared the EntityManagerFactory called emf ? The problem seems to be there.


[My Blog]
All roads lead to JavaRanch
Amit Chauhan
Greenhorn

Joined: Jun 26, 2007
Posts: 27
Code for the Session Bean
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

What is this Resource annotation with the EntityManagerFactory ? You usually declare an EntityManagerFactory the following way :
Amit Chauhan
Greenhorn

Joined: Jun 26, 2007
Posts: 27
Hi ,
I changed the code as you said but still it throws up the error message as this :






The code for the bean now looks like this :

Mohammad Albaba
Greenhorn

Joined: Dec 10, 2009
Posts: 6
Hello my friend.
Today I got the same exception with a session bean and could solve it:

When you create a session bean, the IDE sometimes creates a file called "ejb-jar.xml" which declaratively describes these beans and their properties. Since you're using EJB3, annotations allow you to dispense with this XML file. Just remove the file from the following path:
(ejbModule/META-INF/ejb-jar.xml) and the deployment succeeds.

The exception resulted from missing properties in the XML file.

Hope it works for you as it did for me...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception in deployment of ejb ear