javax.naming.NoInitialContextException while Running the EJB client

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown javax.naming.NoInitialContextException while Running the EJB client

by bftanase :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

With EJB 3.0 you can use annotations. Have you tried it?



The code should look smth like this...




Code:


[...]

import HelloWorldRemoteHome;



[...]



@EJB

private static HelloWorldRemoteHome  home;



public static void main(String [] args){

     home.invokeHello();

}









This should inject the whole required initial context stuff...





Parent Message unknown javax.naming.NoInitialContextException while Running the EJB client

by mukesh.sheoran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, I have not tried this as I am working on a EJB 2.0 project... Can Any body please suggest me smthng  with EJB 2.0

------------------------
regards,

mukesh sheoran.





Parent Message unknown javax.naming.NoInitialContextException while Running the EJB client

by smoczyna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For EJB2 you need to build deployment descriptor
try this http://www.vipan.com/htdocs/ejb-jar.xml.html