This week's giveaway is in the Spring forum. We're giving away four copies of liveProject: Protecting User Data with Spring Security and OAuth2 and have Laurentiu Spilca on-line! See this thread for details.
I'm using Eclipse Europa(3.3) configured to Weblogic 9.1 server.
I was attempting to create a simple J2EE Enterprise Application, where in a web application would send a name and a Stateless session bean needs to return a greeting msg. Using eclipse, however I was able to create my Bean class, Remote and Home interfaces and also written ejb-jar.xml.
Now my question is how to generate client side stubs. While creating the bean, I was asked whether I needed any client jar file containing stubs and other needed files and I said yes, but I thought that container would generate that jar file for me so that I can include that in the classpath while coding the servlet. But this is not happening.
My first question is 1) How to generate client side stubs using weblogic 9.1 and as per the documentation java weblogic.appc would generate them for me.But It didn't happen actually.
2) My second question is how is weblogic-ejb-jar.xml is generated. Is it generated during deployment or should be generated before deployment. If so how do I get this file. Because I need to set my JNDI mappings also here.
To be frank, I have been struggling for a month now to set up my J2EE environment but have miserably failed .
Please some one on the network help me in fixing this.
Thanks & Regards, SK
SCJP 5.0, DB2 - 800, DB2 - 803, SCDJWS (On the way)
My preference is to use the wlappc Ant task supplied by BEA, although I know people who prefer to write a shell script which calls weblogic.appc. Regardless of how you do it, you must run weblogic.appc to generate the stubs.
Those are the classes that are generated by appc for one EJB called "AtmServices": AtmServices.class AtmServicesBean.class AtmServicesHome.class AtmServicesLocal.class AtmServicesLocalHome.class AtmServices_wmrzn4_ELOImpl.class AtmServices_wmrzn4_EOImpl.class AtmServices_wmrzn4_EOImplRTD.xml AtmServices_wmrzn4_EOImpl_1001_WLStub.class AtmServices_wmrzn4_EOImpl_IIOP_WLStub.class AtmServices_wmrzn4_EOImpl_WLSkel.class AtmServices_wmrzn4_HomeImpl.class AtmServices_wmrzn4_HomeImplRTD.xml AtmServices_wmrzn4_HomeImpl_1001_WLStub.class AtmServices_wmrzn4_HomeImpl_IIOP_WLStub.class AtmServices_wmrzn4_HomeImpl_WLSkel.class AtmServices_wmrzn4_Impl.class AtmServices_wmrzn4_Intf.class AtmServices_wmrzn4_LocalHomeImpl.class _AtmServicesHome_Stub.class _AtmServices_Stub.class _AtmServices_wmrzn4_EOImpl_Stub.class _AtmServices_wmrzn4_HomeImpl_Stub.class Those classes are all packaged in one jar that needs to be deployed on the weblogic server. But for the ejb-client jar, I certainly do not need all those classes. Do I have to package an ejb-client myself, including the classes needed for the remote client? If so, do you know which classes need to be included for the client?
Do I need to use something like this in my build.xml:
Thank you, Lucas [ March 17, 2008: Message edited by: Lucas Opara ]
You are not supposed to know which classes the client needs, so just place the JAR on the client classpath. Once you have got the wlclient.jar on the classpath as well, your client should be able to do a JNDI lookup on the home object, get the stub which implements the remote interface and invoke the bean methods.
I found the solution to my problem, it's really easy but you need to know it. Weblogic supports the tag <ejb-client-jar> in ejb-jar.xml to generate client stubs. If you include it, and call the ant task wlappc, it will generate the stubs.
[ March 17, 2008: Message edited by: Lucas Opara ] [ March 17, 2008: Message edited by: Lucas Opara ]