| Author |
EJB3.0 Stateless session bean in weblogic 10.3
|
Baalamurugan Raman
Greenhorn
Joined: Oct 29, 2004
Posts: 15
|
|
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!
|
Baala
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8147
|
|
"Baalamurugan"
Please click on the "My Private Messages" link on top of this page, for a message from JavaRanch.
|
[My Blog] [JavaRanch Journal]
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8147
|
|
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
Joined: Oct 29, 2004
Posts: 15
|
|
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
Joined: Feb 01, 2005
Posts: 559
|
|
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
|
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
|
 |
 |
|
|
subject: EJB3.0 Stateless session bean in weblogic 10.3
|
|
|