Communicating with EJB from an applet

Hello there
can anyone please clarify an issue for me please? I would like to know if it's possible to call and EJB directly from an applet, without going via jsps or servlets. The J2EE specification says that "All J2EE components except applets, can be clients of RMI-IIOP objects. (Some products might also allow applets to use RMI-IIOP, but this capability is not required)." It appears to be the same situation for JDBC connections also. Would anyone please know how some products allow applets to be clients of RMI-IIOP and what exactly is required?
many thanks!

Hi gurus....
I have the same question....
can anyone out there throw some light on the topic ?
many thanks,
Calherj

Similar Messages

  • Communicating with server from an Applet.

    Hi, i've written a tetris game in an applet.
    But i want some way of saving the high scores of everyone on the server.
    Is they anyway to communicate the final score back to the server from the applet?
    I tried saving the scores to a text file but apparently the file would appear on the client.

    Here is some code that you may find useful. This works for the more flexible serialized object approach. For a query string, you would simply do a post on the servlet with the appropriate URL that includes the query string. However, I have found the following serialized object approach to be more convenient.
    import java.net.*;
    import java.io.*;
    This function sends an "AppletRequest" object to the servlet and gets the response back from the servlet in the form of a "ServletResponse" object.
    protected static ServletResponse talkToServlet(AppletRequest aReq) {
    ServletResponse sr = new ServletResponse();
    try {
    // Replace the following URL by the URL of your servlet
    servletURL = new URL("http://myservleturl/");
    servletConn = servletURL.openConnection();
    servletConn.setUseCaches (false);
    servletConn.setRequestProperty("Content-Type",
    "application/octet-stream");
    servletConn.setDoInput(true);
    servletConn.setDoOutput(true);
    } catch (MalformedURLException ex) {
    System.out.println("MalformedURLException"+ex.getMessage());
    } catch (IOException ex) {
    System.out.println("IOException"+ex.getMessage());
    } catch (Exception ex) {
    System.out.println ("GeneralException: " + ex.getMessage());
    try {
    outputToServlet = new ObjectOutputStream(servletConn.getOutputStream());
    outputToServlet.writeObject(aReq);
    outputToServlet.flush();
    outputToServlet.close();
    } catch (Exception ex) {
    System.out.println("GeneralException1: "+ex.getMessage());
    try {
    try{
    inputFrServlet = new ObjectInputStream(servletConn.getInputStream());
    sr = (ServletResponse) inputFrServlet.readObject();
    inputFrServlet.close();
    } catch (EOFException ex) {
    System.out.println("EOFException: "+ex.getMessage());
    } catch (IOException e) {
    System.out.println("IOException: "+e.getMessage());
    e.printStackTrace();
    } catch (ClassNotFoundException e) {
    System.out.println("ClassNotFoundException: "+e.getMessage());
    } catch (Exception e) {
    System.out.println("GeneralException2: "+e.getMessage());
    return(sr);

  • Calling EJB from an applet in 9iAS Release 2?

    Hello!
    In 9iAS Release 1 it is not so easy to call an EJB from an applet. First the applet needs special privileges and then the applet starts only once. The cause of problem is the implementation of ormi.
    Will 9iAS Rel. 2 support Applets calling EJBs?

    Jeff,
    I am also trying to make an applet client for an EJB deployed to OC4J.
    I modified the java2.policy file as you suggested, but when I tried to run my applet, I
    got the following error:
    java.lang.ExceptionInInitializerError: java.security.AccessControlException: access denied (java.util.PropertyPermission tunneling.shortcut read)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at java.lang.Boolean.getBoolean(Unknown Source)
         at com.evermind.server.rmi.RMIInitialContextFactory.<clinit>(RMIInitialContextFactory.java:34)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at its.fnd.ejb.EJBHomeFinder.getHomeObject(Unknown Source)
         at its.fnd.flight.ejb.EJBFlightFactory.<init>(Unknown Source)
         at its.fnd.flight.FlightFactory.<init>(FlightFactory.java:97)
         at EJBApplet.jbInit(EJBApplet.java:47)
         at EJBApplet.init(EJBApplet.java:36)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I am using OC4J (stand-alone) version 9.0.2.0.0 on Solaris 7 and Microsoft Internet Explorer
    5.0 with the java 1.3.1 plug-in.
    Here is the applet code that I use to lookup the EJB home interface:
    Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
    props.put(Context.PROVIDER_URL,"ormi://host:6666/app");
    props.put(Context.SECURITY_PRINCIPAL,"admin");
    props.put(Context.SECURITY_CREDENTIALS,"password");
    Context ctxt = new InitialContext(props);
    Object homeObj = ctxt.lookup("my_bean");
    MyBeanHome home = PortableRemoteObject.narrow(homeObj, MyBeanHome.class);
    The HTML page with the <applet> tag is a static HTML page that is part of OC4J's default
    web application. The applet class file is located in a subdirectory of the default-web-app
    directory. Here is the HTML page...
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>
    HTML Test Page
    </TITLE>
    </HEAD>
    <BODY>
    <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="580" height="450" name="EJBApplet" align="middle" alt="Loading EJBApplet ...">
    <param name="java_code" value="EJBApplet">
    <param name="java_codebase" value="/tests">
    <param name="java_archive" value="xerces.jar,ejb.jar,oc4j.jar,jaas.jar"/>
    <param name="java_type" value="application/x-java-applet;version=1.3">
    <param name="java_scriptable" value="true">
    <table cellpadding="1" bgcolor="#FFFFFF" width="580" height="450">
    <tr><td>
    This is a place for an APPLET.<br>Your browser doesn't support the correct applet java plug-in.<br><br>You can install the correct plug-in from here.<br><a target='_blank' onClick='javascript:self.window.close()' href="/classes/3rdparty/j2re-win-plug-in.exe">Click here to install plug-in.</a><br><br>Or if you have an Internet connection you can install the correct plug-in from here.<br><a target='_blank' onClick='javascript:self.window.close()' href="http://java.sun.com/products/plugin/1.3/plugin-install.html">Click here to install plug-in from Internet.</a><br><br>You can call your System Administrator for assistance.</td></tr>
    </table>
    </object>
    </BODY>
    </HTML>
    I have searched the Internet, and the documentation, and tried several, different things,
    but I can't get it to work.
    Any and all help will be greatly appreciated.
    Thanks,
    Sofia.

  • Accesing an EJB from an Applet

    Hello,
    I've published my first EJB to Oracle 8i, and when I use a
    standalone java application as a client I have no problems.
    But when I try to access with an Applet, the Java console shows:
    javax.naming.NotContextException:
    retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
    The code I use to connect to the EJB is the same as in the
    standalone application:
    Hashtable env = new Hashtable();
    System.out.println("Inicializando entorno...");
    env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put(Context.SECURITY_PRINCIPAL, "valentin");
    env.put(Context.SECURITY_CREDENTIALS, "valentin");
    env.put(Context.SECURITY_AUTHENTICATION,
    ServiceCtx.NON_SSL_LOGIN);
    System.out.println("Inicializado");
    try{
    Context ic = new InitialContext(env);
    System.out.println("Contexto inicial creado");
    MyEJBHome home = (MyEJBHome)
    ic.lookup("sess_iiop://retvalentin09.cedetel.tel.uva.es:2481:ORCL
    /test/MyEJBRemote");
    System.out.println("Obtenido home Interface");
    try{
    try{
    MyEJBRemote holaBean = home.create(); // create a
    bean instance
    System.out.println("Obtenida referencia a EJB");
    System.out.println("Resultado: "+holaBean.DimeHola());
    } catch (java.rmi.RemoteException
    RE){System.out.println("Excepcion remota: "+RE);}
    }catch (javax.ejb.CreateException
    CE){System.out.println("Excepcion de creacion: "+CE);}
    }catch (javax.naming.NamingException
    nE){System.out.println("Excepcion de nombrado: "+nE);}
    System.out.println("Finalizado");
    What is going wrong? I use Java Plugin 1.2.2 in the
    navigator, perhaps that is the problem.
    I've tried to compile the applet in JDeveloper 2.0 with JDK
    1.1.7, but the Netscape Communicator throws Security Exceptions
    (I think the JVM of the navigator is 1.1.5), and it happens the
    same with Internet Explorer.
    I've tried to compile the applet in JDevelper 2.0 whit JDK 1.2,
    and in both Communicator and Explorer the Java Console shows this
    messages:
    Java(TM) Plug-in: Version 1.2.2.pu
    Using JRE version 1.2.2
    User home directory = C:\WINNT\Profiles\Administrador
    Proxy Configuration: Manual Configuration
    Proxy: http=proxy.uva.es:80
    Proxy Overrides:
    JAR cache disabled.
    Inicializando entorno...
    Inicializado
    Contexto inicial creado
    Excepcion de nombrado: javax.naming.NotContextException:
    retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
    Finalizado
    I would appreciate if somebody could help me, as it is very
    urgent.
    Thanks in advance
    Valentin
    null

    Hi
    Oracle8i comes with set of samples. One of sample is accessing an
    EJB from applet. check out demo.tar/demo.zip file
    $ORACLE_HOME/javavm/demo directory.
    You will find it useful.
    regards
    raghu
    Valentin Alonso (guest) wrote:
    : Hello,
    : I've published my first EJB to Oracle 8i, and when I use a
    : standalone java application as a client I have no problems.
    : But when I try to access with an Applet, the Java console
    shows:
    : javax.naming.NotContextException:
    : retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
    : The code I use to connect to the EJB is the same as in the
    : standalone application:
    : Hashtable env = new Hashtable();
    : System.out.println("Inicializando entorno...");
    : env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    : env.put(Context.SECURITY_PRINCIPAL, "valentin");
    : env.put(Context.SECURITY_CREDENTIALS, "valentin");
    : env.put(Context.SECURITY_AUTHENTICATION,
    : ServiceCtx.NON_SSL_LOGIN);
    : System.out.println("Inicializado");
    : try{
    : Context ic = new InitialContext(env);
    : System.out.println("Contexto inicial creado");
    : MyEJBHome home = (MyEJBHome)
    ic.lookup("sess_iiop://retvalentin09.cedetel.tel.uva.es:2481:ORCL
    : /test/MyEJBRemote");
    : System.out.println("Obtenido home Interface");
    : try{
    : try{
    : MyEJBRemote holaBean = home.create(); // create a
    : bean instance
    : System.out.println("Obtenida referencia a EJB");
    : System.out.println("Resultado:
    "+holaBean.DimeHola());
    : } catch (java.rmi.RemoteException
    : RE){System.out.println("Excepcion remota: "+RE);}
    : }catch (javax.ejb.CreateException
    : CE){System.out.println("Excepcion de creacion: "+CE);}
    : }catch (javax.naming.NamingException
    : nE){System.out.println("Excepcion de nombrado: "+nE);}
    : System.out.println("Finalizado");
    : What is going wrong? I use Java Plugin 1.2.2 in the
    : navigator, perhaps that is the problem.
    : I've tried to compile the applet in JDeveloper 2.0 with JDK
    : 1.1.7, but the Netscape Communicator throws Security Exceptions
    : (I think the JVM of the navigator is 1.1.5), and it happens the
    : same with Internet Explorer.
    : I've tried to compile the applet in JDevelper 2.0 whit JDK 1.2,
    : and in both Communicator and Explorer the Java Console shows
    this
    : messages:
    : Java(TM) Plug-in: Version 1.2.2.pu
    : Using JRE version 1.2.2
    : User home directory = C:\WINNT\Profiles\Administrador
    : Proxy Configuration: Manual Configuration
    : Proxy: http=proxy.uva.es:80
    : Proxy Overrides:
    : JAR cache disabled.
    : Inicializando entorno...
    : Inicializado
    : Contexto inicial creado
    : Excepcion de nombrado: javax.naming.NotContextException:
    : retvalentin09.cedetel.tel.uva.es:2481:ORCL/test/MyEJBRemote
    : Finalizado
    : I would appreciate if somebody could help me, as it is very
    : urgent.
    : Thanks in advance
    : Valentin
    null

  • Accessing EJB from an Applet

    Hi
    I m new to Application servers and EJBs. I have successfully deployed a small EJB in Oracle9i AS. Now I want to write an client to access the EJB. I want the client to be an Applet. But i have found that the applet works only if certain permissions are granted in the client machine
    Is there any way by which i can write an Applet that can access an EJB without making any changes in the client machine.
    The code I use in the applet is given below.
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://solomon:23791/helloEjb");
    env.put("java.naming.security.principal", "admin");
    env.put("java.naming.security.credentials", "welcome");
    Context ic = new InitialContext (env);
    HelloHome hello_home = (HelloHome)ic.lookup ("java:comp/env/helloServer.HelloBean");
    Hello hello = hello_home.create ();
    System.out.println (hello.helloWorld ());
    The Exception i get while running the Applet without making any changes in the client machine is...
    java.security.AccessControlException: access denied (java.util.PropertyPermission localhostIsAdmin read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:399)      
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)      
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1278)      
    at java.lang.System.getProperty(System.java:599)      
    at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:156)      
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)      
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)      
    at javax.naming.InitialContext.init(InitialContext.java:222)      
    at javax.naming.InitialContext.<init>(InitialContext.java:198)      
    at TrialApplet.init(TrialApplet.java:51)      
    at sun.applet.AppletPanel.run(AppletPanel.java:344)      
    at java.lang.Thread.run(Thread.java:484) Process Exit...
    If i use "com.evermind.server.rmi.RMIInitialContextFactory" instead of "com.evermind.server.ApplicationClientInitialContextFactory" the Exception is ..
    java.security.AccessControlException: access denied (java.util.PropertyPermission localhostIsAdmin read)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:399)      
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)      
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1278)      
    at java.lang.System.getProperty(System.java:599)      
    at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:156)      
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)      
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)      
    at javax.naming.InitialContext.init(InitialContext.java:222)      
    at javax.naming.InitialContext.<init>(InitialContext.java:198)      
    at TrialApplet.init(TrialApplet.java:51)      
    at sun.applet.AppletPanel.run(AppletPanel.java:344)      
    at java.lang.Thread.run(Thread.java:484) Process Exit...
    Thank you
    Raees

    hi Raees,
    sorry for replying late. u r right that it gives u the same server name as that of hard coding it. but the thing is we should better leave it to the explorer, coz sometimes suppose the server is on the same m/c as that of client then applet to EJB call gives security exception in one of these two; 127.0.0.1 and the actual IP of m/c, even though both are same. (reason, for the sand box, 127.0.0.1 and actual IP are different addresses). it will work only with the IP address, with which it had downloaded applet, so that's the reason i said this, coz if they are on the same m/c, client can call it both ways and then hard coded thing will give problem in one case.
    second thing, have u tried running it that way? i think, we just need to pass the server name and as we are the setting all these properties for JNDI services, it can detect on which port of server the naming service is running. and also i am not really sure, whether applet can use all the protocols or not (except for http). for futher reference, use this hyperlink. this is for j-boss app.server but shouldn't make much of the difference.
    http://jboss.org/online-manual/HTML/ch13s21.html
    hope this helps,
    anshu

  • Communication with EJB Server old address,Help!

              I meet a Strange problem in weblogic 61 I use some IP address at 3 ejb server(cluster),that
              is ok,but at one time I changed the IP address and changed config.xml and delete
              all of ejb caches and temp classes,but when I use netstat, I still can find the
              connection to IP old address is at SYN_SEND state, I do not know why the ejb server
              communication by the old address? but the application is runing fine, I wonder
              this problem affect performance,any idea or suggestion?
              

    Hello Venky,
    Thanks for the reply.
    I didn't see any connection established message in the Event Viewer or logs..
    Can you post the snippet of the Event Viewer or logs which says " connection established" or similar ...
    Thanks & regards,
    Naresh

  • [iphone] Communicating with desktop from my app

    Hello,
    I'm investigating ways to communicate from my iPhone application to outer world.
    I know obvious ways (IP over either WiFi or GPRS/3G/whatever). But I believe there should be way to contact desktop computer (either Mac or PC) using USB cable. I don't mean transferring files using iTunes but rather communicate my desktop and iPhone programs with each other.
    I haven't found any info about it so far.
    Does anyone knows?

    Oh my
    Is there any "official" information about it somewhere?
    Thanks.

  • Why is Firefox communicating with China from the UK?

    Hello there, I'm using a Firefox beta v13) and have had my firewall warn me that Firefox was attempting an outbound communication to IP 117.21.224.232. It's done this before (in prior versions too) and if I deny the connection, Firfox stops working.
    I finally did a lookup on the IP and found that it's in China. Why is Firefox doing this and how do I make it stop? I'm rather worried.
    Thanks,
    Orbis

    Have you tested in Firefox's Safe Mode to see whether it is caused by a custom setting or add-on?
    First, I recommend backing up your Firefox settings in case something goes wrong. See [https://support.mozilla.com/en-US/kb/Backing+up+your+information Backing up your information]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, restart Firefox in [http://support.mozilla.com/kb/Safe+Mode Safe Mode] using
    Help > Restart with Add-ons Disabled
    In the Safe Mode dialog, do not check any boxes, just click "Continue in Safe Mode."
    If you still get the connection out, you could also try disabling all update checking (Options > Advanced > Update > "Never check"). Does that make any difference?

  • Calling EJB from applet

    Hi friends,
    I have a problem of caling EJB from applet.that too from browser.
    Through dos prompt,I am able to set the classpath and then open the applet and then call the EJB.but thru browser i am encontering two problems,
    First,The codebase of applet is not being set and i am unable to view the applet.
    Second,my Initial Context Factory is not being found it is giving error as
    Cannot instantiate class: com.evermind.server.rmi.RMIInitialContextFactory.I am using oracle app server Oc4j2.
    can any one help me out.
    i am able to get output thru dos prompt where i can set classpath

    kyren,
    he has used something called HTML ConvertersDepends on the version of the plug-in you are using.
    (I'm sorry, but I couldn't find that detail in any of your posts!)
    You have to use the (HTML) converter with java version 1.3 (for example), but you don't have to with java version 1.4.
    thru my jbuilder version i am able to solve my
    problem.
    but thru browser,i am first of all not able to
    display applet.That's because "JBuilder" uses the appletviewer to display the applet (and not a browser).
    I Think for normal displaying applet we don't need of
    signed or unsigned applet.when calling ejb we may
    require.As Anupama has stated, the "codebase" attribute of the applet tag must be relative to the directory where the HTML file (containing the "applet" tag) is located. Where I work, we also use the "archive" attribute that tells the applet where to download the JAR files from. In order to lookup your ejb from your applet, you need (at least) the "oc4jclient.jar" file.
    By the way, if you want your name to appear next to your posts (instead of your ID number), you need to update your profile. Click on the "Forum Settings" link at the top of the (Web) page.
    Good Luck,
    Avi.

  • JNDI lookup from proxied applet is slow

    Hi,
    I am doing a t3s lookup for an EJB from an applet. The lookup is fairly fast (<
    1 sec) if the browser is
    setup to not use an HTTP proxy server. However, if the browser is setup to go
    via a proxy server, the
    t3s lookup takes upwards of 30 seconds.
    Running the Weblogic server with -Dweblogic.system.enableReverseDNSLookups=false
    makes
    no difference.
    I am using WLS5.1SP9, and Netscape 4.7 and IE5 browsers.
    Any suggestions, please?
    Thanks
    Ravi

    Your File-system Object Store should be in a place
    accessible by your client application. Then you can
    specify JNDI properties
    java.naming.factory.initial
    java.naming.provider.url
    for the initial context. There are examples in
    <install-directory>/examples/jms directory.
    The ConnectionFactory object you created should
    have broker hostname and port (if not default)
    specified.
    amy

  • Activate a Midlet from an Applet

    Hi,
    I am trying to activate a Midlet from an Applet? Is this possible in any of the latest J2ME releases?
    Using SATSA I am able to send APDU commands from the Midlet to the Applet and start a scenario where my Applet and Midlet exchange information.
    Is this available in the opposite direction. I want that my Applet, when triggered by an event, be able to Activate\Wake Up the Midlet.
    I am a newbie to J2ME and after researching the web, still couldn't find an answer. Thanks for your help.
    Bye.

    You can communicate with servlet from an applet, using URL connection, and then send POST/GET methods through HTTP protocol, here is a code snippet,
    // applet side, this method will send a POST method to the servlet and then get url openstream to read a
    // returned object from the servlet, params should be in the form param1=value&param2=value etc...
    public Object getObjectFromServlet(String servletName,String params) {
        Object object = null;
        try {
          URL url = new URL(codeBase,
                            contextRoot + servletName + params);
          URLConnection con = url.openConnection();
          con.setUseCaches(false);
          InputStream in = con.getInputStream();
          ObjectInputStream result = new ObjectInputStream(in);
          object = result.readObject();
          result.close();
          in.close();
        catch (ClassNotFoundException ex) {
          System.err.println("ClassNotFoundException caught:" + ex.getMessage());
        catch (MalformedURLException ex) {
          System.err.println("MalformedURLException caught:" + ex.getMessage());
        catch (IOException ex) {
          System.out.println("IOException caught:" + ex.getMessage());
        return object;
    //servlet side
    public void doPost(HttpServletRequest request, HttpServletResponse response){
          //Extract all the necessary supplied parameters from the request object and configurations.
           String param1 = request.getParameter("param1");
           String param2 = request.getParameter("param2");
      try {
            ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
            out.writeObject(object);
            out.close();
          catch (IOException ioe) {
            System.err.println("IOException caught:" + ioe.getMessage());
    }

  • Porting EJBS from orion to JBoss

    Hi
    I want to port EJBs written in Orion application server to JBoss,
    Which of the arreas chages are needed ? ,
    Currently I am accessing EJBs from an Applet.
    So can i use directly ear files in the Orion application server for JBoss.
    I want my what all need be changed in following areas.
    1. Server configuration
    2. EJB deployment
    3. Client code access ( i need to change JNDI initial contexts )
    4. JMS configurations
    thanks in advance
    Renjith

    Renjithkv,
    You would require different deployment descriptors for JBoss.
    jboss.xml for Ejbs.
    Modify standardjaws.xml or create jaws.xml for entity beans.
    Modify standardjbosscmp-jdbc.xml or create jbosscmp-jdbc.xml for Ejb jdbc.
    Deepak

  • Establishing communication with GPIB devices

    I am a newbee to GPIB and a novice at VB (6.0). Have been unable to establish communication with devices from the VB .exe. I think I am not declaring something in the right place? Any suggestions?

    TG,
    What kind of trouble are you having reading data from the instruments? There's information that addresses some of the common issues about why communication with instruments might fail. For more information, please refer to:
    Why Can't I Communicate with My GPIB Instrument?
    A couple of useful tools that you can use to check out communication to the instrument before writing your Visual Basic app are NI-488.2 Communicator and
    Interactive Control (IBIC)
    If you are still having trouble after trying out some of the suggestions listed above, it would be helpful if you capture the ibwrt and ibrd calls using NI Spy, save the Spy capture, and then attach it to this forum. If you are unfamiliar with Spy, here's a link with information about how to use Spy:
    NI Spy
    Hope this information helps with getting data back from the instrument.

  • A servlet  From an applet

    Dear friends,
    Hope you are doing well.
    I am facing a problem of how to call a servlet from an applet.
    Any help , please forward it.
    thanks
    vishal

    You can communicate with servlet from an applet, using URL connection, and then send POST/GET methods through HTTP protocol, here is a code snippet,
    // applet side, this method will send a POST method to the servlet and then get url openstream to read a
    // returned object from the servlet, params should be in the form param1=value&param2=value etc...
    public Object getObjectFromServlet(String servletName,String params) {
        Object object = null;
        try {
          URL url = new URL(codeBase,
                            contextRoot + servletName + params);
          URLConnection con = url.openConnection();
          con.setUseCaches(false);
          InputStream in = con.getInputStream();
          ObjectInputStream result = new ObjectInputStream(in);
          object = result.readObject();
          result.close();
          in.close();
        catch (ClassNotFoundException ex) {
          System.err.println("ClassNotFoundException caught:" + ex.getMessage());
        catch (MalformedURLException ex) {
          System.err.println("MalformedURLException caught:" + ex.getMessage());
        catch (IOException ex) {
          System.out.println("IOException caught:" + ex.getMessage());
        return object;
    //servlet side
    public void doPost(HttpServletRequest request, HttpServletResponse response){
          //Extract all the necessary supplied parameters from the request object and configurations.
           String param1 = request.getParameter("param1");
           String param2 = request.getParameter("param2");
      try {
            ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
            out.writeObject(object);
            out.close();
          catch (IOException ioe) {
            System.err.println("IOException caught:" + ioe.getMessage());
    }

  • Trouble in communicating with another EJB from an EJB

    I have created a stateless session bean, and inside this bean I have methods that calls methods in another stateless session bean (called myEJB, for example). When I run the code, it kept giving me the "noClassDefFoundError":
    java.rmi.RemoteException: Error in ejbCreate:; nested exception is:
         java.lang.NoClassDefFoundError: com.mybean.myEJBHome
    Someone suggested to me that this is because they aren't remote objects, so I created local interfaces for "myEJB". When I run the code again (by binding to the Local interface now), I got this error:
    javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: Unable to resolve
    'app/ejb/mybeans.jar#myEJB/local-home' Resolved: 'app/ejb/ Unresolved:'mybeans.jar#myEJB' ;
    remaining name 'mybeans.jar#myEJB/local-home']; Link Remaining Name:
    'java:app/ejb/mybeans.jar#myEJB/local-home'
    Any ideas??
    Thanks

    To refer a Ejb from another Ejb include <ejb-ref> in ejb-jar.xml
    <session>
    <ejb-name>EjbA</ejb-name>
    <ejb-ref>
    <ejb-ref-name>Ejb2</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.ejb.Ejb2Home</home>
    <remote>com.ejb.Ejb2</remote>
    </ejb-ref>
    <session>
    Include a <reference-discriptor> in weblogic-ejb-jar.xml
    <weblogic-enterprise-bean>
    <ejb-name>EjbA</ejb-name>
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>Ejb2</ejb-ref-name>
    <jndi-name>protocol://<Ejb2host>:<PortNumber>/com.ejb.Ejb2Home</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    Example <jndi-name>:http://localhost:7001/com.ejb.Ejb2Home
    In EjbA bean class refer to Ejb2 method with a reference to Ejb2 remote interface.
    InitialContext initialContext = new InitialContext();
    Ejb2Home ejb2Home = (Ejb2Home)initialContext.lookup("protocol://<Ejb2host>:<PortNumber>/com.ejb.Ejb2Home");

Maybe you are looking for