Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception in deployment of ejb ear

 
Amit Chauhan
Greenhorn
Posts: 27
  • 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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code for the Session Bean
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 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
  • 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
  • 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...
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!