• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB3.0 Stateless session bean in weblogic 10.3

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All

I need to create a Local home EJB3.0 stateless bean on Weblogic 10.3 workshop IDE. I have tried with EJB3.0 annotations
but getting Null Pointer exceptions when I tried to invoke the annotations as below ..

@Local
public interface MyInterface{ String getMyString();
}

@Stateless
public class MyBean{
public void String getMyString(){return "somestring";}
}

in my java progect client pgm(standalone class but the java pkg is bundled in EAR along with EJB project, all are in same EAR project referece),
..
{
@EJB MyInterface myInf;
myInf.getMyString()
..
I have tried putting the ejb-jar.xml and weblogic-ejb-jar.xml etc., but my weblogic server doesnt care anything
my local interface is always null. It would be great if any of us can point me as I am struggling a lot for 1 week.
Thanks in advance for all JAVA GuRus!

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Baalamurugan"
Please click on the "My Private Messages" link on top of this page, for a message from JavaRanch.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

in my java progect client pgm(standalone class ...



Injection is not supported in standalone clients. You need to package it as an application client. Each server has it own way of deploying the application client in a application client container. Since you are using WebLogic, i will move it to the "WebLogic" forum
 
Baalamurugan Raman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi JaiKiran

Sorry, I didnt get you what you mean - Are you saying that i need to create a the Client jar package generated in the workspace IDE and deploy it in the weblogic server.

MyEJBClient
MyEJB
MyEJBEAR

I have bundled all the above and deployed
Could you please tell me how to make a EJB3.o local client call ?

Thanks in advance


 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Baala,

Feel free to take a look at the example code for EJB 3 in Action: http://www.manning.com/panda/. As stated, there is nothing in the JVM that recognizes @EJB. You will either need to run inside the container, use an application client or use JNDI look-up.

Regards,
Reza
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic