I am stuck here.I am a newbie to ejbs and to make it clear i created a simple web application in which i have one jsp with just one button "GetAdvice" on click of which i am going to one servlet in which i have written code(client side) to access a business method in ejb(component interface/remote interface) which will return me a string.But i do not know how do i deploy it in weblogic.
My jsp code is :
and servlet code :
Home interface :
Remote interface :
Bean class :
ejb-jar.xml is :
weblogic-ejb-jar.xml is :
with other callback and lifecycle methods
My directory structure is :
Please help.I do not know how to get client jar and how to deploy ......
Thanks for the reply joe!I am able to do it!But i have some confusion regarding ejb deployment and all(For standalone application).I wrote a bean and exported it as jar(Advice.jar)(having interfaces+bean class+deployment descriptor).Then i ran a weblogic command to generate the client side jar(ejb_client.jar) having stubs and interfaces implementation.Then i wrote my client application(client java program+interfaces and bean class to avoid compilation error) and added that client jar to the classpath.Then i deployed that jar(advice.jar) to weblogic.Then i ran the command (java -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Djava.naming.provider.url=t3://localhost:7001 -cp C:\bea10\wlserver_10.3\server\lib\weblogic.jar;.;ejb_client.jar EjbClient) where EjbClient.java is my client program.I am using t3 protocol to connect to my server and i got the output.
Here are some of my doubts(some might look weird but i want to know)....
1)If the application is talking to the deployed jar on server through t3 then what is the need of ejb_client.jar
2)I tried replacing ejb_client.jar with Advice.jar even then also it worked.why?
3)I used to think that once i'll get the ejb_client.jar.I can directly use it in my classpath without any server(seems weird ) because that jar is having the interfaces implemented).
I also tried it with web application.i wrote a simple jsp and servlet +interfaces and bean class in order to avoid compilation errors and i deployed it on server while bean jar(Advcie.jar) already being on server and it worked fine(looks good to me).
Please sail me out.Could anyBody make my fundamentals clear over it.Please.......Thanks in Advance.
Thanks a lot for your answers joe.They were quite helpful.But still one question(Don't mind).If the Advice.jar sufice our purpose then we need not to generate the cllient side jar.Because again i tried without cresting client side jar and it worked.Am i on right path or getting diverted?
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff: