Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

javax.ejb.EJBException: Impossible to create the MyBean: EJB Exception:

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
I have created an session ejb and iam calling the ejb from a message drivenbeans ejb create method it look like this

context = new InitialContext();
service = (String) context.lookup("java:comp/env/myapp/ApplicationService");
ref = context.lookup("java:comp/env/myapp/myApplicationBean");
myEjbHome = (myEjbHome) PortableRemoteObject.narrow(ref, myEjbHome.class);
myRemoteEjb = myEjbHome.create();



in my ejb-jar.xml have a reference like this

<ejb-ref>
<ejb-ref-name>myapp/myApplicationBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>it.ejb.jms.myEjbHome</home>
<remote>it.ejb.jms.myRemoteEjb</remote>
<ejb-link>MyBean</ejb-link>
</ejb-ref>

I have a description in weblogic-ejb-jar.xml

<ejb-reference-description>
<ejb-ref-name>myapp/myApplicationBean</ejb-ref-name>
<jndi-name>MyBean</jndi-name>
</ejb-reference-description>


But while invoking the ejb i get error like this

Caused by: javax.ejb.EJBException: Impossible to create the MyBean: EJB Exception:; nested exception is:
java.lang.NullPointerException

can any one sugget some solution

thanks
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

One possible reason is your EJB is not properly deployed on the server. Please check on log file whether your EJB is sucessfully deployed or not?

Another possible reason may be,If your EJB client is not running under any container than you need to set follwing parameters before you write 'context = new InitialContext();'

- URL prefixes
- JNP provider
- JNP protocol

Make it sure that required jar are available in your class path.

hope that this will help you.

Sunil
 
Paper jam tastes about as you would expect. Try some on this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic