File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in deployment of ejb ear

 
Amit Chauhan
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your FirstSessionBean.java, can you show how you declared the EntityManagerFactory called emf ? The problem seems to be there.
 
Amit Chauhan
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code for the Session Bean
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is this Resource annotation with the EntityManagerFactory ? You usually declare an EntityManagerFactory the following way :
 
Amit Chauhan
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic