• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3.0 Stateless session bean in weblogic 10.3

 
Baalamurugan Raman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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!

 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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


 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic