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

Deploying Ejbs in Weblogic 10.3

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
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 ......

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the relevant documentation online. You will probably want to look at autodeployment while you are experimenting.
 
Ouney Gags
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ouney Gags wrote:
1)If the application is talking to the deployed jar on server through t3 then what is the need of ejb_client.jar



The client JAR only has the files necessary for contacting the EJB. It doesn't contain the implementation

Ouney Gags wrote:
2)I tried replacing ejb_client.jar with Advice.jar even then also it worked.why?



The EJB JAR contains both the files necessary for contacting the bean as well as the implementation.

Ouney Gags wrote:
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).



You cannot use an EJB without a server running. The EJB is an interface implementation. The creation, invocation and destruction of the bean is handled by the container.
 
Ouney Gags
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic