How to run a client in j2ee

Hi Guys,
I have successfully created a bean and deployed it in J2EE server. My next step according to the head first ejb is to create a client. I compiled AdviceClient successfully (Thanks to grava). However when I try to run the compiled class I get the following error:
C:\projects\advice>java AdviceClient
javax.naming.CommunicationException: Can't find SerialContextProvider
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.jav
a:63)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at AdviceClient.go(AdviceClient.java:16)
at AdviceClient.main(AdviceClient.java:10)
Could you please tell me what is going on?
The following is the class ActiveClient:
import javax.naming.*;
import java.rmi.*;
import headfirst.*;
import javax.rmi.*;
import javax.ejb.*;
public class AdviceClient{
public static void main (String[] args){
new AdviceClient().go();
public void go(){
try{
Context ic=new InitialContext();
Object o=ic.lookup("Advisor");
AdviceHome home=(AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
Advice advisor=home.create();
System.out.println(advisor.getAdvice());
}catch (Exception ex){
ex.printStackTrace();
Kind regards,
Al

Hi,
When running client, in my previous attempts, the j2ee server was not running. However when I run the server the following error messages appear:
C:\projects\advice>java AdviceClient
javax.naming.CommunicationException: java.rmi.MarshalException: CORBA MARSHAL 13
98079699 Maybe; nested exception is:
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Custom marshaling of RMI:java.lang.Throwable:F8678B4F4D2EB705 5C635273977B8CB not
compatible with local class (local class not custom marshal capable) minor code
: 1398079699 completed: Maybe
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Custom mars
haling of RMI:java.lang.Throwable:F8678B4F4D2EB705 5C635273977B8CB not compatible with local class (local class not custom marshal capable) minor code: 139807
9699 completed: Maybe
at com.sun.corba.ee.internal.iiop.CDRInputStream_1_0.read_value(CDRInput
Stream_1_0.java:1083)
at com.sun.corba.ee.internal.iiop.CDRInputStream.read_value(CDRInputStre
am.java:296)
at org.omg.stub.com.sun.enterprise.naming._SerialContextProvider_Stub.lo
okup(Unknown Source)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at AdviceClient.go(AdviceClient.java:16)
at AdviceClient.main(AdviceClient.java:10)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:138
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at AdviceClient.go(AdviceClient.java:16)
at AdviceClient.main(AdviceClient.java:10)
I appreciate any attempts to solve this problem.
Kind regards,
Al

Similar Messages

  • How to run ejb application OC4J J2EE Container

    Hi all,
    I unable run ejb applications in OC4J J2EE Container.
    I have configure following files.
    in config directory
    Server.xml
    I have .ear file if configured in server.xml. this .ear copied into home/application directory
    I have create following deployment discriptor file.
    in META-INF for ejb.
    ejb-jar.xml
    application.xml
    I have specify all ejb classes details in ejb-jar.xml
    Please help me .How to run ejbs with jsp and application client.Which files shall i configure.
    Thnaks,

    Hi all,
    I unable run ejb applications in OC4J J2EE Container.
    I have configure following files.
    in config directory
    Server.xml
    I have .ear file if configured in server.xml. this .ear copied into home/application directory
    I have create following deployment discriptor file.
    in META-INF for ejb.
    ejb-jar.xml
    application.xml
    I have specify all ejb classes details in ejb-jar.xml
    Please help me .How to run ejbs with jsp and application client.Which files shall i configure.
    Thnaks,

  • How to run the client program in weblogic 8.1 server

    Hi
    I am new to EJB 2.0. I am deployed sucessfully a session ejb program.
    While running an ejb client program it throws an exception. In my session ejb program i created two jar file. one is sessionejb.jar and another one is sessionejbclient.jar. In sessionejb.jar contains home ,remote ,session bean class and deployment descriptor.In sessionejbclient.jar contains home,remote and client program. Both jar files are included in class path of environment variable( i am using Standalone server).
    Plese guide me how to run an session ejb client correctly.
    Regards
    Jaiganesh

    Both jar files are
    included in class path of environment variable( i am
    using Standalone server).did u include both these jars in the "weblogic's class path" ?
    in that case, it obviously wont work.
    what u need is an understanding of the following topics (i have described them briefly, but for details u can always check the documentation of weblogic):
    1. Class loaders in weblogic: there are various levels of class loaders. at the top is the weblogic's class loader. below it are various EARs' class-loaders. and so on....
    2. Packaging. You must ensure that in the same class loader, there are not two classes from 2 different jars.
    hope that helps

  • How to run application client of an EJB application?

    Hi,
    My EJB application is deployed on websphere. I have written a small java client program to interact with an EJB which is working fine if I compile and run it in websphere studio environment.
    However I am getting runtime exception when I tried to run it at command line.
    RemoteConn.java
    import java.util.Hashtable;
    import com.deque.HelloJavaHome;
    import com.deque.HelloJava;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.ejb.EJBHome;
    import javax.ejb.EJBObject;
    public class RemoteConn {
    public static void main(String[] ar) throws Exception{
    String name="Paruchuri!!";
    String greeting = "";
    try{
    Hashtable env = new Hashtable();
    //env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ws.naming.util.WsnInitCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://localhost:2809");
    InitialContext initContext = new InitialContext(env);
    Object obj = initContext.lookup("ejb/HelloJavaHome");
    HelloJavaHome home = (HelloJavaHome) javax.rmi.PortableRemoteObject.narrow(obj, HelloJavaHome.class);
    HelloJava remote = home.create();
    greeting = remote.getGreeting(name);
    catch(Exception e){
    e.printStackTrace();
    System.out.println("Greeting::"+ greeting);
    I have set the application ejb client jar in the class path of client program.
    The exception I am getting at runtime is
    Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.CORBA.iiop.GlobalORBFactory
    at com.ibm.ejs.oa.EJSORBImpl.class$(EJSORBImpl.java:44)
    at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:195)
    at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:93)
    at com.ibm.ejs.oa.EJSClientORBImpl.(EJSClientORBImpl.java:65)
    at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:385)
    at com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:284)
    at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:369)
    at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:112)
    at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:422)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:143)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at RemoteConn.main(RemoteConn.java:38)
    Initially I thought I shuold set some jar file of websphere in the classpath of client. But I did not find such a jar containing the above class in websphere studio.
    Basically the error is generated at the below statement at runtime.
    Object obj = initContext.lookup("ejb/HelloJavaHome");
    The only difference I discovered was that the client application has a descriptor file (application-client.xml ) available to it when it ran in websphere studio,. I guess the same META-INF should be provided to client when it runs at command line.
    Right now I am not using any client descriptor file to run the client program. If the above error is due to not supplying META-INF to the client application, how should I make this folder available to client at runtime?
    I greatly appreciate if I could get help ASAP.
    Thanks

    Hey got what is going on. In order to invoke EJB, deployed on WebSpehre App Server, from application client we need to install either WebSphere Application Pluggable Client or WebSphere Thin client on the workstation. Pluggable client is a wrapper to SUN JRE where as Thin Client uses IBM JRE.

  • How to run a client?

    A want a client progrma to connect to the server by pressing a button.
    But the method to run a client is by typing:
    "java HelloClient"
    before run the program.
    How can I call the client connection when I already run the program(an applet)?
    Thanks~~

    There are two concepts of being a client, the first one is to be a "storage disabled node" in the cluster which means that you are a full member of the cluster but no data is stored on your node.
    To disable storage on a node, pass the following attribute on the java command line:
    -Dtangosol.coherence.distributed.localstorage=falseThe second concept of a client is to use Coherence*Extend to connect to a cluster over TCP.
    More details on [how to configure Coherence*Extend over here|http://wiki.tangosol.com/display/COH35UG/Configuring+and+Using+Coherence+Extend]

  • How to run a client program in Session bean using weblogic 8.1

    Hi
    I am new to weblogic server 8.1. I sucessfully deployed session ejb Session Bean. I created sessionbean jar file and put it it classpath also.
    and also i created sessiobeanclient jar file, it included in class path.
    While running client program it throws exception like noclass def found exception
    plz tell me the right way to run the session ejb program.
    bye

    Hi,
    You have to follow the given steps before you are going to run the client program that invokes the session bean .
    1)set the Weblogic Environment using the tool setWLSEnv
    2)place the Session bean jar file in classpath
    3)run the client program
    Note:If the client has to execute on remote machine we need to copy client class,remote interface, home interface and other classes which are used as
    parameters and return types.
    Regards
    Anilkumar kari

  • How to run ejb client on a separate host using Oracle example

    The example I used was under $ORACLE_HOME/javavm/demo/examples/ejb/basic/jdbcimpl
    If I used the Makefile provided to run the client and server, it worked ok. Now I tried to move the client to an NT machine and it did not work. (BTW, the server was on a Linux machine.)
    What I did was to copy the compiled class and jar files to NT (Client.class, employee/*.class aurora_client.jar, vbjapp.jar, and vbjorb.jar). After I ran it, I got an error in javax.naming.InitialContext.lookup.
    I compiled and ran the code using jdk1.1.8. If I recompiled the code on NT using jdk1.3, I got a CORBA.OBJECT_NOT_EXIST error.
    Any clue?

    Copy the following files to the CT's machines. Copy the server_generated.jar also to the CT's machine. In your case the file will be there in the $ORACLE_HOME/javavm/demo/examples/ejb/basic/jdbcimpl directory.
    C:\ORA816\lib\aurora_client.jar;
    C:\ORA816\jdbc\lib\classes111.zip; // Replace this with classes12.zip if you are using JDK 1.2.2
    C:\ORA816\sqlj\lib\translator.zip; // If you are using SQLJ in the CT's code
    C:\ORA816\lib\vbjorb.jar;
    C:\ORA816\lib\vbjapp.jar;
    server_generated.jar
    Set you classpath to include the all the above files.
    Oracle 8.1.6 can work with JDK 1.2.2 and JDK 1.1.8. Please try with the JDK 1.2.2 and let us know the results.
    null

  • How to run a Client in a Jsp

    I would like to run Client.java thanks to a JSP
    i have got a .jar that i put in WEB-INF/lib
    but that the class Client is not found

    try putting your application's web-inf/lib directory in your classpath. this is typical in development environments. you wouldn't have to do it for production.
    hope this helps.
    cem.

  • How to run different client ?

    Hi,
    I have downloaded and installed Oracle8i Enterprise edition Release 8.1.7.0.0.
    Now I have to connect to the above server either using Oracle client version 8.1.6.3.1 or 8.1.6.2. My question is -
    - is it possible to download the above version Oracle
    Client ?
    - how can I connect from above such client to the above
    server ?
    Please let me know.
    Thanks,
    Harish

    I don't know of any site where you can still download the 8.1.6 Oracle client or database. Oracle Support may know of an FTP site for desupported products.
    In general, connecting from any version of the Oracle client to an Oracle server is pretty much the same.
    - You want to create a new TNS name on your client machine. This is most easily accomplished by using the Net Config Assistant (the name changes slightly between releases)
    - You then connect (assuming SQL*Plus) as
    connect user/password@tnsname
    Justin

  • How to run the client from server

    HI FRIENDS,
    I HAVE A SMALL PROBLEM WITH MY PROGRAM.I WANTED TO START THE CLIENT FROM SERVER I.E THE CLIENT SHOULD BE EXECUTED AS SOON AS THE SERVER STARTS EXECUTION.SOME OF THEM SAID THAT THIS CAN BE DONE BY USING 'EXEC' COMMAND.BUT I COULDNT.SO PLEASE ANYONE HELP ME IN DOING THIS.
    BYE
    KP

    HI FRIENDS,
    I HAVE A SMALL PROBLEM WITH MY
    MALL PROBLEM WITH MY PROGRAM.I WANTED TO START THE
    CLIENT FROM SERVER I.E THE CLIENT SHOULD BE EXECUTEDCan't be done, unless the server and the client are on the same machine, or you have some other COM object or service set up to allow someone to do this remotely

  • How to run Session ejb client program?

    Hi
    I am using weblogic server8.1 . I was running an ejb session client program it throws exception like below. Can any one tell me how to run a client in weblogic server. give the syntax for running ejb client.
    D:\Weblogicserver\user_projects\domains\mydomain\applications\MyEJB\stateful>jav
    a -cp .;c:\j2ee\j2ee.jar;c:\weblogic\classes;D:\Weblogicserver\weblogic81\server
    \lib\weblogic.jar PortfolioClient
    Exception in thread "main" java.lang.NoClassDefFoundError: PortfolioClient (wron
    g name: stateful/PortfolioClient)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    bye

    If stateful is the package for the client application, you should be executing from
    D:\Weblogicserver\user_projects\domains\mydomain\applications\MyEJB
    on the command line. The command should look like -
    java -classpath <whatever should be here> stateful.MyClient

  • How to run App server applications in Client systems

    Hi all,
    I m new to Oracle Devsuite 10g and App server. I configured the app server and i m able to run in my local machine (server) but i m not able to run in some others machines. even though i have given same path.
    its displaying page cannot be dispalyed
    My path is http://vagee/forms/frmservlet?config=TEST_APPS
    please tell me how to run in client systems?
    Regards,
    Kalyan

    hi
    thanks for your reply. i found the problem. In server machine Firewall was in On Mode. So that it was not allow to access. then i have switched off the firewall. now its running well in client systems also.
    thank you.

  • Running OWB Client from Unix

    Hi
    I am trying to remember how to run OWB client (10gr1) from a unix command. Can anyone please help with what command you run from unix?
    Thanks
    GB

    Hi,
    To start Warehouse Builder using UNIX:
    1.Start a shell.
    2.Navigate (cd) to <OWB ORACLE HOME>/owb/bin/unix
    3. Invoke owbclient.sh
    Thanks,
    Sutirtha

  • How to run a Java EE client application ?

    Greetings,
    I have a Java EE Application Project created with Eclipse (OEPE) and I don't know how to run it ? I asked the question on the OEPE forum but didn't manage to have any pertinent answer. I have also looked at Developing Java EE Application Clients (Thin Clients) in the Programming Stand-alone Clients book and tried to use commands as weblogic.clientDeployer and weblogic.j2eeclient.Main but haven't been able to get them working. And anyway, they are not done to be used in Eclipse as I didn't find any ant tasks for them.
    Many thanks in advance for any help.
    Nicolas

    I have an ear with the following content:
    0 Thu Apr 23 12:20:52 CEST 2009 APP-INF/
    0 Thu Apr 23 12:20:52 CEST 2009 APP-INF/classes/
    0 Thu Apr 23 12:20:52 CEST 2009 APP-INF/lib/
    6843 Thu Apr 23 12:20:52 CEST 2009 APP-INF/lib/ww204-jpa.jar
    0 Thu Apr 23 12:20:52 CEST 2009 META-INF/
    542 Thu Apr 23 12:19:44 CEST 2009 META-INF/application.xml
    25 Thu Apr 23 12:20:52 CEST 2009 META-INF/MANIFEST.MF
    659 Mon Apr 20 18:37:56 CEST 2009 META-INF/weblogic-application.xml
    1220 Thu Apr 23 12:20:52 CEST 2009 ww204-client.jar
    4040 Thu Apr 23 12:20:52 CEST 2009 ww204-ejb.jar
    I'm running the following command:
    java -classpath C:\bea\wlserver_10.3\server\lib\weblogic.jar weblogic.ClientDeployer ww204.ear ww204-client
    This creates the jar with the following content:
    764 Thu Apr 23 12:04:42 CEST 2009 Main.class
    0 Thu Apr 23 12:20:52 CEST 2009 META-INF/
    351 Thu Apr 23 12:10:08 CEST 2009 META-INF/application-client.xml
    43 Thu Apr 23 12:02:26 CEST 2009 META-INF/MANIFEST.MF
    And of course, when I try to run the client using the command:
    C:\Users\nicolas>java -classpath C:\bea\wlserver_10.3\server\lib\weblogic.jar weblogic.j2eeclient.Main ww204-client t3://localhost:7001
    it raises the following exception:
    java.lang.Exception: Stack trace
         at java.lang.Thread.dumpStack(Thread.java:1206)
         at weblogic.j2eeclient.Main.run(Main.java:194)
         at weblogic.j2eeclient.Main.main(Main.java:926)
    java.lang.Exception: Stack trace
         at java.lang.Thread.dumpStack(Thread.java:1206)
         at weblogic.j2eeclient.Main.run(Main.java:196)
         at weblogic.j2eeclient.Main.main(Main.java:926)
    Exception in thread "Main Thread" java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.j2eeclient.Main.run(Main.java:201)
         at weblogic.j2eeclient.Main.main(Main.java:926)
    Caused by: java.lang.NoClassDefFoundError: fr/simplex_software/slsb/FacadeRemote
         at Main.main(Main.java:10)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.j2eeclient.Main.run(Main.java:201)
         at weblogic.j2eeclient.Main.main(Main.java:928)
    The ww204-client.jar was created as an OEPE J2EE Application Project and it was extracted with weblogic.ClientDeployer from the ear exported by OEPE. But it doesn't contain the required classes.

  • Running JMS client on multiple systems (using J2EE 1.4)

    Hello all,
    Can anyone tell me if it is possible to run a JMS client on a system that is not running a J2EE server on localhost? Is there any way to reference the server on another machine (using J2EE 1.4 server)??
    I found information in the J2EE 1.3.1 tutorial that tells of ways to
    - run the client program with both systems running the server
    - run the client program with only one system running the server (which isn't localhost)
    However, the corresponding portion of J2EE 1.4 tutorial only specifies running the client with App server running on both systems...... does this mean that we cannot run a standalone client program with no server on localhost in case of the 1.4 server?
    Also, most of the tutorials on JMS I have seen so far only explain the scenario with both the client and the server on a single machine. Is this how average JMS applications work?? What I mean to ask is, in a typical scenario where does a JMS client run....?? at the server, or at the client (which may or may not be running a server at localhost).
    Thanks for your time.

    The functionality has not changed in J2EE 1.4 outside of reving to JMS 1.1

Maybe you are looking for