ejb-client-jar example from the core specification

Hello all,
the ejb3.0 specification says (chapter 60 page 241):
the jar file that contains the client should contain one of the following: 
• a reference to the ejb-client JAR file 
• a reference to the ejb-jar file that contains the client view classes 
• a copy of the client view classes  There is also an example on page 242:
In this example, the Bean Provider has chosen to package the enterprise bean client view classes in a
separate jar file and to reference that jar file from the other jar files that need those classes. Those classes
are needed both by ejb2.jar, packaged in the same application as ejb1.jar, and by ejb3.jar,
packaged in a different application. Those classes are also needed by ejb1.jar itself because they
define the remote interface of the enterprise beans in ejb1.jar, and the Bean Provider has chosen the
by reference approach to making these classes available.
The deployment descriptor for ejb1.jar names the client view jar file in the ejb-client-jar
element. Because ejb2.jar requires these client view classes, it includes a Class-Path reference to
ejb1_client.jar.
The Class-Path mechanism must be used by components in app2.ear to reference the client view jar
file that corresponds to the enterprise beans packaged in ejb1.jar of app1.ear. Those enterprise
beans are referenced by enterprise beans in ejb3.jar. Note that the client view jar file must be
included directly in the app2.ear file.
    app1.ear:
        META-INF/application.xml
        ejb1.jar Class-Path: ejb1_client.jar
            deployment descriptor contains:
                <ejb-client-jar>ejb1_client.jar</ejb-client-jar>
        ejb1_client.jar
        ejb2.jar Class-Path: ejb1_client.jar
    app2.ear:
        META-INF/application.xml
        ejb1_client.jar
        ejb3.jar Class-Path: ejb1_client.jarNow finally my questions are:
1. Why did we need to include the ejb1_client.jar in app2.ear (or even in app1.ear), wasn't it enough to deploy the ejb1_client.jar separately then refer to it (using class-path in Manifest, or may be just by using <ejb-client-jar>) as the bullets quoted first suggest?
2. How come we didn't need to use <ejb-client-jar> for ejb2.jar
3. Since both of ejb1.jar and ejb2.jar are packaged in app1.ear couldn't we simply refer to the ejb1_client.jar in the Manifest file of app1.ear?
Please, I appreciate your input on this

I am guessing here and please correct me if I am wrong:
ejb1.jar uses interfaces in ejb1_client.jar as the interface for some of the beans so we needed to use ejb-client-jar and we needed a reference in the manifest file.
ejb2.jar uses some of the claess/interfaces as may be a return type but not as an interface for one of its beans so we didn't need to use ejb-client-jar but we needed an entry in the manifest file.
regarding app1.ear, we can put the ejb1_client.jar in the META-INF/lib app1.ear without the need for any entries in the manifest files.
Edited by: malrawi on Jun 14, 2009 11:59 PM

Similar Messages

  • Ejb-client.jar

    Hi,
    I've got an EJB system that until now have been packaging as just a
    bean jar and not bothering with a ejb-client.jar. I now want to
    package as follows
    a). A bean EAR file (containing bean jar, and dependency jars) - for
    deploying on EJB server.
    b). An app EAR file (containing WAR, containing ejb-client.jar).
    The first part is done. The second raised questions about the contents
    of the ejb-client.jar. I have packaged the Home/Remote interfaces and
    all necessary utility classes (i.e omitting the Local/LocalHome/EJB
    classes). What I need to know is what goes in there in terms of
    descriptors.
    Do I just package the exact same ejb-jar.xml, jboss.xml,
    jbosscmp-jdbc.xml, weblogic-ejb-jar.xml, weblogic-cmp-rdbms-jar.xml ?
    or do I have to change these in some way ?
    Do I also add the ejb-client-jar tag to the ejb-jar.xml ? (would this
    also go in the ejb-jar.xml that goes in the bean jar ?) ... and indeed
    what would I put in there ... just the name of ejb-client-jar file
    even though its only being packaged into any application WAR (what
    purpose does it serve) ?
    TIA

    The ejb-link value should include pathnames relative to the top level of the EAR
    file.
    <ejb-link>../my_beans-client.jar#CurrencyExchange</ejb-link>
    Andy Jefferson <[email protected]> wrote:
    Deepak Vohra wrote:
    An ejb-client.jar contains the class files, the home and remote interfaces
    and the primary key class, a client program needs to call the EJBs
    contained in the ejb-jar file.
    Also, ejb-client.jar contains a copy of any classes from the ejb-jarfile
    that
    are referenced by the home and remote interfaces and the primary key
    class. Deployment descriptors are not required in the ejb-client.jar.
    ejb-client-jar element is not a required element in ejb-jar.xml. If
    ejb-client-jar.xml is specified in ejb-jar.xml ejbc generates the
    ejb-clent.jar file.
    Thx. I'm not interested in using any server-specific tools (like ejbc)
    since
    I'm deploying to multiple servers and so am generating the ejb-client
    jar
    myself in my build process. In this context, what purpose does the
    <ejb-client-jar> tag in the ejb-jar.xml descriptor have ? Why does the
    beans jar need to know anything about where the client stubs are ?
    As far as I can tell I'm including the right things in my ejb-client.jar,
    and I've tried deploying my web-app EAR to WebLogic 7.0 and I always
    get
    that it can't find the ejb-link elements. What i've got in my EAR is
    my_app.war
    META-INF/application.xml
    and in the WAR
    my JSP files
    WEB-INF/web.xml
    WEB-INF/jboss-web.xml
    lib/my_beans-client.jar
    In the WEB-INF I have ejb-ref's like the following
    <ejb-ref >
    <ejb-ref-name>ejb/CurrencyExchangeHome</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>my_domain.CurrencyExchangeHome</home>
    <remote>my_domain.CurrencyExchangeRemote</remote>
    <ejb-link>my_beans-client.jar#CurrencyExchange</ejb-link>
    </ejb-ref>
    Should I be putting the my_beans-client.jar in the EAR and not the WAR
    Seems I am missing something, but not sure what exactly.

  • Using JarSettings to generate EJB client jar, but supported classes missed

    Appreciated for any comments in advance.
    I am using @jarSetting to generate EJB client jar file from workshop 9.2. The remote method of EJB has one input parameter that is defined as an interface. The interface is included in client jar, but the implementation of this interface is not.
    Please advise how I can add the implementation of this interface to client jar?
    Best Regards,
    James

    Hi James,
    I believe the algorithm for creating the client jar is to simply inspect the EJB interfaces using reflection and to include all user defined classes and exceptions that are referenced by the interfaces. In your case, it sounds like a class is not being included because it is not directly referenced by one of the EJB interfaces.
    I think the client jar creation algorithm can be described as "best effort" and unfortunately, it does not always end up including all classes needed by the client. I would recommend you add the additional classes manually using the jar tool.
    - Matt

  • EJB Client JAR project produces empty JAR

    I've built an EJB module in WorkSpace Studio using the "WebLogic EJB Project" type, which is part of an EAR. I created a couple stateless session beans within this project, and then created an EJB Client JAR project using the "EJB Client JAR-->Create EJB Client Jar" menu item on the EJB project's hidden menu.
    According to the documentation, exporting an EAR file from the EAR project will cause the client JAR to be generated. I exported the EAR file from the EAR project, and sure enough, it included the client JAR (in /APP-INF/lib/). I extracted the client JAR from the EAR and opened it up to make sure it contained all of the client-side classes. I discovered that the client JAR was empty, the only contents being the MANIFEST.MF file. The interface classes were instead contained in the EJB JAR itself.
    How can I get the EJB client code to actually be included in the EJB client JAR?
    Thanks,
    Eric

    Well I have tried this with 6.1 and first
    1. One would expect the jar name to be the name in the ejb-jar.xml -
    ejb-client-jar section
    2. It outputs the file XXXEJB_Compiled.jar but it is same size as base jar
    this is 6.1 sp3
    whats up?
    Matthew Shinn wrote:
    Hi Sanjay,
    There is a bug in the documentation. The client-jar name should never be part of the
    ejbc command line. Step 3 below should be something like:
    java weblogic.ejbc xxxEJB.jar xxxEJB_Compiled.jar
    If you have an ejb-client-jar entry in your ejb-jar.xml, the client jar should be placed
    in the directory from which you ran ejbc. Make sure that the classes that you want to be
    put in the client-jar are not loaded from the classpath. This is very important or your
    client-jar won't be created correctly. The client-jar will only contain classes loaded
    from the input jar to ejbc. A bug for the incorrect documentation has already been filed
    and should be fixed soon.
    - Matt
    Sanjay Dwivedi wrote:
    Hi,
    I am trying to use the
    <ejb-client-jar> sub-element of the Sun's <ejb-jar> (EB 2.0 DTD) element of the
    ejb-jar.xml to generate the ejb-client.jar. I followed the step as documented
    by WebLogic but the files in EJB jars and ejb-client jars are identical. Here
    is what I am doing:
    1. Build the xxxEJB.jar for my EJB by running the WebLogic.ejbc on the standard
    EJB jar file.
    2. My ejb-jar.xml file has following line:
    <ejb-jar>
    <ejb-client-jar>xxxEJBClient.jar</ejb-client-jar>
    </ejb-jar>
    3. Next I used the following command to generate the ejb-client.jar file
    java weblogic.ejbc xxxEJB.jar xxxEJBClient.jar
    My xxxEJBClient.jar files consists of exactly same files (with same sizes) as
    the xxxEJB.jar file. Only difference is that the xxxEJB.jar file includes generated
    java source files for the bean implementation class and home/remote classes.
    In my opinion the xxxEJBClient.jar should not contain the EJB implementation classes.
    Any experience using the ejb-client-jar for generating the ejb-client.jar?
    Thanks,
    Sanjay.
    [att1.html]

  • Two web apps using the same EJB client jar

    I am currently deploying two web apps on a server. Both web apps use an EJB client
    jar (the same jar) to access EJB's and both apps work when tested independently.
    The problem arises when I log into app A and then log into app B. As soon as
    I do app A loses it's references to the EJBHomes, and other classes.
    It seems a classloader is unloading the first classes and instances loaded by
    the first app and then loading them from app B's client.jar.
    If I put the client.jar in the system classpath everything is fine, but that's
    just a hack.
    Is it not possible to deploy two web apps on a server using the same client.jar's
    in their own WEB-INF/lib's?

    Joe,
    As Pravin mentions, the checking of those boxes in Workbench triggers scheduled jobs within the EAC that kicks off the scripts at the appropriate time/day. But as you've noticed, there's not a ton of flexibility and you don't get cron or Windows Scheduler-type capabilities.
    If you need to do something special, you can manually kick off the report generation scripts from your control directory using the runcommand.bat (or sh) script or place the command into a cron/Windows Scheduler job:
    For example, to kick off the WeeklyReports job, you would do this:
    runcommand.sh WeeklyReports runSo, assuming you go down the route of creating multiple ReportGenerators and scripts, you would create a job to kick off the new script you've created at the appropriate time.
    Hope that helps,
    Patrick
    http://branchbird.com

  • EJB Client JAR Creation - Workspace Studio (ALSB 3.0/WLS 10)

    hi
    I'm trying to create an EJB Client JAR for an 2.1 Session Bean EJB Created in a WLS 10 domain using BEA Workspace Studio (i.e. this is the Aqualogic Service Bus 3.0 Product install).
    I'm doing this in preparation for testing the ALSB EJB Transport which requires a client JAR.
    I simply can't get a useful JAR from the facility provided in the Workspace IDE. The Workspace help is pointing to an IBM generated page and I'm following the procedure there.
    I have configured the EJB for an EJB Client Project.
    If I export an EAR from the Application containing the EJB, the EAR only contains the EJB JAR (with a Manifest entry to a non-existent Client JAR).
    If I export the EJB Client Project to a JAR the JAR is simply empty i.e. contains some descriptor type artefacts but no classes.
    I have tried this quite a few times with the same outcome. Can anyone from BEA or the user community confirm whether or not this facility actually works!
    Thanks
    Jim Nicolson

    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/ejbTransport/ejbtransport.html#wp1079062 . This is document for OSB 10xx and yours is a a version or two older than this (So it will be applicable).
    Can you please check if your EJB are complying to 2.1specification?
    However the latest version of service has support for both EJB 2.1 and EJB 3.0 specification
    http://download.oracle.com/docs/cd/E14571_01/doc.1111/e15866/ejb.htm#CCGIFFCI
    Thanks
    Manoj

  • Manifest to ejb-client-jar ??

    Hi,
    I have an EAR with an EJB module. Into the EJBmodule.jar my Manifest.mf lists many jars in "Class-path:".
    In EJB1.1 it's deprecated (if I understood it well...), can I specify many jars in the ejb-jar.xml <ejb-client-jar> element?? (If yes, how to write them??)
    Example:
    -- Manifest
    Class-path: myjar1.jar myjar2.jar
    --> <ejb-client-jar>myjar1.jar myjar2.jar</ejb-client-jar> ?

    I realized that class-path has not to do with ejb-client-jar... but is this a kind of filter on the client view of beans (i.e. another jar with only stubs and interfaces?? this should be a deploy-tool yield..)?

  • Generate Ejb client Jar

    Hi,
    I m working with Jdeveloper 10G and oracle 9IAS 9.0.3.
    I ve deployed an Ejb module on 9IAS
    I m now wondering how generate the EJB client jar (Stubs and interfaces )to access my EJB module from anywhere.
    Any Idea?

    I found the answer.
    specify the client jar name in the jar settings and the workshop will generate the client jar for you.
    inlcude the client jar and the wlclient.jar in the remote client application.

  • Problems doing the "Web Service" example from the 2-Day-Developer Guide

    Hello,
    I want to do the "web service" example from the 2-Day-Developer Guide.
    I give the application my proxy server address in the format address:port and go through the assistant creating the web service. After selecting the IBM UDDI-service and searching for %xMethods% as business name I get the following error:
    ORA-31011: XML-Parsing not successful ORA-19202: Error parsing XML LPX-00104: Warning: Element "html" is not declared in DTD Error at line 2
    What have I done wrong?
    With kind regards
    Florian Reiser

    Please.. Could you change your forum handle to something more human, we are a friendly group here and lik to know who we are talking to.. Secondly, WHy are you using such an OLD version oft he product. You would be better off installing 3.2.1 (latest released build) and asking your questions after you do that..
    (I am sorry, it's like asking for help in a Windows support forum about issues you are having with Windows 3.1)
    Thank you,
    Tony Miller
    Webster, TX

  • Could not run the bookstore1 example from the Java Web Services Tutorial

    The bookstore1 servlets example from the Java Web Services Tutorial (issue Aug 1, 2002) was built and deployed successfully by using the deploytool (following the steps described on pages 498ff of the tutorial).
    After deploying the application the Tomcat Web Application Manager shows the entry:
    /bookstore1:stopped:0:D:\Programme\Java\tomcat\jakarta-tomcat-4.1.8\work\Standalone\localhost\manager\bookstore1.war
    when entering the command: http://localhost:8080/manager/list.
    After entering the command: http://localhost:8080/manager/start?path=/bookstore1, the (uncomplete) message appears:
    FAIL - Application at context path /bookstore1 could not
    It should be noted that I was able to build and deploy the application GSApp (chapter 3 of the tutorial) successfully.

    Did you set up the database as described in
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/WebApp13.html#69868

  • Trouble with examples from the website

    Hi
    I was trying to down load couple of examples from your website - Motor
    control, closed loop control system. But have trouble with it.
    I have Labview version 5.1 not 7.
    It gives an error after I unzip the file.
    Are they not compatible with 5.1??
    Pls help
    Krithika

    When you download an example from the NI homepage please always have a look at the "Software Requirements" section. Here you will find the version of the development environment the example was compiled with.
    Many examples are compiled with LV 6.x or LV 7.x thus it's probable that you can't open them with LV 5.x
    Best regards,
    Jochen Klier
    National Instruments Germany

  • Spanish language in applications installed from the core CD

    Hello,
    I don't know why but all the applications installed from the core CD (ex: vim, nano, xterm) are in spanish. How can I change the language of these applications?
    Thx

    I'm gonna guess you have your locales set wrong?
    http://wiki.archlinux.org/index.php/Configuring_locales

  • Problems with client.jar - generated from webservices toolkit from JDK 1.1.7

    We have deployed a web application using the webservices in WL 6.1 using JDK 1.3.1.
    The clients were able to successfully access the servlet it generated and download
    the client.jar. Unfortunately this client.jar seems to be dependent on JDK 1.2
    and beyond. It seems to use java.util.Map class in the JNDI-SOAP SPI.
    Is there any workaround or fix to this problem, so this jar can be used from a
    JDK 1.1.7 env?.
    Our objective is to use WL 6.1 EJB's from WL 4.5.1 using Webservices. Are there
    any known problems with this approach (Ofcourse other than this).
    Thank you.
    Dora Potluri
    Here is the stack trace from using the client.jar
    Class not found java.lang.ClassNotFoundException: java.util.Map
    [Root exception is java.lang.ClassNotFoundException: java.util.Map]javax.naming.
    NamingException: Class not found java.lang.ClassNotFoundException: java.util.Map
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.naming.NamingException.<init>(Compiled Code)
    at weblogic.soap.http.SoapContext.throwNamingException(Compiled Code)
    at weblogic.soap.http.SoapContext.lookup(Compiled Code)
    at javax.naming.InitialContext.lookup(Compiled Code)
    at weatherEJB.WeatherBean.getTemp(Compiled Code)
    at weatherEJB.WeatherBeanEOImpl.getTemp(Compiled Code)
    at weatherEJB.WeatherBeanEOImpl_WLSkel.invoke(Compiled Code)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(Compiled Code
    at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(Compiled
    Co
    de)
    at weblogic.rmi.extensions.BasicRequestDispatcher$BasicExecuteRequest.ex
    ecute(Compiled Code)
    at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
    Fri Sep 21 10:47:12 CDT 2001:<I> <EJB> Transaction: '1001087185816_1' rolled bac
    k due to EJB exception:

    Yes, there is an expectation that the client jar will be run on JDK 1.3x. WLS 6.1 is certified on JDK 1.3x only. This
    applies to the WebServices client as well. For details on platform support see
    http://e-docs.bea.com/wls/platforms/index.html
    Thanks,
    Jim
    Jim Rivera
    Product Manager, WebLogic Server
    BEA Systems, Inc.
    Dora Potluri wrote:
    I started testing using the client.jar generated by webservices WL 6.1 and found
    that it uses reflection API interfaces that are not available til JDK 1.3. Is
    there an expectation that the clients of Webservices are all going to be JDK 1.3.X.
    Here is the stack trace we get.
    java.lang.NoClassDefFoundError: java/lang/reflect/InvocationHandler
    at weblogic.soap.http.SoapContext.lookup(SoapContext.java:76)
    at javax.naming.InitialContext.lookup(InitialContext.java:280)
    at weatherEJB.WeatherBean.getTemp(WeatherBean.java:106)
    at weatherEJB.WeatherBeanEOImpl.getTemp(WeatherBeanEOImpl.java:47)
    at weatherEJB.WeatherBeanEOImpl_WLSkel.invoke(WeatherBeanEOImpl_WLSkel.java:90)
    at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java:261)
    at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:56)
    at weblogic.rmi.extensions.BasicRequestDispatcher$BasicExecuteRequest.execute(BasicRequestDispatcher.java:166)
    at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)

  • Generating EJB Client jars

    Hi,
    i want to know wheather there is any way to generate client jars for any specified ejb's in oracle 10g. In weblogic using appc generates a client jar that contains all required classes for the ejb's including the Stub implementation classes.
    I need the client jar's in order to make it available to a war file which does a lookup of these beans.
    Any ant taks that oracle provides for this??

    You need to deploy the class files specific to your client as well as the generated stubs for the EJB.

  • How do you configure a client to update from the server

    I found the information on how to point clients to a software update server but the problem I have is the URL.
    The example is http://su.example.com:8088/index.sucatalog
    I don't have a URL as far as I know and if I did, is the default port 8088 or where can I change or check that?
    And where is a list of the catalog file for the specific versions of OS X?
    Basically I have 8 Macs all running Yosemite except for one running 10.8.5. Instead of all the machines hitting the internet for updates, I'd like just my server to down the updates and then all clients update from the server.
    If there is better instructions on how to do this, please point the way.
    TIA
    Chris

    John Lockwood wrote:
    This does mean you need to buy a DNS load balancer to do this. The Mac itself cannot.
    FWIW, OS X Server is capable of performing round-robin access with the inbound traffic using multiple IP addresses for a single host name.  The addresses are each of the software update servers in your server pool.
    This'll toss errors for some translations when one of the servers is down — you can tweak the definition if one of the servers is going to be offline for a while — but some of the updates will get through.
    Set the DNS TTL fairly short — probably somewhere between a few minutes and an hour — to allow the DNS translations to be changed fairly quickly, if your software update servers are prone to outages.

Maybe you are looking for