Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Deploying Ejbs in Weblogic 10.3

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic