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.

Similar Messages

  • 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 long background jobs in ADF applications

    Hi,
    I'm looking for some guidance on how to run an asynchronous job within an ADF application with proper progress notification in the current page.
    Let's assume we have some long running task (e.g. generating notification emails from a bunch of rows in my view object and send them) with the corresponding classes implemented in the DataModel as part of the business logic (e.g. a class that sends a mail to a given recipient).
    Let's assume all the relevant methods can be exposed in the appmodule's client interface so they can be invoked from the ViewController if needed.
    In my jspx page I have implemented the standard af:poll+af:progressIndicator mechanism to give feedback about the running task, backed by a custom BoundedRangeModel
    with methods getValue() and getMaximum(). This works.
    However, all the examples I've found on the net are very very simplistic and only deal with simple counters or countdowns.
    But how to actually implement the whole mechanism in a real life scenario? How do I run the job itself and make it give feedback to my BoundedRangeModel class
    (which in turn is used by the progressIndicator on the page)?
    Is there a recommended way to do this within ADF apps? I've tried to search something about asynchronous method execution in ADF but there seems to be nothing out there.
    Do I need to use standard Java techniques such as a separate Thread running a Runnable worker? Should I use an observer/observable pattern to notify BoundedRangeModel
    and update its internal variables (current value and maximum)? Would this work across a Datacontrol interface?
    Is anything of this allowed within the ADF framework or I'm just gonna break the whole framework model because do-it-yourself concurrent programming isn't allowed in a multithreaded pooled environment?
    Some explanation about the current recommended best practices and/or some practical examples or articles about that would be great.
    (BTW: I'm using version 11.1.1.2.0 and yes, I've checked the contextual events thing too, but that's just an inter-page communication mechanism so it has has nothing to do with what I need to do.)

    Hi
    I have implement a "Runner" class to generate a pdf to every customer of a mailmerge file, which was uploaded. Its simply easy to do something like this. Just add a button, bound the button with a methode out of you applicationModule and start your implementing Thread in this methode.
    public class Runner implements Runnable {
        private String docFileName;
        private String csvFileName;
        private byte[] csvData;
        private byte[] docData;
        private FtpClient client;
        private String category;
        public Runner(String category, String docFileName, byte[] docData,
                      String csvFileName, byte[] csvData, FtpClient client) {
            this.category = category;
            this.docFileName = docFileName;
            this.docData = docData;
            this.csvFileName = csvFileName;
            this.csvData = csvData;
            this.client = client;
        public void run() {
    }In your applicationModule, you can start your Runner like this:
            Runner runner =
                new Runner(category, docFileName, docData, csvFileName, csvData, client);
            new Thread(runner).start();And to the problem with your progressBar. I would create a managedBean with a HashMap<String, HashMap<String, String>>. Every thread you start, add a HashMap<String, String> to this hashmap with the id of the username/session/whatever (must be bound to the user, which starts the thread). This added HashMap<String, String> should be used by your thread to put some status-information into. Now you can try to bind this info to your progressBar.
    I dont know if this will work, it is just an idea ;-)
    Regards
    Majo

  • 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 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 can a workstation client get all tuxedo application service names?

    Which API ATMI C call returns all tuxedo advertised application service names to the client? Is there any way to browse also all running applications?

    The Jolt product that allows Java applications to make use of Tuxedo offers
    a metadata repository that allows an application to store and retrieve
    information about Tuxedo parameters. This is described at
    http://e-docs.bea.com/tuxedo/tux81/jdg/dvrepos.htm
    The release of Tuxedo currently under development, Tuxedo 9.0, will offer
    similar functionality in the Tuxedo product itself.
    The TM_MIB T_SERVICE class does not offer the ability to obtain detailed
    service parameter information, since this information is not stored as part
    of the bulletin board. The T_SERVICE class does offer the ability to obtain
    the buffer type(s) that a service accepts by looking at the value of the
    TA_BUFTYPE parameter. It is not mandatory to specify a BUFTYPE when
    configuring a service in the UBBCONFIG file. If this parameter is omitted,
    its value will default to ALL, and Tuxedo will allow any buffer type to be
    sent to the application service. However, the application logic is likely
    to be expecting a specific buffer type or types and is likely to report an
    error if the service is sent a buffer of an unexpected type.
    <Nageeb Khoury> wrote in message news:[email protected]..
    Thanks Ed for the quick reply!
    Does the TM_MIB(5) / T_SERIVCE return also the parameter format of eachservice e.g Service1 (type1 param1, type2 param2, ...)? If yes in which
    format? e.g CopyBook format or other?
    >
    Thanks
    Nageeb

  • How I create a client standalone in EJB, help me please

    I need create a client standalone but the application no find my JNDI. Will be anyone give me one step by step client standalone in EJB?
    Hugs, thanks

    needing multiple usernames and passwords is going to force you into using a database type log in system. There is no "simple" way to accomplish this. You can also use java, ajax and a number of other types. But for the most secure you want to use a server sided language like ColdFusion, PHP, ASP, etc. That's where your server configuration comes in. What server sided language will it support? That's a good place to start.
    Another good place to start is do you know anything about code to write some on your own? DW does some coding for you, there are plug ins but it is always best to be able to understand the code.
    you can always look through the DW exchange for a small log in system that might be easy for you to change to your needs.

  • How to run a Calc script in ASO application

    Hi,
    I have gone through the Essbase Release 11.1.2 and I tried to implement the Calc scripts in ASO application.
    When I tried to Create a Calc Script using Calc script editor for ASO Application in EAS console it say's "Calc script is not supported in ASO application". When i saved the Calc scripts it appears in Backend but it is not visible in EAS console.
    I tried to call the Calc script using MDX script but it says "Unable to open the file Custom calculation terminated with Essbase error 1241109"
    Can anyone help me how to work on Calc scripts in ASO application?
    Thanks in advance

    I think you might be confusing BSO calc scripts with ASO custom calcs, there is a whole section in the documentation on ASO calcs - http://docs.oracle.com/cd/E40248_01/epm.1112/essbase_db/aso_custcalc_alloc.html
    There are also examples on the internet if you search spend some time researching.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to run a jar file using Java application.

    Hi all,
    I know that jar file can run using the following command, using the command prompt.
    java -jar jar-fileBut I don't know how to run that command through a Java code. Hope it's clear to you.
    So can you please explain how can I do it.
    Thanks,
    itsjava

    rayon.m wrote:
    The solution given by ropp appears to have nothing to do with what you asked about.Ok sir, I got the point.
    I've try a test as follows. But it doesn't give any output. Even not an exception.
            try {
                String[] temp = new String[]{"java", " -jar", " MainApp.jar"};
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec(temp);
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);
                System.out.println("Temp_Values");
            catch(InterruptedException ex) {
                System.out.println(ex.getMessage());
            catch (IOException ex) {
                System.out.println(ex.getMessage());
            }I've debug and see, but the exitValue is even not exist at run time. Can you tell me where I'm going wrong.

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

  • How to run a query in VEV HTML application?

    Hello,
    We are developing an HTML application using VEV sdks. Anybody knows how we can run a query saved in a .rhq file using on-click event in HTML?

    You call the executequery(string) JavaScript function. That means you need to have the text from the rhq file. You can ignore the comments there (// lines and text following // on any line).
    If you you want to read the text literally from the file, you can do that in HTML5 with a method like this
    How to open a local disk file with Javascript? - Stack Overflow
    Most likely you will use fixed strings or compose them in JavaScript and then run them via the function call.

  • Sorry if i sound foolish how to run an applet through a java application

    I am into java from last one month ank keep on exploring it in the want to
    recently i created a application cum applet in the same class like
    applet is doing its own task and there is a main method in the code
    that does entirly different task lets assume displaying *'s on the dos prompt the program is getting complied and belive it its running as desired
    but the only problem that i m facing if i use appletviewer Myclass.java
    only the appletprog is displayed
    and if i run java Myclass than only dos task is done
    may be it is sounding foolish for most of you but if i can get a way
    which will help me in excecuting only one of it and both of them run succesfully
    it tryied different ways to do it but was not succesful
    please do not get irreated if its bizzered but if you really have a solution for it .i will appreciate it
    thanking you

    Yes you can run an Applet from an application. The magic bit is providing an AppletContext and AppletStub!
    Here's how you start it:
            wpa = new WayPointsApplet(this);
            new AppletWrapper(wpa, 380, 320);Here's the class definition: (includes code for my application that can be ignored.
    // Define a wrapper class for the applet
    class AppletWrapper extends Frame implements AppletStub, AppletContext {
        Applet applet;
        // Constructor
        AppletWrapper(Applet a, int x, int y) { 
              applet = a; 
              setTitle(a.getClass().getName());
              setSize(x, y);
              Dimension ss = Toolkit.getDefaultToolkit().getScreenSize();
              setLocation((ss.width-x)/2, (ss.height-y)/2);
              add(a, "Center");
              a.setStub(this);
              // Trap window closing
              addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent we) {
                    // Test if Write left undone before exiting???
                    if(WayPoints.wpa != null) {
                      if(!WayPoints.wpa.okToExit())
                         return;           // Ignore
                    applet.stop();
                    applet.destroy();
                    if(WayPoints.debug || WayPointDefs.plot_debug) {
                      SaveStdOutput.stop();
                    System.exit(0);         // EXIT Program
              });  // end WindowListener
              a.init();
              show();
              a.start();
       } // end constructor
        // AppletStub methods
        public boolean   isActive() { return true; }
        public URL       getDocumentBase() { return null; }
        public URL       getCodeBase() {
            return WayPoints.currDir;
        public String    getParameter(String name) {
            if (name.equalsIgnoreCase("DEBUG")) {
                if (WayPoints.debug)
                    return "YES";
                else
                    return "NO";
            if(name.equals("PLOTDEBUG"))
                return (WayPointDefs.plot_debug ? "YES" : "NO");
            if (name.equalsIgnoreCase("SERVER"))
                return "NO";
            return "";
        public AppletContext getAppletContext() { return this; }
        public void      appletResize(int width, int height) {}
        // AppletContext methods
        public AudioClip getAudioClip(URL url) { return null; }
        public Image     getImage(URL url) { return null; }
        public Applet    getApplet(String name) { return null; }
        public Enumeration getApplets() { return null; }
        public void      showDocument(URL url) {}
        public void      showDocument(URL url, String target) {}
        public void      showStatus(String status) {}
    } // end class AppletWrapper

  • How to run javafx program like a normal application?

    Now,it is known that it is so inconvenient to run javafx program.At least ,I think it is not so perfect to use the command line to run it if it is made into a desktop application.
    Therefore,I think of a way to run the javafx program like a desktop application:
    I write a jase program which include the javafx program as resource and use the jase program to call a *.bat file that can run the javafx program.
    Can it work?

    Rozario,
    You need to use mod_plsql to do this. See the documentation on how to configure mod_plsql in order to access plsql as a web application.
    Thanks,
    Ashseh Parekh
    Oracle9iAS Product Management

  • 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

Maybe you are looking for

  • Interactive quicktime movie from keynote doesn't stream correctly on web

    hello, Any help with this would be extremely appreciated as I've been trying to solve the problem for 3 days straight. I've created an interactive slide show in keynote and now want to stream it on my website. The problem is that the finished product

  • How to pass an xml file as a command line argument

    hi, i would like to know how to pass xml tags (not an xml file) while running java command. i have already compiled the code and i have a .class file generated. i need to pass this argument in the java command because i am calling a web service which

  • IPhone 4S - shutting off itself.

    Just bought it less than a week ago, from the Apple store. It's shut down on its own twice - just going straight off. Plus has rebooted alone at least once that I know of. Is this defective or is there a software problem with the OS? Help really appr

  • Batch number not appearing in OIBT

    Dear Experts, I am facing a problem concerning a Receipt from production. In fact, I have a query running in order to print label. In this query I take the batch number on OIBT table, (link to IGN1 through Baseentry, BaselinNum and BaseType) There is

  • How to migrate Planning from Production to Disaster-Recovery server?

    We are using Planning 11.1.1.3 Oracle repository. Presently our DR Planning Application name is different than production's name, and the DR's Windows server names are different from Production's. Otherwise, all other configuration the same. How do w