EJB Client classes

Hi All,
I wrote a simple EJB which just replies "Hello,World" string to the client when the method is called. The client creates an initial context and then obtains the home , then creates remote object and then queries the session bean. All is well here.
When I try to execute the client without having the EJB remote interface and the home interface in it's class path, it doesn't execute. I believe these required classes should be downloaded from the application server as and when required, right? Or is it mandatory that I should include these class files in the client classpath as well?
Any light on this would be greatly appreciated.
Thanks,
Kalyan.

Danny,
For a class to resolve another class it's using (in fact, it should be "for a class loader to resolve a class"), it need not use just CLASSPATH. Classpath is a concept of the boostrap classloader, app classloader, etc. which only looks up classes in the classpath. Something like URLClassloader can lookup classes anywhere, provided you give the appropriate URL.
So, I can potentially set the context class loader to be the URLClassLoader with the appropriate URL and then load the classes from that URL and get my app working, even when the classpath doesn't have these classes.
Thanks,
Kalyan.

Similar Messages

  • EJB Client class could not run......very urgent

    Hi
    My classpath is as follows.
    C:\Program Files\Altova\xmlspy\XMLSpyInterface.jar;
    C:\Sun\j2eesdk1.4_beta2\lib\j2ee.jar;
    C:\DSTA\session\Sisters\temp\SampleObject.jar;
    C:\bea\weblogic81\server\lib\weblogic.jar;
    C:\DSTA\session\Sisters\temp\StatelessEJB.jar;
    C:\DSTA\session\drools\drools-2.0-beta-11\examples\drools2.jar;
    I am getting ClassDefNotFoundError as follows.
    C:\DSTA\session\Sisters\Sisters\sisters\ejb>java sisterclient
    Exception in thread "main" java.lang.NoClassDefFoundError: sisterclient (wrong
    n
    ame: sisters/ejb/sisterclient)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ===================
    If you need further info. please see my previous mail.
    Thanks
    Murali

    Murali,
    Run the client class with the fully qualified class name.
    java sisters.ejb.sisterclientthanks,
    Deepak
    "murali" <[email protected]> wrote:
    >
    Hi Gurus
    I am trying to run a weblogic application EJB application. I
    could deploy
    the application
    in weblogic 8.1 successfully. But I am getting the following error. I
    have the
    following jars
    in my CLASSPATH .
    1. weblogic.jar 2. j2ee.jar 3. my ejb jar file called StatelessEJB.jar
    Further I had set JAVA_HOME, JDK_HOME etc . My jdk is jdk_141_02 .
    My ejb-jar.xml and weblogic-ejb-jar.xml are deployed in META-INF directory.
    Is it necessary I should populate an application.xml file in the META-INF
    directory.
    Please help me. I had tried my best but all failing.
    In additon to that I had added a jar called wl_client.jar file in CLASS-PATH
    too, but my problem
    still exists. Please provide me a workable solution ASAP. I am struggling
    a lot.
    Thanks in advance
    Murali
    ========================== ERROR MESSAGE =========
    C:\DSTA\session\Sisters\Sisters\sisters\ejb>java sisterclient
    Exception in thread "main" java.lang.NoClassDefFoundError: sisterclient
    (wrong
    n
    ame: sisters/ejb/sisterclient)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ======================================

  • 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

  • How to create EJB client without WL specific classes ?

    Hi,
    I have stateful session EJB running in WebLogic 5.1.
    Is it necessary to client that will access that EJB to have WebLogic classes in classpath ?
    Is it possible to write client that doesn't have any classes specific to Weblogic ?
    Uix

    Sure, if it's acceptable for your application to classload from WebLogic.
    For example: helper class to start WebLogic client (server is running on
    localhost:7001 and client classes are in c:/weblogic/myserver/clientclasses/):
    c:\WebLogicClient>set CLASSPATH=.
    c:\WebLogicClient>java WebLogicClient examples.ejb.basic.statelessSession.Client
    import java.net.*;
    import java.lang.reflect.*;
    public class WebLogicClient {
    /* client classpath. Should NOT be in the java classpath! */
    public static final String CLIENT_CLASSES =
         "file://C:/weblogic/myserver/clientclasses/";
    /* WebLogic server to classload from */
    public static final String WL_CLASSES =
         "http://localhost:7001/classes/";
    public static void main(String[] args) {
    try {
    ClassLoader cl = new URLClassLoader(new URL[] {
    new URL(CLIENT_CLASSES),
    new URL(WL_CLASSES)
    Thread.currentThread().setContextClassLoader(cl);
    Class clientClass = cl.loadClass(args[0]);
    Method methodMain = clientClass.getMethod("main",
              new Class[] {Class.forName("[Ljava.lang.String;")});
    String[] clientArgs = new String[args.length - 1];
    System.arraycopy(args, 1, clientArgs, 0, clientArgs.length);
    methodMain.invoke(null, new Object[] {clientArgs});
    } catch(Throwable oops) {
    oops.printStackTrace();
    uix <[email protected]> wrote:
    Hi,
    I have stateful session EJB running in WebLogic 5.1.
    Is it necessary to client that will access that EJB to have WebLogic classes in classpath ?
    Is it possible to write client that doesn't have any classes specific to Weblogic ?
    Uix--
    Dimitri

  • How can Client get a ejb remoteinterface class through ejbhomeinterface?

    HI,I've got ejbhomeinterface class(ejbhomeinterface class is on my local machine),How can i get ejb remoteinterface class(it is on remote app server) ? I've tried
    getEJBMetaData() method, but throw class not found exception,pls help me,thank you very much!!
    Object ejbObj = null;
    Class remoteClass = null;
    EJBHome aHome = null;
    try{
    aHome = (EJBHome) javax.rmi.PortableRemoteObject.narrow(aHome, EJBHome.class);
    EJBMetaData metaData = aHome.getEJBMetaData();
    // Class homeClass = metaData.getHomeInterfaceClass();
    aHome = metaData.getEJBHome();
    remoteClass = metaData.getRemoteInterfaceClass();
    //following code i want use remoteClass invoke remote ejb mothod
    }catch(Exception e)

    may be you need create InitialContext first, than from InitialContext lookup Home interface. And than using home.create() get RemoteInterface and use it.

  • How can I run EJB Client in other computer ?

    Hello,
    I'm trying to run converter examples.
    if ejb client pgm resides on a same machine with j2ee server , it works fine.
    But when I put client pgm on a different maching
    below message show.
    No application client descriptors defined for: ConverterClinet
    I put ConverterApp.ear, ConverterAppClient.jar and ConverterClient.class on the machine and
    set APPCPATH=ConverterAppClient.jar
    set VMARGS=-Dorg.omg.CORBA.ORBInitialHost=xxx.xxx.xx.xx
    What should I do to run ejb client on different machine?

    Hi SangHPark,
    I had the same problem but have solved it and it works.
    I ran the client remotely from a win98 box.
    Keep two things in mind
    1> Deploy the applications to an ip address and not to the local host using the deploy too. Use the deploy tool Gui to add a new server and then deploy the application to this ip address.
    2> I am running j2ee version 1.3 and jsdk 1.3
    Use the following code but instead of using "java:comp/env/ejb/SimpleConverter" use the jndi name of the object: "MyConverter" as specified in the tutorial.
    Properties prop = new Properties();
    prop.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
    prop.setProperty(Context.PROVIDER_URL,"IIOP://xxx.xx.x.xxx:1050");
    System.out.println("Attempting to create context...");
    Context initial = new InitialContext(prop);
    // Instead of this use the below line of code
    //Object objref = initial.lookup("java:comp/env/ejb/SimpleConverter");
    Object objref = initial.lookup("MyConverter");
    // MyConverter is the Jndi name of the ConverterBean as per the tutorial
    You need to do the following things.
    1> After making changes to the code recompile using Ant and redeploy it.
    2> Copy the j2ee.jar, ConverterAppClient.jar and ConverterClient.class file to the machine that u want to run the client from.
    3> create a directory called "config" on the remote machine where you copied the files in step two.
    4> Copy to this directory the files ejb.properties and security.properties from your j2ee_home\config\ directory.
    For example you copied the files in step 2 on the remote machine in the c:\test directory. Create c:\test\config directory and copy the files from step 4 into this directory.
    5> Run the following command from the directory where u copied the client files
    java -Dorg.omg.CORBA.ORBInitialHost="host name" -classpath .\j2ee.jar;.;.\ConverterAppClient.jar ConverterClient
    Monal

  • EJB Client Access From JDeveloper9iR2

    I seem to be running into a lot of problems when trying to get a simple EJB client to talk to an EJB on our 9IAS platform. I have developed a simple session bean (just to test) which simply returns a string. When I create the default client code this works fine using the embedded OC4J server in Jdeveloper but I can't run a similar client against 9IAS when I deploy the code. When I go through the client wizard it seems to produce the same code as the standalone EJB OC4J client. I simply changed the name of the server (Context.PROVIDER_URL, "ormi://pe2500/). This is the parameter code I use:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "ormi://pe2500:23891/MyEJBs");
    This is the output I receive:
    D:\jdeveloper9ir2\jdk\bin\javaw.exe -ojvm -classpath D:\javadev\ejbservlet\ejbservlet\WEB-INF\classes;D:\jdeveloper9ir2\jdev\lib\jdev-rt.jar;D:\jdeveloper9ir2\j2ee\home\lib\ojsp.jar;D:\jdeveloper9ir2\j2ee\home\jsp\lib\taglib\ojsputil.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\j2ee\home\lib\servlet.jar;D:\jdeveloper9ir2\jdev\lib\ojc.jar;D:\jdeveloper9ir2\j2ee\home\lib\activation.jar;D:\jdeveloper9ir2\j2ee\home\lib\ejb.jar;D:\jdeveloper9ir2\j2ee\home\lib\jaas.jar;D:\jdeveloper9ir2\j2ee\home\lib\jaxp.jar;D:\jdeveloper9ir2\j2ee\home\lib\jcert.jar;D:\jdeveloper9ir2\j2ee\home\lib\jdbc.jar;D:\jdeveloper9ir2\j2ee\home\lib\jms.jar;D:\jdeveloper9ir2\j2ee\home\lib\jndi.jar;D:\jdeveloper9ir2\j2ee\home\lib\jnet.jar;D:\jdeveloper9ir2\j2ee\home\lib\jsse.jar;D:\jdeveloper9ir2\j2ee\home\lib\jta.jar;D:\jdeveloper9ir2\j2ee\home\lib\mail.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\lib\xmlparserv2.jar;D:\jdeveloper9ir2\lib\xmlcomp.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\j2ee\home\lib\servlet.jar Samplemypackage6.ctejb1Client3
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
         java.net.ConnectException: Connection refused: connect
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:350
         void Samplemypackage6.ctejb1Client3.main(java.lang.String[])
              ctejb1Client3.java:18
    Process exited with exit code 0.
    Can anyone tell me if this is the correct communication method for client EJB's talking to the 9IAS server?
    Any help really appreciated.
    Chris Taylor

    hi Chris Taylor, did you find the solution for this error. i too get this error and i am looking for the answer. if you find any answer please share with me too. if i get any answer for this i will reply you too.

  • EJB Client giving error

    Hi All,
    I am new to EJB programming. I am trying to use EJB3 and Weblogic12c.
    and would like to know why I am getting this error:
    run:
    [echo] Executing client class
    [java] java.lang.NoClassDefFoundError: com/saurabh/demo/HelloWorldClient
    [java] Caused by: java.lang.ClassNotFoundException: com.saurabh.demo.HelloW
    orldClient
    [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    [java] at java.security.AccessController.doPrivileged(Native Method)
    [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    [java] Could not find the main class: com.saurabh.demo.HelloWorldClient. P
    rogram will exit.
    [java] Exception in thread "main"
    [java] Java Result: 1
    I am posting my code so that its more easy to debug...
    1. HelloWorld.java -
    package com.saurabh.demo;
    import javax.ejb.Remote;
    @Remote
    public interface HelloWorld
         public void sayHello(String name);
    2. HelloWorldBean.java
    package com.saurabh.demo;
    import javax.ejb.Stateless;
    @Stateless(mappedName="HelloWorld")
    public class HelloWorldBean implements HelloWorld
         public void sayHello(String name)
              System.out.println("Hello "+name+ " Its Working");
    3.
    package com.saurabh.demo;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    public class HelloWorldClient{
         private static HelloWorld helloworld;
         public static void main(String[] args)
         try{
              Hashtable<String, String> env = new Hashtable<String,String>();
              env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
              env.put(Context.SECURITY_PRINCIPAL,"username of my weblogic");
              env.put(Context.SECURITY_CREDENTIALS,"password of my weblogic");
              env.put(Context.PROVIDER_URL,"t3://localhost:7001");
              Context ctx=new InitialContext(env);
              System.out.println("Initial Context created");
              helloworld =(HelloWorld)ctx.lookup("HelloWorld#com.saurabh.demo.HelloWorld");
              System.out.println("lookup Successful");
              System.out.println("Calling EJB method...");
              helloworld.sayHello("Saurabh");
              System.out.println("Output will be in Managed Server Console");
         catch(Exception e)
              e.printStackTrace();
    4. build.xml
    <?xml version="1.0" encoding="iso-8859-1"?>
    <project name="Ejb_HelloWorld" basedir="." default="buildEar">
    <property file="${basedir}/developer.properties"/>
    <property name="jarname" value="HelloWorld-ejb"/>
    <property name="appname" value="HelloWorld"/>
    <property name="src" value="${basedir}/src"/>
    <property name="build" value="${basedir}/build"/>
    <property name="dist" value="${basedir}/dist"/>
    <property name="lib" value="${basedir}/lib"/>
    <property name="src.server" value="${src}/server"/>
    <property name="src.client" value="${src}/client"/>
    <property name="build.server" value="${build}/server"/>
    <property name="build.client" value="${build}/client"/>
    <property name="dist.server" value="${dist}/server"/>
    <property name="dist.client" value="${dist}/client"/>
    <path id="dependencies">
         <pathelement location="${lib}/javax.ejb_3.1.0.jar"/>
         <pathelement location="${lib}/weblogic.jar"/>
    </path>
    <target name="clean">
         <echo>"Cleaning the directories"</echo>
         <delete dir="${build}"/>
         <delete dir="${dist}"/>
    </target>
    <target name="compile" depends="clean">
         <echo>"Compiling EJB"</echo>
         <echo message="BEA_HOME:${BEA_HOME}"/>
         <echo message="WLS_HOME:${WLS_HOME}"/>
         <mkdir dir="${build}/server/classes"/>
         <echo message="Source directory : ${src.server}"/>
         <javac includeantruntime="false" srcdir="${src.server}" destdir="${build.server}/classes" debug="on">
         <classpath refid="dependencies"/>
         </javac>
    </target>
    <target name="compileClient">
         <echo>"Compiling Client class"</echo>
         <mkdir dir="${build.client}/classes"/>
         <javac includeantruntime="false" srcdir="${src.client}" destdir="${build.client}/classes" debug="on">
         <classpath refid="dependencies"/>
         <classpath location="${build.server}/classes"/>
         </javac>
    </target>
    <target name="buildEar" depends="compile">
         <echo>"Building EJB EAR"</echo>
         <mkdir dir="${dist.server}"/>
         <jar jarfile="${dist.server}/${jarname}.jar" basedir="${build}/server/classes"/>
         <jar jarfile="${dist.server}/${appname}.ear" basedir="${dist.server}"/>
    </target>
    <target name="run" depends="compileClient">
         <echo message="Executing client class"></echo>
         <java classname="com.saurabh.demo.HelloWorldClient" fork="yes">
         <classpath>
         <pathelement location="{build.client}/classes"/>
         <pathelement location="{dist.server}/HelloWorld-ejb.jar"/>
         <pathelement location="{lib}/wlfullclient.jar"/>
         </classpath>
         </java>
    </target>
    </project>
    5. developer.properties- This property file is being used to set the needed paths.
    BEA_HOME=C:\SG_Installs\wls1211_dev
    JAVA_HOME=C:\SG_Installs\Java
    WLS_HOME=C:\SG_Installs\wls1211_dev\wlserver
    project.home=C:\Saurabh Data\WebDev\EJB-HelloWorld
    wls.domain.path=C:\SG_Installs\BEA_Domain\BEA_Domain
    wls.application.path=C:\SG_Installs\BEA_Domain\BEA_Domain\applications
    There is no deployment descriptors since there is no need for that in EJB3 as I know.
    I have been trying to resolve this issue but with no luck... Please help....
    Edited by: 919201 on Mar 6, 2012 4:31 PM
    Edited by: 919201 on Mar 6, 2012 5:54 PM
    Edited by: Passionate on Mar 8, 2012 9:35 PM

    java.lang.NoClassDefFoundError: com/saurabh/demo/HelloWorldClient
    +[java] Caused by: java.lang.ClassNotFoundException: com.saurabh.demo.HelloW+
    orldClient
    Does {build.client}/classes include the com/saurabh/demo/HelloWorldClient class?

  • EJB client needs both source and generated jars?

    From within JDeveloper, I created a basic EJB with a default package called EJBHello. Here is my directory structure after building and deploying this EJB:
    h:\EJBHello\EJBHello\EJBHome.java, etc.
    h:\EJBHello\EJBsource.jar
    h:\EJBHello\EJBgenerated.jar
    h:\EJBHello\EJBClient.java
    With only EJBgenerated.jar in the classpath, the client ran fine in this environment. However, when I renamed h:\EJBHome\EJBHome to h:\EJBHome\temp, the client would no longer run - java said it could not find EJBHello\EJBHome.class. I then added EJBsource.jar to the classpath, and the client would once again run. Does this mean that, in general, I must ship both the source and generated jars with the client classes?

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

  • Changing a method in an EJB object without recompiling EJB-Clients

    Hi!
    I have 4 Web (JSP) applications using the same EJBs., deployed to a BEA Weblogic application server.I want to know if there is a way to change the code in a method in one of my EJB objects (no interface change) without recompiling and redeploying my EJB-clients and Web apps.
    Regards,
    Per - Chr.

    Hello,
    I have 4 Web (JSP) applications using the same EJBs.,
    deployed to a BEA Weblogic application server.I want
    to know if there is a way to change the code in a
    method in one of my EJB objects (no interface change)
    without recompiling and redeploying my EJB-clients and
    Web apps.You can change the EJB's without recompiling the clients as long as the interfaces and the classes used by both the EJB's and clients are not changed.
    For example, if you don't change the interfaces but change the exception implementation thrown by a method of the bean, then you have to recompile the clients with the new version of the exception class.
    Kexkey

  • 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

  • Problems by creating EJB Client

    Hello,
    I tried to create a EJB Client for OC4J in IDE Eclipse.
    but I got the exception
    javax.naming.NoInitialContextException: Cannot instantiate class: com.evermind.server.rmi.RMIInitialContextFactory. Root exception is java.lang.ClassNotFoundException: com.evermind.server.rmi.RMIInitialContextFactory
    I don't know which classes or packages or jars i need to get my application started. I tried to find class
    com.evermind.server.rmi.RMIInitialContextFactory
    manually but I didn't find it.
    Best regards
    George

    Hi,
    you will find the class in ${ora9ias_install}/j2ee/home/oc4jclient.jar
    Greetings,
    Frank

  • URGENT : ejb client in Oracle 8

    We developed a EJB client. This client should be called from an Oracle Database 8.1 (ejb compliant). But, each time we tried to load weblogic.jar, we have several errors into Oracle (ie : ORA-29534 NamingContext could not be resolved)
    Do you have an idea why ? Someone already developed an ejb client into Oracle 8.1 ?

    They are reccomended because the next step going from your simple single EJB
    to anything interesting, like adding more EJB's adding web-apps, adding
    web-services etc etc involves ears. If the setup and overhead for an EAR is
    easy, then just start there.
    But no if you just doing helloworld you of course dont have to ears.
    cheers
    mbg
    "Christopher R. Gardner" <[email protected]> wrote in message
    news:3fc0560e$[email protected]..
    >
    "Mark Griffith" <[email protected]> wrote:
    You can still run ejbc from the command line its still there. And you
    can
    still run weblogic.Deployer. (I dont ever reccomend jaring up in dev,
    it
    just takes longer, do exploded its easier and faster).
    But ear's are easy, see:So ears are recommended even if you're just doing EJBs (e.g., a simpleHello World)
    and no web apps (none needed for the Hello World or a PC client)?
    http://www.niffgurd.com/mark/work/blog/
    Cheers
    mbg
    "Christopher R. Gardner" <[email protected]> wrote in message
    news:3fbfd6c6$[email protected]..
    My understanding is ejbc has been deprecated and replaced with appc.Moreover,
    BEA is encourgaging developers to deploy ear files. All I want todo is
    to use
    ant to deploy a jar file with a single EJB in it. I'm not findingthe WL
    documentation
    very helpful. Hopefully, you'll have better luck than I.
    "skmurali" <[email protected]> wrote:
    Hi
    In order deploy EJB application in Weblogic 8.1, is it necessary
    to compile
    the application in WebLogic.ejbc. I did not find such files in
    WebLogic
    8.1
    In weblogic 7.0 versiion has such files.
    The present procedure is as follows.
    1. Create a jar file contains all class files.
    2. Create a jar file contains class jar files, plus .xml files
    3. Deploy into weblogic 8.1 server EJB Deployment utility.
    ==================
    Please help me.
    Murali

  • 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.

  • ClassCastException exception while running EJB Client

    Folks,
    I am getting following exception while running the EJB Client.. I am
    using WLS 5.1
    Exception in thread "main" java.lang.ClassCastException
    at
    javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:319)
    at FirstStatelessEJBClient.Client.lookupHome(Client.java:149)
    at FirstStatelessEJBClient.Client.<init>(Client.java:44)
    at FirstStatelessEJBClient.Client.main(Client.java:82)
    Can anybody throw a light on this.
    Thanks
    Ashish

    Hi Eduardo,
    Below is my classpath. The stubs are in first_statlessSession.jar file.
    CLASSPATH=C:\weblogic\myserver\first_statelessSession.jar;
    C:\jdk1.2.2\lib\tools.jar;C:\weblogic\license;C:\weblogic\classes;C:\weblogi
    c\lib\weblogicaux.jar;
    C:\weblogic\myserver\clientclasses;C:\weblogic\myserver\serverclasses
    Also, I am just compiling and deploying the
    C:\weblogic\examples\ejb\basic\statelessSession myself and testing it. I
    am
    using the build.cmd files to compile and deploy the above EJB. If I use the
    jars provided by weblogic it works fine with same above classpath.
    I don't know what to do next. I have invested the whole day to solve this
    problem and couldn't.
    Please let me know if I am doing anything wrong.
    Appreciate your help.
    Thanks,
    Ashish
    Eduardo Ceballos wrote:
    Try putting the stubs into the client class path.
    "Ashish N. Shah" wrote:
    Folks,
    I am getting following exception while running the EJB Client.. I am
    using WLS 5.1
    Exception in thread "main" java.lang.ClassCastException
    at
    javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:319)
    at FirstStatelessEJBClient.Client.lookupHome(Client.java:149)
    at FirstStatelessEJBClient.Client.<init>(Client.java:44)
    at FirstStatelessEJBClient.Client.main(Client.java:82)
    Can anybody throw a light on this.
    Thanks
    Ashish

Maybe you are looking for